Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.152 s | 16 KBi |
#2 |
Correcto
|
0.174 s | 16 KBi |
#3 |
Correcto
|
0.18 s | 16 KBi |
#4 |
Correcto
|
0.177 s | 16 KBi |
#5 |
Correcto
|
0.159 s | 16 KBi |
#6 |
Correcto
|
0.186 s | 16 KBi |
#7 |
Correcto
|
0.177 s | 16 KBi |
#8 |
Correcto
|
0.178 s | 16 KBi |
#9 |
Correcto
|
0.169 s | 16 KBi |
#10 |
Correcto
|
0.154 s | 15 KBi |
#11 |
Correcto
|
0.171 s | 16 KBi |
#12 |
Correcto
|
0.187 s | 16 KBi |
#13 |
Correcto
|
0.304 s | 12 KBi |
#14 |
Correcto
|
0.163 s | 16 KBi |
#15 |
Correcto
|
0.17 s | 16 KBi |
#16 |
Correcto
|
0.193 s | 16 KBi |
#17 |
Correcto
|
0.161 s | 16 KBi |
#18 |
Correcto
|
0.321 s | 12 KBi |
#19 |
Correcto
|
0.168 s | 16 KBi |
#20 |
Correcto
|
0.177 s | 16 KBi |
#21 |
Correcto
|
0.166 s | 16 KBi |
#22 |
Correcto
|
0.319 s | 12 KBi |
#23 |
Correcto
|
0.187 s | 16 KBi |
#24 |
Correcto
|
0.205 s | 16 KBi |
#25 |
Correcto
|
0.158 s | 16 KBi |
#26 |
Correcto
|
0.319 s | 12 KBi |
#27 |
Correcto
|
0.184 s | 16 KBi |
#28 |
Correcto
|
0.161 s | 15 KBi |
#29 |
Correcto
|
0.319 s | 53 KBi |
#30 |
Correcto
|
0.172 s | 16 KBi |
#31 |
Correcto
|
0.206 s | 16 KBi |
#32 |
Correcto
|
0.166 s | 16 KBi |
#33 |
Correcto
|
0.145 s | 16 KBi |
#34 |
Correcto
|
0.171 s | 16 KBi |
#35 |
Correcto
|
0.301 s | 12 KBi |
#36 |
Correcto
|
0.437 s | 22 KBi |
#37 |
Correcto
|
0.435 s | 23 KBi |
#38 |
Correcto
|
0.612 s | 15 KBi |
#39 |
Correcto
|
0.425 s | 21 KBi |
#40 |
Correcto
|
0.456 s | 25 KBi |
#41 |
Correcto
|
0.434 s | 22 KBi |
#42 |
Correcto
|
0.404 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(); Integer carry = sn.nextInt(); List<Long> longNumber = new ArrayList<>(); for (int i = 0; i < number.length(); i++) { longNumber.add(Long.parseLong(Character.toString(number.charAt(i)))); } for (int i = longNumber.size() - 1; i >= 0 && carry > 0; i--) { var current = longNumber.get(i) + carry; longNumber.set(i, current % 10); carry = Math.round(current / 10); } if (carry > 0) { longNumber.add(0, 1L); } longNumber.stream().forEach((i) -> System.out.print(i)); } }