Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.086 s | 9 KBi |
#2 |
Correcto
|
0.088 s | 9 KBi |
#3 |
Correcto
|
0.075 s | 9 KBi |
#4 |
Correcto
|
0.099 s | 9 KBi |
#5 |
Correcto
|
0.104 s | 9 KBi |
#6 |
Correcto
|
0.089 s | 9 KBi |
#7 |
Correcto
|
0.1 s | 9 KBi |
#8 |
Correcto
|
0.078 s | 9 KBi |
#9 |
Correcto
|
0.079 s | 9 KBi |
#10 |
Correcto
|
0.089 s | 9 KBi |
#11 |
Correcto
|
0.102 s | 9 KBi |
#12 |
Correcto
|
0.086 s | 9 KBi |
#13 |
Correcto
|
0.083 s | 9 KBi |
#14 |
Correcto
|
0.115 s | 9 KBi |
#15 |
Correcto
|
0.09 s | 9 KBi |
#16 |
Correcto
|
0.09 s | 9 KBi |
#17 |
Correcto
|
0.097 s | 9 KBi |
#18 |
Correcto
|
0.111 s | 9 KBi |
#19 |
Correcto
|
0.1 s | 9 KBi |
#20 |
Correcto
|
0.098 s | 9 KBi |
#21 |
Correcto
|
0.108 s | 9 KBi |
#22 |
Correcto
|
0.104 s | 9 KBi |
#23 |
Correcto
|
0.11 s | 9 KBi |
#24 |
Correcto
|
0.111 s | 9 KBi |
#25 |
Correcto
|
0.094 s | 9 KBi |
#26 |
Correcto
|
0.091 s | 9 KBi |
#27 |
Correcto
|
0.088 s | 9 KBi |
#28 |
Correcto
|
0.106 s | 9 KBi |
#29 |
Correcto
|
0.081 s | 8 KBi |
#30 |
Correcto
|
0.085 s | 9 KBi |
#31 |
Correcto
|
0.086 s | 9 KBi |
#32 |
Correcto
|
0.107 s | 9 KBi |
#33 |
Correcto
|
0.089 s | 9 KBi |
#34 |
Correcto
|
0.096 s | 9 KBi |
#35 |
Correcto
|
0.082 s | 9 KBi |
#36 |
Correcto
|
0.102 s | 9 KBi |
#37 |
Correcto
|
0.11 s | 9 KBi |
#38 |
Correcto
|
0.124 s | 9 KBi |
#39 |
Correcto
|
0.105 s | 9 KBi |
#40 |
Correcto
|
0.129 s | 9 KBi |
#41 |
Correcto
|
0.116 s | 9 KBi |
#42 |
Correcto
|
0.098 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 = accumulator.to_s + answer end answer end puts sum_numbers n1, n2