Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.085 s | 9 KBi |
#2 |
Incorrecto
|
0.087 s | 9 KBi |
#3 |
Incorrecto
|
0.086 s | 9 KBi |
#4 |
Incorrecto
|
0.101 s | 9 KBi |
#5 |
Incorrecto
|
0.104 s | 9 KBi |
#6 |
Incorrecto
|
0.093 s | 9 KBi |
#7 |
Incorrecto
|
0.081 s | 9 KBi |
#8 |
Incorrecto
|
0.106 s | 9 KBi |
#9 |
Incorrecto
|
0.107 s | 9 KBi |
#10 |
Incorrecto
|
0.084 s | 9 KBi |
#11 |
Incorrecto
|
0.096 s | 9 KBi |
#12 |
Incorrecto
|
0.095 s | 9 KBi |
#13 |
Incorrecto
|
0.087 s | 9 KBi |
#14 |
Incorrecto
|
0.097 s | 9 KBi |
#15 |
Incorrecto
|
0.1 s | 9 KBi |
#16 |
Incorrecto
|
0.093 s | 9 KBi |
#17 |
Incorrecto
|
0.107 s | 9 KBi |
#18 |
Incorrecto
|
0.09 s | 9 KBi |
#19 |
Incorrecto
|
0.093 s | 9 KBi |
#20 |
Incorrecto
|
0.085 s | 9 KBi |
#21 |
Incorrecto
|
0.09 s | 9 KBi |
#22 |
Incorrecto
|
0.117 s | 9 KBi |
#23 |
Incorrecto
|
0.11 s | 9 KBi |
#24 |
Incorrecto
|
0.11 s | 9 KBi |
#25 |
Incorrecto
|
0.085 s | 9 KBi |
#26 |
Incorrecto
|
0.118 s | 9 KBi |
#27 |
Incorrecto
|
0.083 s | 9 KBi |
#28 |
Incorrecto
|
0.113 s | 9 KBi |
#29 |
Incorrecto
|
0.12 s | 9 KBi |
#30 |
Incorrecto
|
0.113 s | 9 KBi |
#31 |
Incorrecto
|
0.093 s | 9 KBi |
#32 |
Incorrecto
|
0.094 s | 9 KBi |
#33 |
Incorrecto
|
0.091 s | 9 KBi |
#34 |
Incorrecto
|
0.092 s | 9 KBi |
#35 |
Incorrecto
|
0.098 s | 9 KBi |
#36 |
Incorrecto
|
0.116 s | 9 KBi |
#37 |
Incorrecto
|
0.104 s | 9 KBi |
#38 |
Incorrecto
|
0.102 s | 9 KBi |
n1 = gets.chomp n2 = gets.chomp def sum_numbers a, b accumulator = 0 size = [a.length, b.length].max a = a.ljust(size, "0") b = b.rjust(size, "0") answer = '0' * size (size - 1).downto(0).each do |index| current_digit = a[index].to_i + b[index].to_i current_digit = current_digit + accumulator answer[index] = (current_digit % 10).to_s accumulator = current_digit / 10 end if accumulator answer[0] = accumulator.to_s end answer end p sum_numbers n1, n2