結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
|
提出日時 | 2019-07-25 21:27:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 64 ms / 2,000 ms |
コード長 | 652 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-02 06:18:11 |
合計ジャッジ時間 | 2,620 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
from collections import defaultdict N = int(input()) exist = [None] + [False] * 20 want_dict = defaultdict(int) for _ in range(N): U = list(input().split()) flag = int(U[0]) if flag == 0: n, m, A = int(U[1]), int(U[2]), U[3:] exist[n] = True want_dict[n] = A if flag == 1: B = U[1] for i in range(1, 21): if exist[i]: if B in want_dict[i]: print(i) want_dict[i].remove(B) break else: print(-1) if flag == 2: C = int(U[1]) exist[C] = False