結果
| 問題 | No.714 回転寿司屋のシミュレート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-25 21:27:46 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 143 ms / 2,000 ms |
| コード長 | 652 bytes |
| 記録 | |
| コンパイル時間 | 427 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-03-23 10:33:29 |
| 合計ジャッジ時間 | 5,733 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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