結果
| 問題 | No.2086 A+B問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-07-21 14:45:50 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 450µs | |
| コード長 | 1,285 bytes |
| 記録 | |
| コンパイル時間 | 6,398 ms |
| コンパイル使用メモリ | 419,608 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-21 14:45:59 |
| 合計ジャッジ時間 | 7,925 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
//*
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//*/
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using P=pair<int,int>;
using Pl=pair<ll,ll>;
constexpr int mod=998244353;
constexpr int Mod=1e9+7;
constexpr int inf=Mod;
constexpr ll linf=(ll)inf*inf;
constexpr int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
constexpr int Dx[]={1,1,1,0,0,-1,-1,-1},Dy[]={1,0,-1,1,-1,1,0,-1};
struct initio{
initio(){
cin.tie(0)->sync_with_stdio(0);
cout<<fixed<<setprecision(20);
};
}iio;
template<class T>
bool chmax(T&a,const T&b){
if(a<b){
a=b;
return 1;
}
return 0;
}
template<class T>
bool chmin(T&a,const T&b){
if(a>b){
a=b;
return 1;
}
return 0;
}
//*
#include<atcoder/all>
using namespace atcoder;
using mint=modint998244353;
using Mint=modint1000000007;
//*/
int main(){
string A,B;
cin>>A>>B;
vector<int>a,b;
for(int i=A.size()-1;i>=0;i--)
a.push_back(A[i]-'0');
for(int i=B.size()-1;i>=0;i--)
b.push_back(B[i]-'0');
vector<int>c;
int tmp=0;
for(int i=0;i<max(a.size(),b.size());i++){
if(i<a.size())
tmp+=a[i];
if(i<b.size())
tmp+=b[i];
c.push_back(tmp%10);
tmp/=10;
}
if(tmp)
c.push_back(tmp);
for(int i=c.size()-1;i>=0;i--)
cout<<c[i];
cout<<endl;
}