結果

問題 No.2372 既視感
ユーザー Ekiben542Ekiben542
提出日時 2023-07-07 21:39:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 643 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 78,732 KB
最終ジャッジ日時 2023-09-28 22:39:51
合計ジャッジ時間 3,982 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,408 KB
testcase_01 AC 69 ms
71,416 KB
testcase_02 AC 68 ms
71,136 KB
testcase_03 AC 67 ms
71,416 KB
testcase_04 AC 69 ms
71,588 KB
testcase_05 AC 68 ms
71,328 KB
testcase_06 AC 69 ms
71,328 KB
testcase_07 AC 72 ms
71,128 KB
testcase_08 AC 99 ms
76,936 KB
testcase_09 AC 82 ms
75,596 KB
testcase_10 AC 100 ms
77,152 KB
testcase_11 AC 110 ms
77,768 KB
testcase_12 AC 71 ms
71,068 KB
testcase_13 AC 109 ms
77,872 KB
testcase_14 AC 74 ms
71,528 KB
testcase_15 AC 92 ms
76,384 KB
testcase_16 AC 86 ms
75,300 KB
testcase_17 AC 73 ms
71,356 KB
testcase_18 AC 74 ms
71,300 KB
testcase_19 AC 71 ms
71,348 KB
testcase_20 AC 71 ms
71,424 KB
testcase_21 AC 70 ms
71,352 KB
testcase_22 AC 75 ms
71,272 KB
testcase_23 AC 113 ms
77,912 KB
testcase_24 AC 124 ms
78,732 KB
testcase_25 AC 116 ms
77,976 KB
testcase_26 AC 110 ms
77,752 KB
testcase_27 AC 114 ms
77,824 KB
testcase_28 AC 121 ms
78,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K, Q = map(int, input().split())
A = []
for _ in range(Q):
    query = input().split()
    if query[0] == '1':
        s = input().strip()
        A.append(s)
    else:
        t = []
        d = []
        for _ in range(6):
            t_i, d_i = input().split()
            t.append(t_i)
            d.append(int(d_i))
        B = A[max(0, len(A)-N):]
        time = 0
        cnt = 0
        for i in range(6):
            if t[i] in B:
                time += min(d[i], K)
            else:
                time += d[i]
            if time > 60:
                break
            cnt += 1
        print(cnt)
        A.extend(t[:cnt])

0