結果

問題 No.2372 既視感
ユーザー KowerKoint2010KowerKoint2010
提出日時 2023-06-28 08:03:50
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 11,304 KB
実行使用メモリ 19,292 KB
最終ジャッジ日時 2023-09-18 08:21:38
合計ジャッジ時間 4,137 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,184 KB
testcase_01 AC 77 ms
15,008 KB
testcase_02 AC 79 ms
15,200 KB
testcase_03 AC 79 ms
15,236 KB
testcase_04 AC 78 ms
15,204 KB
testcase_05 AC 78 ms
15,144 KB
testcase_06 AC 77 ms
15,208 KB
testcase_07 AC 77 ms
15,092 KB
testcase_08 WA -
testcase_09 AC 80 ms
15,092 KB
testcase_10 WA -
testcase_11 AC 81 ms
15,780 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 81 ms
15,312 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 81 ms
15,288 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 85 ms
16,088 KB
testcase_28 AC 89 ms
19,292 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[-n..-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[0...ans]
  end
end
0