結果

問題 No.3678 しゃべりすぎた男
コンテスト
ユーザー Nanashi.
提出日時 2026-09-05 14:06:39
言語 Ruby
(4.0.6)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
AC  
実行時間 54 ms / 2,000 ms
+ 173µs
コード長 195 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 777 ms
コンパイル使用メモリ 9,676 KB
実行使用メモリ 14,592 KB
最終ジャッジ日時 2026-09-05 14:07:38
合計ジャッジ時間 4,007 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: ambiguous first argument; put parentheses or a space even after `-` operator
Syntax OK

ソースコード

diff #
raw source code

# frozen_string_literal: true
in_t = gets.chomp.split.map(&:to_i)

total = 6000
in_t.each do |t|
  total -= t
  if total < 0 || t == -1
    total = -1
    puts -1
  else
    puts total
  end
end
0