Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.003 s | 0 KBi |
#2 |
Correcto
|
0.004 s | 0 KBi |
#3 |
Correcto
|
0.002 s | 0 KBi |
#4 |
Correcto
|
0.007 s | 3 KBi |
#5 |
Correcto
|
0.005 s | 0 KBi |
#6 |
Correcto
|
0.004 s | 0 KBi |
#7 |
Correcto
|
0.004 s | 0 KBi |
#8 |
Correcto
|
0.004 s | 12 KBi |
#9 |
Correcto
|
0.001 s | 0 KBi |
#10 |
Correcto
|
0.001 s | 0 KBi |
#11 |
Correcto
|
0.005 s | 0 KBi |
#12 |
Correcto
|
0.008 s | 7 KBi |
#13 |
Correcto
|
0.005 s | 0 KBi |
#14 |
Correcto
|
0.005 s | 0 KBi |
#15 |
Correcto
|
0.005 s | 4 KBi |
#16 |
Correcto
|
0.004 s | 1 KBi |
#17 |
Correcto
|
0.004 s | 0 KBi |
#18 |
Correcto
|
0.004 s | 1 KBi |
#19 |
Correcto
|
0.004 s | 1 KBi |
#20 |
Correcto
|
0.004 s | 0 KBi |
#21 |
Correcto
|
0.005 s | 0 KBi |
#22 |
Correcto
|
0.004 s | 14 KBi |
#23 |
Correcto
|
0.001 s | 0 KBi |
#24 |
Correcto
|
0.004 s | 0 KBi |
#25 |
Correcto
|
0.001 s | 0 KBi |
#26 |
Correcto
|
0.005 s | 0 KBi |
#27 |
Correcto
|
0.004 s | 6 KBi |
#28 |
Correcto
|
0.004 s | 0 KBi |
#29 |
Correcto
|
0.001 s | 0 KBi |
#30 |
Correcto
|
0.004 s | 1 KBi |
#31 |
Correcto
|
0.007 s | 0 KBi |
#32 |
Correcto
|
0.005 s | 0 KBi |
#33 |
Correcto
|
0.002 s | 0 KBi |
#34 |
Correcto
|
0.004 s | 1 KBi |
#35 |
Correcto
|
0.002 s | 0 KBi |
#36 |
Correcto
|
0.005 s | 0 KBi |
#37 |
Correcto
|
0.005 s | 0 KBi |
#38 |
Correcto
|
0.004 s | 0 KBi |
#include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<n;i++) #define pb push_back #define ff first #define ss second #define ii pair<int,int> #define vi vector<int> #define vii vector<ii> #define lli long long int #define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; ostream& operator<<(ostream& os, const vector<int> &v){ for(auto const &i: v){ os<<i<<" "; } os<<endl; return os; } const lli mod=(1e9)+7; const int N = 1e4+1; int main(){ fast_io; string a;cin>>a; string b;cin>>b; if(a.size()<b.size())swap(a,b); //el mayor en a int dif = abs((int)a.size()-(int)b.size()); string tmp = ""; REP(i,dif)tmp+='0'; b = tmp+=b; //cout<<a<<endl; //cout<<b<<endl; int llevo = 0; string ans = ""; for(int i = b.size()-1; i>=0; i--){ int aa = a[i]-'0'; int bb = b[i]-'0'; char res = ((aa+bb+llevo)%10)+'0'; ans+=res; if(aa+bb+llevo>=10)llevo = 1; else llevo = 0; } if(llevo)ans+='1'; for(int i=ans.size() - 1;i>=0;i--){ cout<<ans[i]; } cout<<endl; return 0; }