Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.004 s | 2 KBi |
#2 |
Incorrecto
|
0.003 s | 2 KBi |
#3 |
Correcto
|
0.007 s | 1 KBi |
#4 |
Incorrecto
|
0.004 s | 2 KBi |
#5 |
Correcto
|
0.003 s | 2 KBi |
#6 |
Correcto
|
0.003 s | 2 KBi |
#7 |
Correcto
|
0.005 s | 2 KBi |
#8 |
Correcto
|
0.004 s | 2 KBi |
#9 |
Incorrecto
|
0.006 s | 2 KBi |
#10 |
Correcto
|
0.006 s | 2 KBi |
#11 |
Incorrecto
|
0.004 s | 49 KBi |
#12 |
Incorrecto
|
0.008 s | 2 KBi |
#13 |
Correcto
|
0.007 s | 34 KBi |
#14 |
Incorrecto
|
0.002 s | 2 KBi |
#15 |
Correcto
|
0.005 s | 37 KBi |
#16 |
Incorrecto
|
0.007 s | 1 KBi |
#17 |
Incorrecto
|
0.004 s | 17 KBi |
#18 |
Incorrecto
|
0.004 s | 2 KBi |
#19 |
Incorrecto
|
0.004 s | 2 KBi |
#20 |
Incorrecto
|
0.006 s | 1 KBi |
#21 |
Correcto
|
0.003 s | 2 KBi |
#22 |
Incorrecto
|
0.008 s | 1 KBi |
#23 |
Incorrecto
|
0.008 s | 1 KBi |
#24 |
Incorrecto
|
0.008 s | 21 KBi |
#25 |
Incorrecto
|
0.004 s | 2 KBi |
#26 |
Incorrecto
|
0.006 s | 2 KBi |
#27 |
Incorrecto
|
0.005 s | 2 KBi |
#28 |
Incorrecto
|
0.004 s | 2 KBi |
#29 |
Incorrecto
|
0.009 s | 2 KBi |
#30 |
Correcto
|
0.008 s | 2 KBi |
#31 |
Correcto
|
0.011 s | 2 KBi |
#32 |
Correcto
|
0.014 s | 2 KBi |
#33 |
Correcto
|
0.015 s | 2 KBi |
#34 |
Correcto
|
0.01 s | 2 KBi |
#35 |
Incorrecto
|
0.01 s | 2 KBi |
#36 |
Incorrecto
|
0.019 s | 1 KBi |
#37 |
Correcto
|
0.008 s | 2 KBi |
#38 |
Correcto
|
0.01 s | 1 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; bool vamos = false; int carry; deque<int> num1; deque<int> num2; cin>>s1>>s2; for(int i = 0; i < s1.size(); i++) { num1.push_back(s1[i] - '0'); } for(int i = 0; i < s2.size(); i++) { num2.push_back(s2[i] - '0'); } for(int j = s2.size()-1; j >= 0; j--) { carry = num2[j]; int x; if(j >= num1.size()) { num1.push_front(num2[j]); } else { x = s1.size()-1 - (s2.size()-1-j); for(int i = x; i >= 0; i--) { if(num1[i]+carry <= 9) { num1[i]+=carry; break; } else if (i==0) { num1.push_front(1); num1[i] = num1[i]+carry-10; carry = 1; } else { num1[i] = num1[i]+carry-10; carry = 1; } } } } for(int i = 0; i < num1.size(); i++) { cout<<num1[i]; } cout<<endl; }