結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー simansiman
提出日時 2015-04-02 01:19:31
言語 Ruby
(3.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 356 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2023-08-21 12:59:46
合計ジャッジ時間 4,104 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,176 KB
testcase_01 AC 79 ms
15,388 KB
testcase_02 AC 79 ms
15,224 KB
testcase_03 AC 81 ms
15,208 KB
testcase_04 AC 79 ms
15,484 KB
testcase_05 AC 78 ms
15,176 KB
testcase_06 AC 78 ms
15,424 KB
testcase_07 AC 79 ms
15,184 KB
testcase_08 AC 79 ms
15,356 KB
testcase_09 AC 79 ms
15,208 KB
testcase_10 WA -
testcase_11 AC 79 ms
15,484 KB
testcase_12 AC 79 ms
15,480 KB
testcase_13 AC 78 ms
15,388 KB
testcase_14 AC 78 ms
15,256 KB
testcase_15 AC 79 ms
15,264 KB
testcase_16 AC 79 ms
15,172 KB
testcase_17 WA -
testcase_18 AC 79 ms
15,476 KB
testcase_19 AC 79 ms
15,292 KB
testcase_20 AC 78 ms
15,380 KB
testcase_21 AC 79 ms
15,396 KB
testcase_22 AC 78 ms
15,216 KB
testcase_23 AC 78 ms
15,268 KB
testcase_24 AC 78 ms
15,216 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 78 ms
15,260 KB
testcase_29 AC 78 ms
15,396 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:13: warning: assigned but unused variable - y
Syntax OK

ソースコード

diff #

require 'bigdecimal'

class Yukicoder
  def initialize
    n = gets.chomp.to_i

    sum = BigDecimal('0.0')

    n.times do
      sum += BigDecimal(gets.chomp)
    end

    f, x, y, z = sum.split
    x.insert(z,'.')
    x.insert(0,'-') if f < 0
    x += '0'
    x = x.split('.')
    puts x.first + '.' + x.last[0..9].ljust(10, '0')
  end
end

Yukicoder.new
0