結果

問題 No.1149 色塗りゲーム
ユーザー chielochielo
提出日時 2020-08-07 21:34:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 1,258 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 87,760 KB
平均クエリ数 19.82
最終ジャッジ日時 2023-09-24 04:08:10
合計ジャッジ時間 9,736 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
87,684 KB
testcase_01 AC 96 ms
87,060 KB
testcase_02 AC 101 ms
87,704 KB
testcase_03 AC 98 ms
86,856 KB
testcase_04 AC 94 ms
87,184 KB
testcase_05 AC 95 ms
86,904 KB
testcase_06 AC 95 ms
86,724 KB
testcase_07 AC 98 ms
87,308 KB
testcase_08 AC 96 ms
87,480 KB
testcase_09 AC 104 ms
86,984 KB
testcase_10 AC 100 ms
86,820 KB
testcase_11 AC 99 ms
87,760 KB
testcase_12 AC 101 ms
86,796 KB
testcase_13 AC 100 ms
87,124 KB
testcase_14 AC 97 ms
87,348 KB
testcase_15 AC 98 ms
87,088 KB
testcase_16 AC 101 ms
87,576 KB
testcase_17 AC 98 ms
87,116 KB
testcase_18 AC 96 ms
87,484 KB
testcase_19 AC 96 ms
87,480 KB
testcase_20 AC 98 ms
87,236 KB
testcase_21 AC 99 ms
87,028 KB
testcase_22 AC 100 ms
87,332 KB
testcase_23 AC 103 ms
86,872 KB
testcase_24 AC 103 ms
87,548 KB
testcase_25 AC 100 ms
87,596 KB
testcase_26 AC 98 ms
87,348 KB
testcase_27 AC 102 ms
87,472 KB
testcase_28 AC 108 ms
86,912 KB
testcase_29 AC 109 ms
87,244 KB
testcase_30 AC 151 ms
87,608 KB
testcase_31 AC 134 ms
86,868 KB
testcase_32 AC 133 ms
86,880 KB
testcase_33 AC 138 ms
87,624 KB
testcase_34 AC 140 ms
87,108 KB
testcase_35 AC 132 ms
87,136 KB
testcase_36 AC 148 ms
87,372 KB
testcase_37 AC 149 ms
87,104 KB
testcase_38 AC 139 ms
87,684 KB
testcase_39 AC 152 ms
86,712 KB
testcase_40 AC 149 ms
86,996 KB
testcase_41 AC 149 ms
87,172 KB
testcase_42 AC 150 ms
87,696 KB
testcase_43 AC 143 ms
87,028 KB
testcase_44 AC 153 ms
86,924 KB
testcase_45 AC 149 ms
87,232 KB
testcase_46 AC 150 ms
86,928 KB
testcase_47 AC 169 ms
87,456 KB
testcase_48 AC 160 ms
87,200 KB
testcase_49 AC 165 ms
87,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdout

n = int(input())

def ask(k, x):
    print(k, x)
    stdout.flush()
    t = int(input())
    if t == 3:
        return (t, *map(int, input().split()))
    return (t,)

if n % 2 == 0:
    t, *last = ask(2, n // 2)
else:
    t, *last = ask(1, (n + 1) // 2)

while t == 3:
    k, x = last
    if k == 1:
        t, *last = ask(1, n - x + 1)
    elif k == 2:
        x += 1
        t, *last = ask(2, n - x + 1)
0