Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.099 s | 13 KBi |
#2 |
Correcto
|
0.108 s | 13 KBi |
#3 |
Correcto
|
0.093 s | 13 KBi |
#4 |
Correcto
|
0.096 s | 13 KBi |
#5 |
Correcto
|
0.11 s | 13 KBi |
#6 |
Correcto
|
0.094 s | 13 KBi |
#7 |
Correcto
|
0.094 s | 13 KBi |
#8 |
Correcto
|
0.095 s | 13 KBi |
#9 |
Correcto
|
0.096 s | 13 KBi |
#10 |
Correcto
|
0.1 s | 13 KBi |
#11 |
Correcto
|
0.102 s | 13 KBi |
#12 |
Correcto
|
0.094 s | 13 KBi |
#13 |
Correcto
|
0.095 s | 13 KBi |
#14 |
Correcto
|
0.096 s | 13 KBi |
#15 |
Correcto
|
0.091 s | 13 KBi |
#16 |
Correcto
|
0.1 s | 13 KBi |
#17 |
Correcto
|
0.095 s | 13 KBi |
#18 |
Correcto
|
0.093 s | 13 KBi |
#19 |
Correcto
|
0.1 s | 13 KBi |
#20 |
Correcto
|
0.098 s | 13 KBi |
#21 |
Correcto
|
0.104 s | 13 KBi |
#22 |
Correcto
|
0.099 s | 13 KBi |
#23 |
Correcto
|
0.1 s | 13 KBi |
#24 |
Correcto
|
0.097 s | 13 KBi |
#25 |
Correcto
|
0.092 s | 13 KBi |
#26 |
Correcto
|
0.131 s | 14 KBi |
#27 |
Correcto
|
0.138 s | 14 KBi |
#28 |
Correcto
|
0.142 s | 14 KBi |
#29 |
Correcto
|
0.128 s | 13 KBi |
#30 |
Correcto
|
0.125 s | 13 KBi |
#31 |
Correcto
|
0.133 s | 14 KBi |
#32 |
Correcto
|
0.139 s | 14 KBi |
#33 |
Correcto
|
0.138 s | 13 KBi |
#34 |
Correcto
|
0.143 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')); break; }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(); } }