結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-18 21:33:35 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 75 ms / 2,000 ms |
| コード長 | 262 bytes |
| 記録 | |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 85,320 KB |
| 実行使用メモリ | 90,240 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2026-04-08 14:30:07 |
| 合計ジャッジ時間 | 1,906 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
n = int(input())
ans = [-1]*n
now = n*(n+1)//2
for i in range(1,n-1):
print("?",i+1,n)
tmp = int(input())
ans[i-1] = now - tmp
now = tmp
print("?", 1, n-1)
tmp = int(input())
ans[-1] = n*(n+1)//2 - tmp
ans[-2] = n*(n+1)//2 - sum(ans) - 1
print("!",*ans)