結果
| 問題 | No.8124 A+B |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-01 22:18:27 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 654 bytes |
| 記録 | |
| コンパイル時間 | 1,960 ms |
| コンパイル使用メモリ | 214,356 KB |
| 実行使用メモリ | 222,196 KB |
| 最終ジャッジ日時 | 2026-04-01 22:18:35 |
| 合計ジャッジ時間 | 7,601 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
int main(){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
ll i,j;
string A,B;
cin >> A >> B;
ll n=A.size(),m=B.size();
string x;
if(n>=m){
REP(i,m){
ll d=A[i]-'0'+B[i]-'0';
x+=d%10+'0';
}
for(i=m;i<n;i++) x+=A[i];
cout << x << endl;
}
else{
REP(i,n){
ll d=A[i]-'0'+B[i]-'0';
x+=d%10+'0';
}
for(i=n;i<m;i++) x+=A[i];
cout << x << endl;
}
return 0;
}