結果

問題 No.1149 色塗りゲーム
ユーザー chineristACchineristAC
提出日時 2020-08-07 21:43:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 721 bytes
コンパイル時間 1,671 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 87,572 KB
平均クエリ数 19.88
最終ジャッジ日時 2023-09-24 04:17:06
合計ジャッジ時間 10,313 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
87,192 KB
testcase_01 AC 115 ms
87,540 KB
testcase_02 AC 115 ms
86,784 KB
testcase_03 AC 114 ms
86,896 KB
testcase_04 AC 115 ms
87,228 KB
testcase_05 AC 113 ms
87,036 KB
testcase_06 AC 111 ms
86,996 KB
testcase_07 AC 114 ms
87,468 KB
testcase_08 AC 111 ms
87,336 KB
testcase_09 AC 111 ms
86,884 KB
testcase_10 AC 112 ms
87,072 KB
testcase_11 AC 114 ms
87,268 KB
testcase_12 AC 116 ms
86,972 KB
testcase_13 AC 114 ms
87,476 KB
testcase_14 AC 116 ms
87,120 KB
testcase_15 AC 114 ms
86,664 KB
testcase_16 AC 115 ms
86,804 KB
testcase_17 AC 118 ms
86,976 KB
testcase_18 AC 115 ms
86,644 KB
testcase_19 AC 117 ms
87,200 KB
testcase_20 AC 116 ms
87,424 KB
testcase_21 AC 119 ms
87,292 KB
testcase_22 AC 118 ms
87,168 KB
testcase_23 AC 119 ms
86,896 KB
testcase_24 AC 118 ms
87,388 KB
testcase_25 AC 119 ms
87,244 KB
testcase_26 AC 119 ms
87,296 KB
testcase_27 AC 123 ms
86,868 KB
testcase_28 AC 120 ms
87,256 KB
testcase_29 AC 121 ms
87,156 KB
testcase_30 AC 160 ms
87,288 KB
testcase_31 AC 154 ms
87,556 KB
testcase_32 AC 159 ms
86,952 KB
testcase_33 AC 158 ms
87,080 KB
testcase_34 AC 167 ms
87,108 KB
testcase_35 AC 157 ms
86,744 KB
testcase_36 AC 166 ms
87,280 KB
testcase_37 AC 166 ms
79,132 KB
testcase_38 AC 169 ms
87,380 KB
testcase_39 AC 167 ms
87,208 KB
testcase_40 AC 172 ms
87,296 KB
testcase_41 AC 168 ms
87,392 KB
testcase_42 AC 176 ms
87,124 KB
testcase_43 AC 171 ms
87,392 KB
testcase_44 AC 186 ms
86,628 KB
testcase_45 AC 178 ms
87,456 KB
testcase_46 AC 183 ms
87,372 KB
testcase_47 AC 181 ms
87,572 KB
testcase_48 AC 177 ms
87,436 KB
testcase_49 AC 186 ms
86,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N=int(input())
cond=[0]*(N+2)
cond[0]=1
cond[-1]=1
if N%2==1:
    k=N//2
    print(1,k+1)
    sys.stdout.flush()
    base=k
else:
    k=N//2-1
    print(2,k+1)
    sys.stdout.flush()
    base=k

while True:
    t=int(input())
    if t==0:
        exit()
    elif t==3:
        k,x=map(int,input().split())
        if 1<=x<=base:
            if N%2==1:
                print(k,x+base+1)
                sys.stdout.flush()
            else:
                print(k,x+base+2)
                sys.stdout.flush()
        else:
            if N%2==1:
                print(k,x-base-1)
                sys.stdout.flush()
            else:
                print(k,x-base-2)
                sys.stdout.flush()
        
0