結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
86,804 KB
testcase_01 AC 100 ms
87,068 KB
testcase_02 AC 101 ms
87,408 KB
testcase_03 AC 103 ms
87,684 KB
testcase_04 AC 100 ms
87,292 KB
testcase_05 AC 98 ms
87,544 KB
testcase_06 AC 100 ms
87,188 KB
testcase_07 AC 97 ms
87,276 KB
testcase_08 AC 100 ms
87,132 KB
testcase_09 AC 102 ms
87,044 KB
testcase_10 AC 101 ms
87,164 KB
testcase_11 AC 100 ms
87,200 KB
testcase_12 AC 100 ms
87,008 KB
testcase_13 AC 99 ms
87,292 KB
testcase_14 AC 101 ms
86,876 KB
testcase_15 AC 98 ms
87,032 KB
testcase_16 AC 98 ms
87,528 KB
testcase_17 AC 100 ms
87,732 KB
testcase_18 AC 99 ms
86,760 KB
testcase_19 AC 96 ms
87,172 KB
testcase_20 AC 97 ms
87,144 KB
testcase_21 AC 97 ms
87,272 KB
testcase_22 AC 98 ms
87,680 KB
testcase_23 AC 98 ms
87,340 KB
testcase_24 AC 101 ms
86,940 KB
testcase_25 AC 99 ms
87,124 KB
testcase_26 AC 99 ms
86,844 KB
testcase_27 AC 98 ms
87,088 KB
testcase_28 AC 98 ms
87,116 KB
testcase_29 AC 98 ms
87,200 KB
testcase_30 AC 99 ms
86,708 KB
testcase_31 AC 101 ms
87,500 KB
testcase_32 AC 98 ms
87,464 KB
testcase_33 AC 98 ms
87,256 KB
testcase_34 AC 98 ms
87,220 KB
testcase_35 AC 99 ms
87,024 KB
testcase_36 AC 100 ms
86,812 KB
testcase_37 AC 100 ms
87,556 KB
testcase_38 AC 102 ms
87,168 KB
testcase_39 AC 100 ms
87,704 KB
testcase_40 AC 100 ms
87,452 KB
testcase_41 AC 100 ms
86,952 KB
testcase_42 AC 102 ms
86,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def query(i, x, j, y):
    print('?', i, x, j, y, flush=True, end='\r\n')
    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, end='\r\n')

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