Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.142 s | 13 KBi |
#2 |
Correcto
|
0.123 s | 14 KBi |
#3 |
Correcto
|
0.129 s | 14 KBi |
#4 |
Correcto
|
0.127 s | 14 KBi |
#5 |
Correcto
|
0.138 s | 13 KBi |
#6 |
Correcto
|
0.136 s | 14 KBi |
#7 |
Correcto
|
0.153 s | 16 KBi |
#8 |
Correcto
|
0.125 s | 14 KBi |
#9 |
Correcto
|
0.115 s | 14 KBi |
#10 |
Correcto
|
0.134 s | 15 KBi |
#11 |
Correcto
|
0.126 s | 14 KBi |
#12 |
Correcto
|
0.137 s | 15 KBi |
#13 |
Correcto
|
0.159 s | 13 KBi |
#14 |
Correcto
|
0.139 s | 12 KBi |
#15 |
Correcto
|
0.135 s | 15 KBi |
#16 |
Correcto
|
0.134 s | 13 KBi |
#17 |
Correcto
|
0.128 s | 14 KBi |
#18 |
Correcto
|
0.12 s | 14 KBi |
#19 |
Correcto
|
0.127 s | 13 KBi |
#20 |
Correcto
|
0.13 s | 13 KBi |
#21 |
Correcto
|
0.132 s | 20 KBi |
#22 |
Correcto
|
0.129 s | 16 KBi |
#23 |
Correcto
|
0.142 s | 14 KBi |
#24 |
Correcto
|
0.139 s | 14 KBi |
#25 |
Correcto
|
0.134 s | 14 KBi |
#26 |
Correcto
|
0.124 s | 32 KBi |
#27 |
Correcto
|
0.138 s | 14 KBi |
#28 |
Correcto
|
0.13 s | 13 KBi |
#29 |
Correcto
|
0.217 s | 15 KBi |
#30 |
Correcto
|
0.227 s | 17 KBi |
#31 |
Correcto
|
0.193 s | 18 KBi |
#32 |
Correcto
|
0.248 s | 15 KBi |
#33 |
Correcto
|
0.209 s | 14 KBi |
#34 |
Correcto
|
0.25 s | 17 KBi |
#35 |
Correcto
|
0.217 s | 17 KBi |
#36 |
Correcto
|
0.187 s | 15 KBi |
#37 |
Correcto
|
0.202 s | 16 KBi |
#38 |
Correcto
|
0.195 s | 14 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String inputX = sc.nextLine(); StringBuilder X = new StringBuilder(); X.append(inputX); X.reverse(); String inputY = sc.nextLine(); StringBuilder Y = new StringBuilder(); Y.append(inputY); Y.reverse(); StringBuilder result = new StringBuilder(); int sumResult = 0; int maxSize = Integer.max(inputX.length(), inputY.length()); for (int position = 0; position < maxSize; position++) { if (position < inputX.length()) { sumResult += Integer.parseInt(X.substring(position, position + 1)); } if (position < inputY.length()) { sumResult += Integer.parseInt(Y.substring(position, position + 1)); } result.append(sumResult % 10); sumResult = sumResult / 10; } if (sumResult == 1){ result.append(1); } sc.close(); System.out.println(result.reverse()); } }