結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
👑 |
提出日時 | 2022-01-19 20:37:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 117 ms / 2,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 225 ms |
コンパイル使用メモリ | 82,768 KB |
実行使用メモリ | 77,056 KB |
最終ジャッジ日時 | 2024-11-23 14:03:07 |
合計ジャッジ時間 | 4,049 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
n = int(input())pos = [{} for _ in range(21)]for _ in range(n):t, *Q = input().split()if t == "0":n, m, *A = Qn = int(n)for a in A:pos[n][a] = pos[n].get(a, 0) + 1elif t == "1":ng = Trueb = Q[0]for i in range(1, 21):if pos[i].get(b, 0) > 0:print(i)pos[i][b] -= 1ng = Falsebreakif ng:print(-1)else:c = int(Q[0])pos[c] = {}