結果

問題 No.2502 Optimization in the Dark
ユーザー suisensuisen
提出日時 2023-07-22 20:43:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 87,804 KB
平均クエリ数 4.00
最終ジャッジ日時 2023-10-13 20:30:51
合計ジャッジ時間 7,312 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
87,044 KB
testcase_01 AC 100 ms
87,328 KB
testcase_02 AC 101 ms
87,332 KB
testcase_03 AC 103 ms
86,704 KB
testcase_04 AC 103 ms
87,732 KB
testcase_05 AC 101 ms
87,452 KB
testcase_06 AC 102 ms
87,496 KB
testcase_07 AC 98 ms
87,160 KB
testcase_08 AC 100 ms
87,804 KB
testcase_09 AC 100 ms
87,552 KB
testcase_10 AC 100 ms
87,000 KB
testcase_11 AC 100 ms
87,044 KB
testcase_12 AC 99 ms
87,084 KB
testcase_13 AC 98 ms
87,620 KB
testcase_14 AC 101 ms
87,568 KB
testcase_15 AC 99 ms
86,880 KB
testcase_16 AC 99 ms
87,552 KB
testcase_17 AC 100 ms
87,436 KB
testcase_18 AC 101 ms
87,348 KB
testcase_19 AC 99 ms
87,296 KB
testcase_20 AC 100 ms
87,360 KB
testcase_21 AC 98 ms
87,648 KB
testcase_22 AC 100 ms
86,980 KB
testcase_23 AC 98 ms
87,032 KB
testcase_24 AC 99 ms
86,936 KB
testcase_25 AC 98 ms
87,112 KB
testcase_26 AC 98 ms
87,104 KB
testcase_27 AC 98 ms
86,600 KB
testcase_28 AC 98 ms
87,308 KB
testcase_29 AC 100 ms
87,668 KB
testcase_30 AC 100 ms
86,844 KB
testcase_31 AC 98 ms
86,884 KB
testcase_32 AC 99 ms
87,032 KB
testcase_33 AC 99 ms
87,580 KB
testcase_34 AC 98 ms
86,704 KB
testcase_35 AC 98 ms
87,344 KB
testcase_36 AC 99 ms
87,432 KB
testcase_37 AC 98 ms
86,644 KB
testcase_38 AC 99 ms
86,612 KB
testcase_39 AC 98 ms
87,240 KB
testcase_40 AC 100 ms
87,528 KB
testcase_41 AC 99 ms
86,960 KB
testcase_42 AC 100 ms
87,632 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:
        exit(1)

def output_answer(n, i, j, k):
    out = []
    for _ in range(n): out += [i, k]
    for _ in range(n): out += [j, k]
    for _ in range(n): out += [i, j]
    print('!', *out, flush=True)

n = int(input())

if query(1, 2 * n, 2, 2 * n):
    i, j, k = 1, 3, 2
else:
    i, j, k = 2, 3, 1

if query(k, 2 * n, 3, 2 * n):
    j, k = k, j

if query(i, n, j, n):
    i, j = j, i

output_answer(n, i, j, k)
0