結果

問題 No.2372 既視感
ユーザー dangodango
提出日時 2023-07-08 08:19:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 900 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 78,384 KB
最終ジャッジ日時 2023-09-29 09:35:09
合計ジャッジ時間 5,423 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,612 KB
testcase_01 AC 74 ms
71,408 KB
testcase_02 AC 75 ms
71,136 KB
testcase_03 AC 73 ms
71,344 KB
testcase_04 AC 74 ms
71,316 KB
testcase_05 AC 75 ms
71,336 KB
testcase_06 AC 74 ms
71,236 KB
testcase_07 AC 72 ms
71,288 KB
testcase_08 AC 127 ms
77,728 KB
testcase_09 AC 116 ms
78,384 KB
testcase_10 AC 100 ms
76,968 KB
testcase_11 AC 103 ms
76,680 KB
testcase_12 AC 76 ms
71,508 KB
testcase_13 AC 141 ms
77,828 KB
testcase_14 AC 82 ms
75,472 KB
testcase_15 AC 98 ms
76,912 KB
testcase_16 AC 100 ms
76,972 KB
testcase_17 AC 81 ms
75,596 KB
testcase_18 AC 75 ms
71,360 KB
testcase_19 AC 74 ms
71,484 KB
testcase_20 AC 78 ms
75,652 KB
testcase_21 AC 76 ms
71,108 KB
testcase_22 AC 83 ms
75,584 KB
testcase_23 AC 122 ms
78,016 KB
testcase_24 AC 128 ms
78,084 KB
testcase_25 AC 129 ms
78,068 KB
testcase_26 AC 125 ms
78,020 KB
testcase_27 AC 141 ms
78,180 KB
testcase_28 AC 127 ms
77,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(N, K, Q):
    A = []
    for _ in range(Q):
        query = int(input())
        if query == 2:
            time = 0
            correct = 0
            B = []
            for i in range(6):
                t, d = input().split()
                d = int(d)
                seen = False
                for j in range(N):
                    if 0 <= len(A)-1-j:
                        if A[-1-j] == t:
                            seen = True
                            break
                    else:
                        break
                if seen:
                    time += min(K, d)
                else:
                    time += d
                if time <= 60:
                    correct += 1
                    B.append(t)
            A.extend(B)
            print(correct)
        else:
            A.append(input())
N, K, Q = map(int, input().split())
solve(N, K, Q)

0