結果
| 問題 |
No.8062 A + B
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-26 20:19:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 584 bytes |
| コンパイル時間 | 1,429 ms |
| コンパイル使用メモリ | 168,792 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-11-28 19:40:43 |
| 合計ジャッジ時間 | 1,996 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
long long m,n;
string a,b;
cin>>a>>b;
if(b.at(0)=='-'){
m=stoll(a.c_str());
n=stoll(b.c_str());
cout<<(m+n)<<"\n";
}else{
m=stoll(a.c_str());
n=stoll(b.c_str());
if(m+n!=0 && a.at(0)=='0'){
cout<<a.substr(1,a.size())<<b<<"\n";
}else if(a.at(0)=='-' && a.at(1)=='0'){
cout<<"-"<<a.substr(2,a.size())<<b<<"\n";
}else{
cout<<a<<b<<"\n";
}
}
}