結果

問題 No.2502 Optimization in the Dark
ユーザー suisensuisen
提出日時 2023-01-12 16:25:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 772 bytes
コンパイル時間 932 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 87,780 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 20:30:38
合計ジャッジ時間 7,215 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
87,064 KB
testcase_01 AC 103 ms
87,264 KB
testcase_02 AC 103 ms
87,524 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 101 ms
87,048 KB
testcase_09 WA -
testcase_10 AC 99 ms
87,096 KB
testcase_11 AC 98 ms
87,388 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 98 ms
87,012 KB
testcase_16 AC 99 ms
87,104 KB
testcase_17 WA -
testcase_18 AC 98 ms
87,232 KB
testcase_19 WA -
testcase_20 AC 97 ms
86,820 KB
testcase_21 WA -
testcase_22 AC 98 ms
87,160 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 98 ms
87,336 KB
testcase_26 WA -
testcase_27 AC 99 ms
87,008 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 97 ms
86,980 KB
testcase_32 AC 101 ms
87,696 KB
testcase_33 AC 101 ms
87,216 KB
testcase_34 AC 99 ms
86,916 KB
testcase_35 AC 100 ms
87,112 KB
testcase_36 AC 99 ms
87,220 KB
testcase_37 AC 98 ms
86,848 KB
testcase_38 AC 101 ms
87,132 KB
testcase_39 AC 98 ms
87,080 KB
testcase_40 AC 99 ms
87,064 KB
testcase_41 AC 96 ms
87,000 KB
testcase_42 AC 99 ms
87,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def query(i, x, j, y):
    print('?', i, x, j, y, flush=True)
    response = input()
    if response == "Yes":
        return True
    elif response == "No":
        return False
    else:
        assert False

def output_answer(n, i1, j1, i2, j2, i3, j3):
    out = []
    for _ in range(n): out += [i1, j1]
    for _ in range(n): out += [i2, j2]
    for _ in range(n): out += [i3, j3]
    print('!', *out, flush=True)

n = int(input())

if query(2, 1, 3, 1):
    if query(1, 1, 2, 1):
        i1, j1 = 2, 3
    else:
        i1, j1 = 1, 3
else:
    if query(1, 1, 3, 1):
        i1, j1 = 2, 3
    else:
        i1, j1 = 1, 2

i2 = i1 ^ j1
if query(i1, n + 1, j1, n + 1):
    j2 = j1
else:
    j2 = i1

i3, j3 = i2, j2 ^ i1 ^ j1

output_answer(n, i1, j1, i2, j2, i3, j3)
0