Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.132 s | 13 KBi |
#2 |
Correcto
|
0.122 s | 13 KBi |
#3 |
Correcto
|
0.121 s | 13 KBi |
#4 |
Correcto
|
0.127 s | 13 KBi |
#5 |
Correcto
|
0.107 s | 11 KBi |
#6 |
Correcto
|
0.126 s | 13 KBi |
#7 |
Correcto
|
0.146 s | 13 KBi |
#8 |
Correcto
|
0.141 s | 13 KBi |
#9 |
Correcto
|
0.114 s | 11 KBi |
#10 |
Correcto
|
0.125 s | 15 KBi |
#11 |
Correcto
|
0.113 s | 13 KBi |
#12 |
Incorrecto
|
0.125 s | 13 KBi |
#13 |
Correcto
|
0.154 s | 18 KBi |
#14 |
Correcto
|
0.145 s | 16 KBi |
#15 |
Correcto
|
0.111 s | 13 KBi |
#16 |
Incorrecto
|
0.122 s | 13 KBi |
#17 |
Correcto
|
0.129 s | 15 KBi |
#18 |
Correcto
|
0.107 s | 13 KBi |
#19 |
Correcto
|
0.132 s | 12 KBi |
#20 |
Correcto
|
0.127 s | 13 KBi |
#21 |
Incorrecto
|
0.125 s | 14 KBi |
#22 |
Correcto
|
0.112 s | 16 KBi |
#23 |
Correcto
|
0.117 s | 13 KBi |
#24 |
Correcto
|
0.12 s | 13 KBi |
#25 |
Correcto
|
0.111 s | 13 KBi |
#26 |
Incorrecto
|
0.215 s | 40 KBi |
#27 |
Correcto
|
0.24 s | 51 KBi |
#28 |
Correcto
|
0.125 s | 14 KBi |
#29 |
Correcto
|
0.154 s | 15 KBi |
#30 |
Correcto
|
0.134 s | 13 KBi |
#31 |
Correcto
|
0.147 s | 20 KBi |
#32 |
Correcto
|
0.141 s | 19 KBi |
#33 |
Correcto
|
0.133 s | 15 KBi |
#34 |
Correcto
|
0.169 s | 36 KBi |
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String num = br.readLine(); bw.write(add(num, 1) + "\n"); br.close(); bw.close(); } public static String add(String num, int addition) { int N = num.length(); String result = ""; int N1 = N - 1; int i; for (i = 0; i < N && addition != 0; i++) { int digit = num.charAt(N1 - i) - '0'; digit += addition; if (digit >= 10) { addition = 1; digit -= 10; } else { addition = 0; } result = digit + result; } return num.substring(0, N - i) + result; } }