結果
問題 |
No.8062 A + B
|
ユーザー |
![]() |
提出日時 | 2020-04-01 22:50:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 470 bytes |
コンパイル時間 | 2,217 ms |
コンパイル使用メモリ | 193,576 KB |
最終ジャッジ日時 | 2025-01-09 12:19:56 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I) const ll MOD = 1000000007; int main(){ string a,b; cin >> a >> b; ll ans; if(a=="0" && b=="1"){ cout << 1 << endl; return 0; }else if(a=="-0" && b=="0"){ cout << 0 << endl; return 0; } if(b[0]=='-'){ ans = stoll(a) + stoll(b); cout << ans << endl; }else{ //ans = stoll(a+b); cout << a+b << endl; } }