結果

問題 No.1149 色塗りゲーム
ユーザー titia
提出日時 2020-08-07 21:32:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 27,872 KB
平均クエリ数 6.62
最終ジャッジ日時 2024-07-17 04:16:23
合計ジャッジ時間 7,513 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())

if N==1:
    print(1,1,flush=True)
    t=int(input())
    sys.exit()
elif N==2:
    print(2,1,flush=True)
    t=int(input())
    sys.exit()
else:
    if N%2==1:
        print(1,(N+1)//2,flush=True)
    else:
        print(2,(N+1)//2,flush=True)

    while True:
        t=int(input())
        if t==0 or t==1:
            sys.exit()
        else:
            k,x=map(int,input().split())

            if k==1:
                print(1,N+1-x,flush=True)
            else:
                if x<N+1-x:
                    print(2,N-x,flush=True)
                else:
                    print(2,N+2-x,flush=True)
                    
                

            
        
        
0