結果
問題 |
No.2124 Guess the Permutation
|
ユーザー |
|
提出日時 | 2022-11-28 16:26:08 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 373 bytes |
コンパイル時間 | 263 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 83,928 KB |
平均クエリ数 | 374.60 |
最終ジャッジ日時 | 2024-10-05 15:12:21 |
合計ジャッジ時間 | 2,585 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 first = check(2, N) first = base - first 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("! {result}")