結果

問題 No.1149 色塗りゲーム
ユーザー kimiyuki
提出日時 2020-08-07 21:39:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,520 KB
平均クエリ数 19.88
最終ジャッジ日時 2024-07-17 04:21:49
合計ジャッジ時間 8,520 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

def main():
    n = int(input())
    if n % 2 == 1:
        k = 1
        x = n // 2 + 1
    else:
        k = 2
        x = n // 2
    print(k, x)
    sys.stdout.flush()
    l = 1
    r = k + x
    while True:
        t = int(input())
        if t != 3:
            break
        k, x = map(int, input().split())
        if r <= x:
            y = x - r + l
        else:
            y = x - l + r
        print(k, y)
        sys.stdout.flush()

main()
0