結果
| 問題 | No.2502 Optimization in the Dark |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-22 20:43:57 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 189 ms / 2,000 ms |
| + 2µs | |
| コード長 | 606 bytes |
| 記録 | |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 96,056 KB |
| 実行使用メモリ | 78,848 KB |
| 平均クエリ数 | 4.00 |
| 最終ジャッジ日時 | 2026-08-28 03:17:53 |
| 合計ジャッジ時間 | 5,466 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 43 |
ソースコード
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)