結果
問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
ユーザー |
|
提出日時 | 2017-02-24 10:09:25 |
言語 | Ruby (3.4.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 346 ms |
コンパイル使用メモリ | 8,064 KB |
実行使用メモリ | 20,352 KB |
最終ジャッジ日時 | 2025-01-02 21:56:41 |
合計ジャッジ時間 | 7,475 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 30 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'bigdecimal' require 'bigdecimal/util' class Yukicoder def initialize n = gets.to_i @total = BigDecimal.new("0") n.times do val = BigDecimal.new(gets) @total += val end end def run str = @total.to_s("F") str =~ /^\d+\.(\d+)$/ below_zero_count = 10 - Regexp.last_match(1).size below_zero_count.times { str << '0' } return str end end puts Yukicoder.new.run