Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.158 s | 16 KBi |
#2 |
Correcto
|
0.175 s | 16 KBi |
#3 |
Correcto
|
0.167 s | 22 KBi |
#4 |
Correcto
|
0.164 s | 16 KBi |
#5 |
Correcto
|
0.173 s | 15 KBi |
#6 |
Correcto
|
0.145 s | 16 KBi |
#7 |
Correcto
|
0.169 s | 15 KBi |
#8 |
Correcto
|
0.154 s | 16 KBi |
#9 |
Correcto
|
0.143 s | 16 KBi |
#10 |
Correcto
|
0.165 s | 16 KBi |
#11 |
Correcto
|
0.17 s | 16 KBi |
#12 |
Correcto
|
0.154 s | 15 KBi |
#13 |
Correcto
|
0.218 s | 48 KBi |
#14 |
Correcto
|
0.151 s | 16 KBi |
#15 |
Correcto
|
0.141 s | 16 KBi |
#16 |
Correcto
|
0.171 s | 16 KBi |
#17 |
Correcto
|
0.186 s | 15 KBi |
#18 |
Correcto
|
0.182 s | 16 KBi |
#19 |
Correcto
|
0.165 s | 16 KBi |
#20 |
Correcto
|
0.174 s | 16 KBi |
#21 |
Correcto
|
0.16 s | 15 KBi |
#22 |
Correcto
|
0.166 s | 15 KBi |
#23 |
Correcto
|
0.163 s | 16 KBi |
#24 |
Correcto
|
0.154 s | 16 KBi |
#25 |
Correcto
|
0.172 s | 16 KBi |
#26 |
Correcto
|
0.453 s | 24 KBi |
#27 |
Correcto
|
0.46 s | 23 KBi |
#28 |
Correcto
|
0.415 s | 21 KBi |
#29 |
Correcto
|
0.429 s | 32 KBi |
#30 |
Correcto
|
0.408 s | 22 KBi |
#31 |
Correcto
|
0.434 s | 23 KBi |
#32 |
Correcto
|
0.429 s | 22 KBi |
#33 |
Correcto
|
0.41 s | 21 KBi |
#34 |
Correcto
|
0.431 s | 22 KBi |
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sn = new Scanner(System.in); String number = sn.nextLine(); List<Long> longNumber = new ArrayList<>(); for (int i = 0; i < number.length(); i++) { longNumber.add(Long.parseLong(Character.toString(number.charAt(i)))); } long current = 10L; for (int i = longNumber.size() - 1; i >= 0 && current > 9; i--) { current = longNumber.get(i) + 1; longNumber.set(i, current % 10); } if (current > 9) { longNumber.add(0, 1L); } longNumber.stream().forEach((i) -> System.out.print(i)); } }