結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー 小指が強い人小指が強い人
提出日時 2015-12-19 18:13:21
言語 Ruby
(3.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 381 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 15,400 KB
最終ジャッジ日時 2023-08-21 13:21:22
合計ジャッジ時間 4,257 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,256 KB
testcase_01 AC 77 ms
15,072 KB
testcase_02 AC 77 ms
15,336 KB
testcase_03 AC 77 ms
15,112 KB
testcase_04 AC 79 ms
15,280 KB
testcase_05 AC 78 ms
15,140 KB
testcase_06 AC 78 ms
15,116 KB
testcase_07 AC 78 ms
15,036 KB
testcase_08 AC 78 ms
15,096 KB
testcase_09 AC 78 ms
15,144 KB
testcase_10 WA -
testcase_11 AC 78 ms
15,128 KB
testcase_12 AC 78 ms
15,176 KB
testcase_13 AC 77 ms
15,300 KB
testcase_14 AC 78 ms
15,100 KB
testcase_15 AC 79 ms
15,140 KB
testcase_16 AC 77 ms
15,252 KB
testcase_17 WA -
testcase_18 AC 78 ms
15,120 KB
testcase_19 AC 77 ms
15,144 KB
testcase_20 AC 77 ms
15,400 KB
testcase_21 AC 78 ms
15,100 KB
testcase_22 AC 78 ms
15,176 KB
testcase_23 AC 79 ms
15,168 KB
testcase_24 AC 78 ms
15,064 KB
testcase_25 AC 77 ms
15,068 KB
testcase_26 AC 77 ms
15,172 KB
testcase_27 WA -
testcase_28 AC 76 ms
15,340 KB
testcase_29 AC 77 ms
15,228 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
sum = 0
ku = 10 ** 10
n.times do
    str = gets.strip
    pos = str.index(".")
    if pos != nil
        frac_len = str.length - pos - 1
        str.delete!(".")
        (10 - frac_len).times{str += "0"}
        sum += str.to_i
    else
        sum += str.to_i * ku
    end
end
res = "%025d" % sum
res.insert(-11, ".")
a, b = res.split(".")
print a.to_i, ".", b, "\n"
0