結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
![]() |
提出日時 | 2018-08-02 00:37:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 67 ms / 2,000 ms |
コード長 | 865 bytes |
コンパイル時間 | 125 ms |
コンパイル使用メモリ | 12,928 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-19 16:58:51 |
合計ジャッジ時間 | 2,218 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
n = int(input())netas = []persons = []for i in range(n):xs = [x for x in input().split()]xs[0] = int(xs[0])if xs[0] == 1:netas.append( xs[1] )is_match = Falsefor index, neta in enumerate(netas):for person in persons:if neta in person[1]:person[1].remove(neta)is_match = (neta, person[0])breakif is_match:breakif is_match:print(is_match[1])netas.remove( is_match[0] )else:print(-1)nneta = list(reversed(netas))nneta.remove( xs[1] )nneta = list(reversed(nneta))netas = nnetaelif xs[0] == 0:seki = int( xs[1] )persons.append( (seki, xs[3:]) )persons = sorted(persons, key=lambda x:x[0])elif xs[0] == 2:seki = int( xs[1] )persons = [ person for person in persons if person[0] != seki ]