結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
![]() |
提出日時 | 2018-07-13 22:38:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 62 ms / 2,000 ms |
コード長 | 908 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-09 05:24:48 |
合計ジャッジ時間 | 2,331 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#!/usr/bin/env python3 import collections N = 20 def main(): n = int(input()) wishlists = [collections.Counter() for _ in range(N)] for _ in range(n): data = input().split() if data[0] == "0": table_idx = int(data[1]) - 1 wishlist = collections.Counter(data[3:]) wishlists[table_idx] = wishlist elif data[0] == "2": wishlists[int(data[1]) - 1] = collections.Counter() else: sushi = data[1] for table_idx in range(N): if sushi in wishlists[table_idx]: print(table_idx + 1) wishlists[table_idx][sushi] -= 1 if wishlists[table_idx][sushi] == 0: del wishlists[table_idx][sushi] break else: print("-1") if __name__ == '__main__': main()