Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.097 s | 13 KBi |
#2 |
Correcto
|
0.105 s | 13 KBi |
#3 |
Correcto
|
0.106 s | 13 KBi |
#4 |
Correcto
|
0.102 s | 13 KBi |
#5 |
Correcto
|
0.101 s | 13 KBi |
#6 |
Correcto
|
0.102 s | 13 KBi |
#7 |
Correcto
|
0.104 s | 13 KBi |
#8 |
Correcto
|
0.101 s | 13 KBi |
#9 |
Correcto
|
0.112 s | 13 KBi |
#10 |
Correcto
|
0.106 s | 13 KBi |
#11 |
Incorrecto
|
0.102 s | 13 KBi |
#12 |
Correcto
|
0.107 s | 13 KBi |
#13 |
Incorrecto
|
0.109 s | 13 KBi |
#14 |
Incorrecto
|
0.101 s | 13 KBi |
#15 |
Incorrecto
|
0.105 s | 13 KBi |
#16 |
Incorrecto
|
0.098 s | 13 KBi |
#17 |
Incorrecto
|
0.11 s | 13 KBi |
#18 |
Incorrecto
|
0.107 s | 13 KBi |
#19 |
Incorrecto
|
0.108 s | 13 KBi |
#20 |
Incorrecto
|
0.111 s | 13 KBi |
#21 |
Correcto
|
0.103 s | 13 KBi |
#22 |
Correcto
|
0.107 s | 13 KBi |
#23 |
Correcto
|
0.108 s | 13 KBi |
#24 |
Correcto
|
0.102 s | 13 KBi |
#25 |
Correcto
|
0.098 s | 13 KBi |
#26 |
Correcto
|
0.111 s | 13 KBi |
#27 |
Correcto
|
0.099 s | 13 KBi |
#28 |
Correcto
|
0.114 s | 13 KBi |
#29 |
Correcto
|
0.101 s | 13 KBi |
#30 |
Correcto
|
0.108 s | 13 KBi |
#31 |
Correcto
|
0.111 s | 13 KBi |
#32 |
Correcto
|
0.107 s | 13 KBi |
#33 |
Correcto
|
0.101 s | 13 KBi |
#34 |
Correcto
|
0.106 s | 13 KBi |
#35 |
Correcto
|
0.107 s | 13 KBi |
#36 |
Correcto
|
0.14 s | 14 KBi |
#37 |
Correcto
|
0.133 s | 14 KBi |
#38 |
Correcto
|
0.145 s | 14 KBi |
#39 |
Correcto
|
0.149 s | 14 KBi |
#40 |
Correcto
|
0.127 s | 14 KBi |
#41 |
Correcto
|
0.134 s | 14 KBi |
#42 |
Correcto
|
0.138 s | 14 KBi |
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); StringBuilder line = new StringBuilder(scanner.nextLine()); int digit = scanner.nextInt(); int n = line.length(); for (int i = n-1; i >= 0; i--) { int sum = Character.getNumericValue(line.charAt(i)) + digit; if(sum < 10){ line.setCharAt(i, (char)(sum + '0')); break; }else{ digit = 1; line.setCharAt(i, (char)(sum % 10 + '0')); } if(i==0 && String.valueOf(line.charAt(i)).equals("0")){ line.insert(0,'1'); } } System.out.print(line); scanner.close(); } }