Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.128 s | 13 KBi |
#2 |
Correcto
|
0.14 s | 13 KBi |
#3 |
Correcto
|
0.13 s | 15 KBi |
#4 |
Correcto
|
0.106 s | 11 KBi |
#5 |
Correcto
|
0.129 s | 13 KBi |
#6 |
Correcto
|
0.076 s | 12 KBi |
#7 |
Correcto
|
0.115 s | 12 KBi |
#8 |
Correcto
|
0.129 s | 13 KBi |
#9 |
Correcto
|
0.119 s | 12 KBi |
#10 |
Correcto
|
0.099 s | 13 KBi |
#11 |
Correcto
|
0.14 s | 13 KBi |
#12 |
Correcto
|
0.126 s | 13 KBi |
#13 |
Correcto
|
0.144 s | 13 KBi |
#14 |
Correcto
|
0.119 s | 12 KBi |
#15 |
Correcto
|
0.114 s | 13 KBi |
#16 |
Correcto
|
0.122 s | 13 KBi |
#17 |
Correcto
|
0.111 s | 13 KBi |
#18 |
Correcto
|
0.132 s | 13 KBi |
#19 |
Correcto
|
0.139 s | 13 KBi |
#20 |
Correcto
|
0.117 s | 13 KBi |
#21 |
Correcto
|
0.111 s | 11 KBi |
#22 |
Correcto
|
0.105 s | 11 KBi |
#23 |
Correcto
|
0.128 s | 12 KBi |
#24 |
Correcto
|
0.092 s | 12 KBi |
#25 |
Correcto
|
0.104 s | 14 KBi |
#26 |
Correcto
|
0.11 s | 11 KBi |
#27 |
Correcto
|
0.129 s | 12 KBi |
#28 |
Correcto
|
0.092 s | 16 KBi |
#29 |
Correcto
|
0.115 s | 13 KBi |
#30 |
Correcto
|
0.124 s | 13 KBi |
#31 |
Correcto
|
0.134 s | 13 KBi |
#32 |
Correcto
|
0.079 s | 11 KBi |
#33 |
Correcto
|
0.112 s | 13 KBi |
#34 |
Correcto
|
0.11 s | 12 KBi |
#35 |
Correcto
|
0.109 s | 11 KBi |
#36 |
Correcto
|
0.237 s | 49 KBi |
#37 |
Correcto
|
0.229 s | 39 KBi |
#38 |
Correcto
|
0.143 s | 13 KBi |
#39 |
Correcto
|
0.128 s | 14 KBi |
#40 |
Correcto
|
0.13 s | 12 KBi |
#41 |
Correcto
|
0.198 s | 39 KBi |
#42 |
Correcto
|
0.128 s | 14 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(); int addition = Integer.parseInt(br.readLine()); bw.write(add(num, addition) + "\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 && i < N1) { addition = 1; digit -= 10; } else { addition = 0; } result = digit + result; } return num.substring(0, N - i) + result; } }