Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.123 s | 13 KBi |
#2 |
Correcto
|
0.101 s | 13 KBi |
#3 |
Correcto
|
0.103 s | 13 KBi |
#4 |
Correcto
|
0.102 s | 13 KBi |
#5 |
Correcto
|
0.102 s | 13 KBi |
#6 |
Correcto
|
0.098 s | 13 KBi |
#7 |
Correcto
|
0.112 s | 13 KBi |
#8 |
Correcto
|
0.094 s | 13 KBi |
#9 |
Correcto
|
0.105 s | 13 KBi |
#10 |
Correcto
|
0.102 s | 13 KBi |
#11 |
Correcto
|
0.098 s | 19 KBi |
#12 |
Correcto
|
0.111 s | 13 KBi |
#13 |
Correcto
|
0.115 s | 19 KBi |
#14 |
Correcto
|
0.099 s | 13 KBi |
#15 |
Correcto
|
0.102 s | 13 KBi |
#16 |
Correcto
|
0.106 s | 13 KBi |
#17 |
Correcto
|
0.093 s | 13 KBi |
#18 |
Correcto
|
0.092 s | 13 KBi |
#19 |
Correcto
|
0.103 s | 13 KBi |
#20 |
Correcto
|
0.106 s | 13 KBi |
#21 |
Correcto
|
0.111 s | 13 KBi |
#22 |
Correcto
|
0.099 s | 17 KBi |
#23 |
Correcto
|
0.103 s | 13 KBi |
#24 |
Correcto
|
0.107 s | 13 KBi |
#25 |
Correcto
|
0.1 s | 13 KBi |
#26 |
Correcto
|
0.103 s | 13 KBi |
#27 |
Correcto
|
0.104 s | 13 KBi |
#28 |
Correcto
|
0.098 s | 13 KBi |
#29 |
Correcto
|
0.105 s | 13 KBi |
#30 |
Correcto
|
0.102 s | 13 KBi |
#31 |
Correcto
|
0.104 s | 13 KBi |
#32 |
Correcto
|
0.108 s | 20 KBi |
#33 |
Correcto
|
0.103 s | 13 KBi |
#34 |
Correcto
|
0.101 s | 13 KBi |
#35 |
Correcto
|
0.097 s | 13 KBi |
#36 |
Correcto
|
0.143 s | 14 KBi |
#37 |
Correcto
|
0.158 s | 14 KBi |
#38 |
Correcto
|
0.137 s | 15 KBi |
#39 |
Correcto
|
0.14 s | 14 KBi |
#40 |
Correcto
|
0.132 s | 14 KBi |
#41 |
Correcto
|
0.154 s | 15 KBi |
#42 |
Correcto
|
0.144 s | 14 KBi |
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); StringBuilder num1 = new StringBuilder(scanner.nextLine()).reverse(); int digit = scanner.nextInt(); int n = num1.length(); for (int i = 0; i < n; i++) { int sum = Character.getNumericValue(num1.charAt(i)) + digit; if(sum < 10){ num1.setCharAt(i, (char)(sum + '0')); break; }else{ digit = 1; num1.setCharAt(i, (char)((sum % 10) + '0')); } if((i == n - 1) && digit == 1){ num1.append('1'); } } System.out.print(num1.reverse()); scanner.close(); } }