結果

問題 No.2372 既視感
ユーザー mkawa2mkawa2
提出日時 2023-07-07 21:33:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,346 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 78,036 KB
最終ジャッジ日時 2023-09-28 22:32:19
合計ジャッジ時間 4,685 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,368 KB
testcase_01 AC 96 ms
71,384 KB
testcase_02 AC 97 ms
71,720 KB
testcase_03 AC 95 ms
71,796 KB
testcase_04 AC 94 ms
71,880 KB
testcase_05 WA -
testcase_06 AC 96 ms
71,816 KB
testcase_07 AC 96 ms
71,704 KB
testcase_08 WA -
testcase_09 AC 102 ms
72,128 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 108 ms
76,964 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 98 ms
71,556 KB
testcase_23 AC 113 ms
77,488 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 111 ms
77,560 KB
testcase_28 AC 127 ms
77,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
# sys.set_int_max_str_digits(1000005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# md = 10**9+7
md = 998244353


from collections import deque,Counter

n,k,q=LI()

fq=deque()
fc=Counter()

for _ in range(q):
    while len(fq)>n:
        s=fq.popleft()
        fc[s]-=1
    if II()==1:
        s=SI()
        fq.append(s)
        fc[s]+=1
    else:
        t=0
        sd=[SI().split() for _ in range(6)]
        for i,(s,d) in enumerate(sd):
            d=int(d)
            if fc[s]:
                t+=min(d,k)
            else:
                t+=d
            if t>60:
                print(i)
                break
        if t<=60:print(6)
        for s,d in sd:
            fq.append(s)
            fc[s]+=1
0