結果

問題 No.2372 既視感
ユーザー Akijin_007Akijin_007
提出日時 2023-07-07 22:20:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 192 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 78,564 KB
最終ジャッジ日時 2023-09-28 23:43:39
合計ジャッジ時間 4,637 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,400 KB
testcase_01 AC 70 ms
71,344 KB
testcase_02 AC 77 ms
70,864 KB
testcase_03 AC 72 ms
71,092 KB
testcase_04 AC 72 ms
71,024 KB
testcase_05 AC 71 ms
71,136 KB
testcase_06 AC 71 ms
71,196 KB
testcase_07 AC 71 ms
71,312 KB
testcase_08 AC 126 ms
77,992 KB
testcase_09 AC 98 ms
76,832 KB
testcase_10 AC 124 ms
77,344 KB
testcase_11 AC 114 ms
77,324 KB
testcase_12 AC 80 ms
74,912 KB
testcase_13 AC 136 ms
78,564 KB
testcase_14 AC 82 ms
75,732 KB
testcase_15 AC 108 ms
76,952 KB
testcase_16 AC 103 ms
76,764 KB
testcase_17 AC 83 ms
75,956 KB
testcase_18 AC 82 ms
75,872 KB
testcase_19 AC 76 ms
74,820 KB
testcase_20 AC 78 ms
74,848 KB
testcase_21 AC 79 ms
74,608 KB
testcase_22 AC 85 ms
75,932 KB
testcase_23 AC 128 ms
77,580 KB
testcase_24 AC 128 ms
77,896 KB
testcase_25 AC 128 ms
77,348 KB
testcase_26 AC 131 ms
77,452 KB
testcase_27 AC 135 ms
77,576 KB
testcase_28 AC 192 ms
78,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N, K, Q = map(int, input().split())

ans = []
A = []
for i in range(Q):
    q = int(input())
    if q == 1:
        s = input()
        A.append(s)
    else:
        t = [0] * 6
        d = [0] * 6
        for j in range(6):
            t[j], d[j] = input().split()
            d[j] = int(d[j])
        M = len(A)
        for j in range(max(0, M-N), M):
            if A[j] in t:
                u = t.index(A[j])
                d[u] = min(K, d[u])

        s = 0
        for j in range(6):
            if sum(d[:j+1]) <= 60:
                s += 1
            else:
                break
        ans.append(s)

        for j in range(s):
            A.append(t[j])

for x in ans:
    print(x)



0