結果

問題 No.2372 既視感
ユーザー KowerKoint2010KowerKoint2010
提出日時 2023-06-28 08:16:17
言語 Ruby
(3.3.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 11,524 KB
実行使用メモリ 19,196 KB
最終ジャッジ日時 2023-09-18 08:35:52
合計ジャッジ時間 3,727 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,112 KB
testcase_01 AC 82 ms
15,036 KB
testcase_02 AC 80 ms
15,120 KB
testcase_03 AC 80 ms
15,124 KB
testcase_04 AC 80 ms
15,372 KB
testcase_05 AC 81 ms
15,048 KB
testcase_06 AC 81 ms
15,092 KB
testcase_07 AC 81 ms
15,320 KB
testcase_08 AC 85 ms
15,828 KB
testcase_09 AC 83 ms
15,112 KB
testcase_10 AC 86 ms
16,352 KB
testcase_11 AC 85 ms
15,876 KB
testcase_12 AC 80 ms
15,028 KB
testcase_13 AC 86 ms
16,116 KB
testcase_14 AC 81 ms
15,044 KB
testcase_15 AC 83 ms
15,480 KB
testcase_16 AC 84 ms
15,376 KB
testcase_17 AC 81 ms
15,132 KB
testcase_18 AC 81 ms
15,160 KB
testcase_19 AC 82 ms
15,304 KB
testcase_20 AC 83 ms
15,116 KB
testcase_21 AC 84 ms
15,080 KB
testcase_22 AC 82 ms
15,304 KB
testcase_23 AC 91 ms
16,020 KB
testcase_24 AC 88 ms
15,992 KB
testcase_25 AC 89 ms
16,088 KB
testcase_26 AC 89 ms
15,996 KB
testcase_27 AC 90 ms
16,068 KB
testcase_28 AC 94 ms
19,196 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 != 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[0...ans]
  end
end
0