結果
| 問題 |
No.714 回転寿司屋のシミュレート
|
| コンテスト | |
| ユーザー |
nadare
|
| 提出日時 | 2018-07-13 22:57:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 2,000 ms |
| コード長 | 686 bytes |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-09 05:27:28 |
| 合計ジャッジ時間 | 2,434 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
# -*- coding: utf-8 -*-
from itertools import product
from heapq import heappop, heappush
from collections import defaultdict
def inpl(): return map(int, input().split())
N = int(input())
sushi = defaultdict(list)
want = [[] for _ in range(21)]
for _ in range(N):
order, *remain = input().split()
if order == "0":
n, m, *A = remain
want[int(n)] = A
elif order == "1":
B = remain[0]
for i in range(21):
if B in want[i]:
j = want[i].index(B)
print(i)
del want[i][j]
break
else:
print(-1)
else:
C = int(remain[0])
want[C] = []
nadare