Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.109 s | 13 KBi |
#2 |
Incorrecto
|
0.115 s | 13 KBi |
#3 |
Correcto
|
0.093 s | 13 KBi |
#4 |
Correcto
|
0.094 s | 13 KBi |
#5 |
Correcto
|
0.097 s | 13 KBi |
#6 |
Correcto
|
0.099 s | 13 KBi |
#7 |
Correcto
|
0.091 s | 13 KBi |
#8 |
Correcto
|
0.094 s | 13 KBi |
#9 |
Correcto
|
0.106 s | 13 KBi |
#10 |
Correcto
|
0.095 s | 13 KBi |
#11 |
Correcto
|
0.108 s | 13 KBi |
#12 |
Correcto
|
0.103 s | 13 KBi |
#13 |
Incorrecto
|
0.103 s | 13 KBi |
#14 |
Incorrecto
|
0.105 s | 13 KBi |
#15 |
Incorrecto
|
0.094 s | 13 KBi |
#16 |
Correcto
|
0.104 s | 13 KBi |
#17 |
Incorrecto
|
0.098 s | 13 KBi |
#18 |
Incorrecto
|
0.101 s | 13 KBi |
#19 |
Incorrecto
|
0.095 s | 13 KBi |
#20 |
Incorrecto
|
0.1 s | 13 KBi |
#21 |
Correcto
|
0.101 s | 13 KBi |
#22 |
Incorrecto
|
0.095 s | 13 KBi |
#23 |
Incorrecto
|
0.095 s | 13 KBi |
#24 |
Incorrecto
|
0.092 s | 13 KBi |
#25 |
Incorrecto
|
0.096 s | 13 KBi |
#26 |
Correcto
|
0.134 s | 14 KBi |
#27 |
Correcto
|
0.145 s | 15 KBi |
#28 |
Incorrecto
|
0.142 s | 14 KBi |
#29 |
Incorrecto
|
0.171 s | 14 KBi |
#30 |
Incorrecto
|
0.153 s | 14 KBi |
#31 |
Incorrecto
|
0.134 s | 14 KBi |
#32 |
Incorrecto
|
0.159 s | 14 KBi |
#33 |
Incorrecto
|
0.146 s | 14 KBi |
#34 |
Incorrecto
|
0.135 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 n = line.length(); for (int i = n-1; i >= 0; i--) { int sum = Character.getNumericValue(line.charAt(i)) + 1; if(sum < 10){ line.setCharAt(i, (char)(sum + '0')); }else{ line.setCharAt(i, '0'); } if(i==0 && String.valueOf(line.charAt(i)).equals("0")){ line.insert(0,'1'); } } System.out.print(line); scanner.close(); } }