結果
| 問題 | No.3086 Re One Two | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-04-04 23:08:50 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 500 bytes | 
| コンパイル時間 | 380 ms | 
| コンパイル使用メモリ | 82,760 KB | 
| 実行使用メモリ | 89,228 KB | 
| 最終ジャッジ日時 | 2025-04-04 23:09:05 | 
| 合計ジャッジ時間 | 14,407 ms | 
| ジャッジサーバーID (参考情報) | judge6 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 11 WA * 21 | 
ソースコード
N=int(input())
stack=[]
for i in range(1,N+1):
    A,B=map(int,input().split())
    if A==0:
        if B==0:
            print(i)
            while len(stack) and stack[-1][0]==1:
                print(stack.pop()[1])
        elif B==1:
            print(i)
            print(stack.pop()[1])
            while len(stack) and stack[-1][0]==1:
                print(stack.pop()[1])
        else:
            stack.append((2,i))
    else:stack.append((1,i))
while len(stack):
    print(stack.pop()[1])
            
            
            
        