結果

問題 No.2372 既視感
ユーザー KowerKoint2010
提出日時 2023-06-28 08:17:26
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 14,592 KB
最終ジャッジ日時 2024-07-05 00:32:15
合計ジャッジ時間 3,658 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, k, q = gets.split.map(&:to_i)
a = []
q.times do
  op = gets.to_i
  if op == 1
    s = gets.chomp
    a << s
  else
    t = []
    d = []
    6.times do
      ti, di = gets.split
      t << ti
      d << di.to_i
    end
    ans = 0
    solve_duaration = 0
    while ans < 6
      if a != nil and a[-[n,a.length].min..-1].include?(t[ans])
        solve_duaration += [d[ans], k].min
      else
        solve_duaration += d[ans]
      end
      if solve_duaration > 60
        break
      end
      ans += 1
    end
    puts ans
    a += t
  end
end
0