結果
| 問題 | No.3086 Re One Two |
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-04-04 22:00:28 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 587 bytes |
| 記録 | |
| コンパイル時間 | 539 ms |
| コンパイル使用メモリ | 96,108 KB |
| 実行使用メモリ | 440,704 KB |
| 最終ジャッジ日時 | 2026-07-08 09:52:17 |
| 合計ジャッジ時間 | 5,381 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 TLE * 1 -- * 30 |
ソースコード
N=int(input())
from collections import deque
d=deque()
A=[deque() for i in range(N)]
for i in range(N):
A[i].append(i+1)
d=deque()
ans=[]
for i in range(N):
a,b=map(int,input().split())
if a+b==0:
while A[i]:
c=A[i].popleft()
ans.append(c)
elif b==2:
while A[i]:
c=A[i].popleft()
d.append(c)
if b==1:
while d:
c=d.popleft()
A[i].append(c)
if a==1:
while A[i]:
c=A[i].popleft()
A[i+1].append(c)
for i in range(N):
while A[i]:
c=A[i].popleft()
ans.append(c)
for c in ans:
print(c)
timi