結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー simansiman
提出日時 2021-07-29 07:41:12
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 11,412 KB
実行使用メモリ 15,512 KB
最終ジャッジ日時 2023-10-12 05:55:34
合計ジャッジ時間 4,671 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,104 KB
testcase_01 AC 80 ms
15,300 KB
testcase_02 AC 80 ms
15,092 KB
testcase_03 AC 79 ms
15,328 KB
testcase_04 AC 82 ms
15,072 KB
testcase_05 AC 80 ms
15,348 KB
testcase_06 AC 79 ms
15,236 KB
testcase_07 AC 79 ms
15,028 KB
testcase_08 AC 81 ms
15,236 KB
testcase_09 AC 82 ms
15,148 KB
testcase_10 WA -
testcase_11 AC 80 ms
15,224 KB
testcase_12 AC 80 ms
15,316 KB
testcase_13 AC 81 ms
15,088 KB
testcase_14 AC 79 ms
15,132 KB
testcase_15 AC 83 ms
15,240 KB
testcase_16 AC 84 ms
15,144 KB
testcase_17 WA -
testcase_18 AC 84 ms
15,168 KB
testcase_19 AC 83 ms
15,336 KB
testcase_20 AC 84 ms
15,024 KB
testcase_21 AC 83 ms
15,140 KB
testcase_22 AC 84 ms
15,296 KB
testcase_23 AC 85 ms
15,148 KB
testcase_24 AC 83 ms
15,088 KB
testcase_25 RE -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 80 ms
15,168 KB
testcase_29 AC 78 ms
15,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
A = N.times.map { gets.chomp }
g = 10 ** 10
sum = 0

A.each do |a|
  i, f = a.split('.')
  f = '0' if f.nil?

  v = i.to_i.abs * g + f.ljust(10, '0').to_i

  if a[0] == '-'
    v *= -1
  end

  sum += v
end

puts sum.to_s.insert(-11, '.')
0