結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-28 16:35:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 82,100 KB |
| 実行使用メモリ | 86,120 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2024-10-05 15:27:27 |
| 合計ジャッジ時間 | 1,675 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 9 |
ソースコード
N = int(input())
base = (N + 1) * N // 2
ans = []
def check(l, r):
print(f"? {l} {r}", flush=True)
ret = int(input())
return ret
first2 = check(2, N)
first = base - first2
for r in range(N - 1, 1, -1):
res = check(1, r)
val = base - res
ans.append(str(val))
base = res
ans.append(str(first))
result = ' '.join(ans[::-1])
print(f"! {result}")