結果

問題 No.1149 色塗りゲーム
ユーザー lloyzlloyz
提出日時 2022-02-16 22:29:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 24,336 KB
平均クエリ数 19.82
最終ジャッジ日時 2023-09-11 17:16:18
合計ジャッジ時間 6,809 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
23,752 KB
testcase_01 AC 55 ms
23,940 KB
testcase_02 AC 56 ms
24,192 KB
testcase_03 AC 55 ms
23,388 KB
testcase_04 AC 56 ms
24,300 KB
testcase_05 AC 56 ms
24,016 KB
testcase_06 AC 57 ms
23,428 KB
testcase_07 AC 56 ms
23,436 KB
testcase_08 AC 57 ms
23,944 KB
testcase_09 AC 56 ms
23,352 KB
testcase_10 AC 57 ms
23,604 KB
testcase_11 AC 58 ms
23,692 KB
testcase_12 AC 57 ms
23,488 KB
testcase_13 AC 58 ms
23,628 KB
testcase_14 AC 58 ms
23,592 KB
testcase_15 AC 59 ms
23,944 KB
testcase_16 AC 58 ms
24,192 KB
testcase_17 AC 60 ms
23,520 KB
testcase_18 AC 58 ms
23,892 KB
testcase_19 AC 60 ms
23,496 KB
testcase_20 AC 59 ms
24,336 KB
testcase_21 AC 60 ms
23,556 KB
testcase_22 AC 59 ms
23,956 KB
testcase_23 AC 59 ms
23,944 KB
testcase_24 AC 60 ms
23,856 KB
testcase_25 AC 61 ms
23,704 KB
testcase_26 AC 61 ms
23,900 KB
testcase_27 AC 63 ms
23,328 KB
testcase_28 AC 61 ms
23,484 KB
testcase_29 AC 62 ms
23,992 KB
testcase_30 AC 102 ms
24,204 KB
testcase_31 AC 95 ms
24,168 KB
testcase_32 AC 97 ms
24,324 KB
testcase_33 AC 101 ms
23,536 KB
testcase_34 AC 104 ms
23,672 KB
testcase_35 AC 98 ms
23,600 KB
testcase_36 AC 107 ms
23,548 KB
testcase_37 AC 109 ms
23,396 KB
testcase_38 AC 103 ms
23,304 KB
testcase_39 AC 110 ms
24,196 KB
testcase_40 AC 115 ms
23,348 KB
testcase_41 AC 115 ms
23,848 KB
testcase_42 AC 112 ms
24,288 KB
testcase_43 AC 111 ms
23,344 KB
testcase_44 AC 120 ms
24,192 KB
testcase_45 AC 119 ms
23,552 KB
testcase_46 AC 123 ms
23,304 KB
testcase_47 AC 127 ms
23,344 KB
testcase_48 AC 126 ms
23,556 KB
testcase_49 AC 129 ms
23,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

if n == 1:
    print(1, 1)
elif n == 2:
    print(2, 1)
else:
    if n % 2 == 0:
        print(2, n // 2)
        l, r = n // 2 - 1, n // 2 + 2
    else:
        print(1, (n + 1) // 2)
        l, r = (n + 1) // 2 - 1, (n + 1) // 2 + 1

    t = int(input())
    while t == 3:
        k, x = map(int, input().split())
        if x <= l:
            if k == 2:
                x += 1
            dif = l - x
            print(k, r + dif)
        else:
            if k == 2:
                x += 1
            dif = x - r
            print(k, l - dif)
        t = int(input())
0