Submission #82302
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include<bits/stdc++.h> using namespace std; #define int long long signed main(){ string s,t;cin>>s>>t; vector< int >a(100009),b(100009),ans(100009); for ( int i=0,j=s.size()-1;j>=0;j--,i++){ a[i]=s[j]- '0' ; } for ( int i=0,j=t.size()-1;j>=0;j--,i++){ b[i]=t[j]- '0' ; } int num=0; for ( int i=0;i<5000;i++){ ans[i]=a[i]+b[i]+num; num=ans[i]/10; ans[i]%=10; } bool f= false ; for ( int i=5000;i>=0;i--){ if (ans[i]!=0)f= true ; if (f){ cout<<ans[i]; } } cout<< "\n" ; } |
ステータス
項目 | データ |
---|---|
問題 | 1944 - 足し算をしよう |
ユーザー名 | ei2326 |
投稿日時 | 2025-01-09 18:23:34 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 602 Byte |
最大実行時間 | 27 ms |
最大メモリ使用量 | 3164 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 10000 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.txt | WA | 26 ms | 3164 KB |
1
|
in02.txt | AC | 22 ms | 2760 KB |
1
|
in03.txt | AC | 22 ms | 2688 KB |
1
|
in04.txt | AC | 27 ms | 2744 KB |
1
|
in05.txt | AC | 21 ms | 2668 KB |
1
|
in06.txt | WA | 25 ms | 2976 KB |
1
|
in07.txt | AC | 21 ms | 2828 KB |
1
|
in08.txt | AC | 21 ms | 2860 KB |
1
|
in09.txt | WA | 20 ms | 2760 KB |
1
|