結果
問題 |
No.714 回転寿司屋のシミュレート
|
ユーザー |
|
提出日時 | 2022-06-20 23:26:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 128 ms / 2,000 ms |
コード長 | 661 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 77,988 KB |
最終ジャッジ日時 | 2024-10-13 12:27:31 |
合計ジャッジ時間 | 4,196 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
from collections import defaultdict n = int(input()) Cnt = defaultdict(lambda :[0 for _ in range(21)]) for _ in range(n): L = list(input().split()) if L[0] == '0': j = int(L[1]) m = int(L[2]) L = L[3:] for i in range(m): Cnt[L[i]][j] += 1 elif L[0] == '1': s = L[1] flag = False for i in range(1, 21): if Cnt[s][i] > 0: Cnt[s][i] -= 1 print(i) flag = True break if not flag: print(-1) elif L[0] == '2': j = int(L[1]) for s in Cnt.keys(): Cnt[s][j] = 0