Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.004 s | 2 KBi |
#2 |
Correcto
|
0.004 s | 2 KBi |
#3 |
Correcto
|
0.006 s | 2 KBi |
#4 |
Correcto
|
0.005 s | 6 KBi |
#5 |
Correcto
|
0.005 s | 2 KBi |
#6 |
Correcto
|
0.003 s | 2 KBi |
#7 |
Correcto
|
0.004 s | 3 KBi |
#8 |
Correcto
|
0.005 s | 2 KBi |
#9 |
Correcto
|
0.005 s | 2 KBi |
#10 |
Correcto
|
0.005 s | 8 KBi |
#11 |
Correcto
|
0.005 s | 1 KBi |
#12 |
Correcto
|
0.004 s | 2 KBi |
#13 |
Correcto
|
0.003 s | 2 KBi |
#14 |
Correcto
|
0.003 s | 9 KBi |
#15 |
Correcto
|
0.004 s | 9 KBi |
#16 |
Correcto
|
0.005 s | 6 KBi |
#17 |
Correcto
|
0.006 s | 2 KBi |
#18 |
Correcto
|
0.007 s | 37 KBi |
#19 |
Correcto
|
0.005 s | 2 KBi |
#20 |
Correcto
|
0.005 s | 20 KBi |
#21 |
Correcto
|
0.006 s | 1 KBi |
#22 |
Correcto
|
0.005 s | 2 KBi |
#23 |
Correcto
|
0.004 s | 5 KBi |
#24 |
Correcto
|
0.004 s | 6 KBi |
#25 |
Correcto
|
0.006 s | 1 KBi |
#26 |
Correcto
|
0.005 s | 4 KBi |
#27 |
Correcto
|
0.003 s | 2 KBi |
#28 |
Correcto
|
0.006 s | 1 KBi |
#29 |
Correcto
|
0.012 s | 2 KBi |
#30 |
Correcto
|
0.008 s | 2 KBi |
#31 |
Correcto
|
0.014 s | 1 KBi |
#32 |
Correcto
|
0.011 s | 2 KBi |
#33 |
Correcto
|
0.009 s | 3 KBi |
#34 |
Correcto
|
0.009 s | 2 KBi |
#35 |
Correcto
|
0.013 s | 2 KBi |
#36 |
Correcto
|
0.01 s | 2 KBi |
#37 |
Correcto
|
0.01 s | 5 KBi |
#38 |
Correcto
|
0.009 s | 9 KBi |
#include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <deque> #include <set> #include <map> #include <vector> #include <stack> #include <algorithm> using namespace std; const int N = 6e5+20; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s1; string s2; int carry = 0; deque<int> num1; deque<int> num2; cin>>s1>>s2; for(int i = 0; i < s1.size(); i++) { num1.push_front(s1[i] - '0'); } for(int i = 0; i < s2.size(); i++) { num2.push_front(s2[i] - '0'); } for(int j = 0; j < s2.size(); j++) { carry += num2[j]; int x; if(j >= num1.size()) { num1.push_back(num2[j]); } else { for(int i = j; i < num1.size(); i++) { if(num1[i]+carry <= 9) { num1[i]+=carry; carry = 0; break; } else if (i==num1.size()-1) { num1[i] = num1[i]+carry-10; num1.push_back(1); carry = 0; } else { num1[i] = num1[i]+carry-10; carry = 1; } } } } for(int i = num1.size()-1; i >= 0; i--) { cout<<num1[i]; } cout<<endl; }