Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.127 s | 12 KBi |
#2 |
Correcto
|
0.153 s | 16 KBi |
#3 |
Correcto
|
0.134 s | 14 KBi |
#4 |
Correcto
|
0.165 s | 13 KBi |
#5 |
Correcto
|
0.155 s | 12 KBi |
#6 |
Correcto
|
0.164 s | 14 KBi |
#7 |
Correcto
|
0.136 s | 15 KBi |
#8 |
Correcto
|
0.139 s | 15 KBi |
#9 |
Correcto
|
0.128 s | 13 KBi |
#10 |
Correcto
|
0.151 s | 13 KBi |
#11 |
Correcto
|
0.134 s | 13 KBi |
#12 |
Correcto
|
0.157 s | 13 KBi |
#13 |
Correcto
|
0.131 s | 16 KBi |
#14 |
Correcto
|
0.142 s | 20 KBi |
#15 |
Correcto
|
0.166 s | 12 KBi |
#16 |
Correcto
|
0.13 s | 14 KBi |
#17 |
Correcto
|
0.142 s | 14 KBi |
#18 |
Correcto
|
0.131 s | 14 KBi |
#19 |
Correcto
|
0.141 s | 14 KBi |
#20 |
Correcto
|
0.159 s | 14 KBi |
#21 |
Correcto
|
0.154 s | 13 KBi |
#22 |
Correcto
|
0.117 s | 12 KBi |
#23 |
Correcto
|
0.121 s | 12 KBi |
#24 |
Correcto
|
0.156 s | 14 KBi |
#25 |
Correcto
|
0.141 s | 14 KBi |
#26 |
Correcto
|
0.138 s | 15 KBi |
#27 |
Correcto
|
0.117 s | 13 KBi |
#28 |
Correcto
|
0.132 s | 14 KBi |
#29 |
Correcto
|
0.169 s | 14 KBi |
#30 |
Correcto
|
0.141 s | 15 KBi |
#31 |
Correcto
|
0.132 s | 14 KBi |
#32 |
Correcto
|
0.143 s | 17 KBi |
#33 |
Correcto
|
0.177 s | 15 KBi |
#34 |
Correcto
|
0.128 s | 14 KBi |
#35 |
Correcto
|
0.14 s | 21 KBi |
#36 |
Correcto
|
0.221 s | 19 KBi |
#37 |
Correcto
|
0.213 s | 16 KBi |
#38 |
Correcto
|
0.185 s | 13 KBi |
#39 |
Correcto
|
0.182 s | 15 KBi |
#40 |
Correcto
|
0.188 s | 16 KBi |
#41 |
Correcto
|
0.205 s | 17 KBi |
#42 |
Correcto
|
0.184 s | 15 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(); int inputK = sc.nextInt(); int position = 0; int subintX = 0; subintX = Integer.parseInt(X.substring(position, position + 1)); subintX = subintX + inputK; X.replace(position, position + 1, Integer.toString(subintX % 10)); position++; int size = inputX.length(); while (subintX > 9) { if (position < size) { subintX = Integer.parseInt(X.substring(position, position + 1)); subintX++; X.replace(position, position + 1, Integer.toString(subintX % 10)); } else { X.append(1); subintX = 0; } position++; } sc.close(); System.out.println(X.reverse()); } }