結果
| 問題 | No.714 回転寿司屋のシミュレート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-14 06:55:25 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 701 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 12,032 KB |
| 最終ジャッジ日時 | 2026-09-12 09:41:09 |
| 合計ジャッジ時間 | 2,694 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 31 |
ソースコード
from collections import defaultdict
from heapq import heappush, heappop
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
write = stdout.write
def main():
N = int(input())
U = [tuple(input().split()) for _ in [0] * N]
sushi = defaultdict(list)
kaikei = []
for s in U:
if s[0] == '0':
for t in s[3:]:
heappush(sushi[t], s[1])
elif s[0] == '1':
while sushi[s[1]]:
seat = heappop(sushi[s[1]])
if seat not in kaikei:
print(seat)
break
else:
print(-1)
else:
kaikei.append(s[1])
main()