Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.079 s | 9 KBi |
#2 |
Correcto
|
0.086 s | 9 KBi |
#3 |
Correcto
|
0.108 s | 9 KBi |
#4 |
Incorrecto
|
0.084 s | 9 KBi |
#5 |
Correcto
|
0.096 s | 9 KBi |
#6 |
Correcto
|
0.077 s | 9 KBi |
#7 |
Correcto
|
0.086 s | 9 KBi |
#8 |
Correcto
|
0.101 s | 9 KBi |
#9 |
Incorrecto
|
0.094 s | 9 KBi |
#10 |
Correcto
|
0.106 s | 9 KBi |
#11 |
Incorrecto
|
0.109 s | 9 KBi |
#12 |
Incorrecto
|
0.09 s | 9 KBi |
#13 |
Correcto
|
0.082 s | 9 KBi |
#14 |
Correcto
|
0.091 s | 9 KBi |
#15 |
Correcto
|
0.097 s | 9 KBi |
#16 |
Correcto
|
0.085 s | 9 KBi |
#17 |
Incorrecto
|
0.085 s | 9 KBi |
#18 |
Incorrecto
|
0.087 s | 9 KBi |
#19 |
Correcto
|
0.097 s | 9 KBi |
#20 |
Correcto
|
0.091 s | 9 KBi |
#21 |
Correcto
|
0.084 s | 9 KBi |
#22 |
Correcto
|
0.089 s | 9 KBi |
#23 |
Incorrecto
|
0.076 s | 9 KBi |
#24 |
Correcto
|
0.083 s | 9 KBi |
#25 |
Incorrecto
|
0.082 s | 9 KBi |
#26 |
Incorrecto
|
0.087 s | 9 KBi |
#27 |
Correcto
|
0.076 s | 9 KBi |
#28 |
Correcto
|
0.076 s | 9 KBi |
#29 |
Incorrecto
|
0.13 s | 9 KBi |
#30 |
Correcto
|
0.099 s | 9 KBi |
#31 |
Correcto
|
0.091 s | 9 KBi |
#32 |
Correcto
|
0.111 s | 9 KBi |
#33 |
Correcto
|
0.103 s | 9 KBi |
#34 |
Correcto
|
0.117 s | 9 KBi |
#35 |
Incorrecto
|
0.104 s | 9 KBi |
#36 |
Incorrecto
|
0.109 s | 9 KBi |
#37 |
Correcto
|
0.12 s | 9 KBi |
#38 |
Correcto
|
0.091 s | 9 KBi |
n1 = gets.chomp n2 = gets.chomp def sum_numbers a, b accumulator = 0 size = [a.length, b.length].max a = a.rjust(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 != 0 answer[0] = accumulator.to_s end answer end puts sum_numbers n1, n2