結果

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

ソースコード

diff #
raw source code

def Bob():
    h, w = map(int, input().split())
    return h, w

def Alice(h, w):
    print(h, w)

for _ in range(int(input())):
    c, d = map(int, input().split())
    a, b = 1, 1
    W = d

    for i in range(3):
        if i == 0:
            c, d = Bob()
            if c == 0 or c == -1: break
            if 4 <= W:
                Alice(1, d-1)
                a, b = 1, d-1
            else:
                Alice(1, d)
                a, b = 1, d
        elif i == 1:
            c, d = Bob()
            if c == 0 or c == -1: break
            if 4 <= W and b == d-2 and d == W:
                Alice(1, d-1)
                b = d-1
            else:
                Alice(c, b)
                a = c
        else:
            c, d = Bob()
            if c == 0 or c == -1: break
            Alice(c, d-1)
    else:
        c, d = map(int, input().split())
0