ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#215134 | #2656. add | fddwd | 30 | 0ms | 1236kb | C++11 | 616b | 2024-11-26 19:53:57 | 2024-11-26 23:03:04 |
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
string s;
inline bool check(string a,string b,string c){
ll x=0,y=0,z=0;
for(int i=0;i<a.length();++i) x=x*10+a[i]-'0';
for(int i=0;i<b.length();++i) y=y*10+b[i]-'0';
for(int i=0;i<c.length();++i) z=z*10+c[i]-'0';
return x+y==z;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
cin>>s;
for(int i=0;i<s.length();++i)
for(int j=i+1;j+1<s.length();++j){
string a=s.substr(0,i+1),b=s.substr(i+1,j-i),c=s.substr(j+1);
if(check(a,b,c)){
cout<<a<<"+"<<b<<"="<<c<<endl;
break;
}
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 5
Accepted
time: 0ms
memory: 1232kb
input:
93944386991110939443869921
output:
939443869911+10=939443869921
result:
ok single line: '939443869911+10=939443869921'
Test #2:
score: 5
Accepted
time: 0ms
memory: 1236kb
input:
454431423351945476661
output:
45443142+33519=45476661
result:
ok single line: '45443142+33519=45476661'
Test #3:
score: 5
Accepted
time: 0ms
memory: 1236kb
input:
807674775734008076747757340
output:
8076747757340+0=8076747757340
result:
ok single line: '8076747757340+0=8076747757340'
Test #4:
score: 5
Accepted
time: 0ms
memory: 1236kb
input:
47936157175791479437362
output:
479361571+75791=479437362
result:
ok single line: '479361571+75791=479437362'
Test #5:
score: 5
Accepted
time: 0ms
memory: 1232kb
input:
8684160719450790868416071945079
output:
868416071945079+0=868416071945079
result:
ok single line: '868416071945079+0=868416071945079'
Test #6:
score: 5
Accepted
time: 0ms
memory: 1232kb
input:
3150325920082064131504079841
output:
31503259200+820641=31504079841
result:
ok single line: '31503259200+820641=31504079841'
Test #7:
score: 0
Time Limit Exceeded
input:
9261598869160335057970310229283612818845075445997339978957735823966059362624832990688056822195031820...
output:
result:
Test #8:
score: 0
Time Limit Exceeded
input:
4701609646464966471786112512122938863110668626139644802941307402470417596440427343650542031038908331...
output:
result:
Test #9:
score: 0
Time Limit Exceeded
input:
9257202799561473086244723527541134302291247300137775651258683390946286052100443441136004200934466749...
output:
result:
Test #10:
score: 0
Time Limit Exceeded
input:
4416728326936622856150699213135191910979789931946758505266833530473668185681946524100519868737557117...
output:
result:
Test #11:
score: 0
Time Limit Exceeded
input:
3061041362133228009344583160193669358685821190644364754039063887060686947993153784177860432362852231...
output:
result:
Test #12:
score: 0
Time Limit Exceeded
input:
8531603642906385747583399978283975747482545589702570907905311483331351132043885935451850547243462360...
output:
result:
Test #13:
score: 0
Time Limit Exceeded
input:
3334731073815946487356418721839719459473953466541212185094515699104064312397044785650155583747481091...
output:
result:
Test #14:
score: 0
Time Limit Exceeded
input:
7113181137342253409543193679407457232222929505170124047879622285985297849800487899060254257891240998...
output:
result:
Test #15:
score: 0
Time Limit Exceeded
input:
2226576415518523623432262365703901892218433052474981493103118406267304359951441730045611163295598279...
output:
result:
Test #16:
score: 0
Time Limit Exceeded
input:
7282380568017210841065149843225478309106222219195648724985194189592224139941051182898879219925651713...
output:
result:
Test #17:
score: 0
Time Limit Exceeded
input:
6172023021615818261278406139291452768117320772111777913293782100858187571870407831738505138788606992...
output:
result:
Test #18:
score: 0
Time Limit Exceeded
input:
1641729471229192950020661455158841378773007409709289573050186474289570718374236969060246403530844480...
output:
result:
Test #19:
score: 0
Time Limit Exceeded
input:
6878197288916471551222877849454599200431985721720556540869310866854759368074574456390764568703818252...
output:
result:
Test #20:
score: 0
Time Limit Exceeded
input:
1336335135465815186373041570173603326293570642638147764739718555949768772153761126675803325646928488...