結果

問題 No.2502 Optimization in the Dark
ユーザー suisensuisen
提出日時 2023-01-12 16:00:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 788 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 87,672 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 20:30:22
合計ジャッジ時間 7,420 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
87,180 KB
testcase_01 AC 98 ms
87,288 KB
testcase_02 AC 100 ms
87,276 KB
testcase_03 AC 100 ms
87,100 KB
testcase_04 AC 100 ms
87,188 KB
testcase_05 AC 98 ms
87,380 KB
testcase_06 AC 100 ms
87,072 KB
testcase_07 AC 98 ms
87,176 KB
testcase_08 AC 100 ms
87,624 KB
testcase_09 AC 99 ms
87,164 KB
testcase_10 AC 102 ms
87,572 KB
testcase_11 AC 101 ms
86,980 KB
testcase_12 AC 101 ms
87,000 KB
testcase_13 AC 99 ms
86,680 KB
testcase_14 AC 101 ms
86,864 KB
testcase_15 AC 99 ms
86,964 KB
testcase_16 AC 100 ms
87,328 KB
testcase_17 AC 101 ms
87,164 KB
testcase_18 AC 99 ms
87,380 KB
testcase_19 AC 98 ms
87,596 KB
testcase_20 AC 98 ms
87,004 KB
testcase_21 AC 98 ms
87,416 KB
testcase_22 AC 96 ms
86,752 KB
testcase_23 AC 101 ms
87,460 KB
testcase_24 AC 100 ms
87,168 KB
testcase_25 AC 100 ms
87,496 KB
testcase_26 AC 98 ms
87,512 KB
testcase_27 AC 99 ms
86,984 KB
testcase_28 AC 99 ms
86,888 KB
testcase_29 AC 100 ms
87,672 KB
testcase_30 AC 102 ms
87,336 KB
testcase_31 AC 102 ms
87,256 KB
testcase_32 AC 101 ms
87,088 KB
testcase_33 AC 100 ms
87,188 KB
testcase_34 AC 100 ms
87,192 KB
testcase_35 AC 100 ms
87,520 KB
testcase_36 AC 100 ms
87,444 KB
testcase_37 AC 100 ms
87,560 KB
testcase_38 AC 102 ms
87,028 KB
testcase_39 AC 99 ms
87,496 KB
testcase_40 AC 100 ms
87,340 KB
testcase_41 AC 99 ms
87,316 KB
testcase_42 AC 98 ms
87,200 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, 2 * n, 3, 2 * n):
    if query(1, 2 * n, 3, 2 * n):
        i3, j3 = 1, 2
    else:
        i3, j3 = 2, 3
else:
    if query(1, 2 * n, 2, 2 * n):
        i3, j3 = 1, 3
    else:
        i3, j3 = 2, 3

i2 = i3 ^ j3
if query(i3, n, j3, n):
    j2 = i3
else:
    j2 = j3

i1, j1 = i2, j2 ^ i3 ^ j3

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