結果

問題 No.3598 Queen vs. King
コンテスト
ユーザー 👑 loop0919
提出日時 2026-07-24 22:05:01
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 772 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 233 ms
コンパイル使用メモリ 96,236 KB
実行使用メモリ 94,336 KB
平均クエリ数 381.33
最終ジャッジ日時 2026-07-24 22:05:05
合計ジャッジ時間 3,257 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 RE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def receive():
    x, y = [int(s) for s in input().split()]

    if (x, y) in ((0, 0), (-1, -1)):
        is_end = True
    else:
        is_end = False

    return is_end, (x, y)


def put(x, y):
    print(x, y)


def solve():
    H, W = [int(s) for s in input().split()]

    if H >= 4:
        res, _ = receive()
        if res:
            return
        curr_x, curr_y = H - 2, 1
        put(curr_x, curr_y)

    if W >= 4:
        res, _ = receive()
        if res:
            return
        curr_x, curr_y = H - 2, W - 2
        put(curr_x, curr_y)

    res, _ = receive()
    if res:
        return

    put(H - 1, W - 1)

    res, _ = receive()
    if res:
        return


if __name__ == "__main__":
    T = int(input())

    for _ in range(T):
        solve()
0