結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2022-10-20 16:21:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 75 ms / 2,000 ms |
| コード長 | 250 bytes |
| 記録 | |
| コンパイル時間 | 310 ms |
| コンパイル使用メモリ | 85,184 KB |
| 実行使用メモリ | 90,156 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2026-03-20 04:46:18 |
| 合計ジャッジ時間 | 2,145 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
def ask(l,r):
print('?',l+1,r+1,flush=True)
return int(input())
n=int(input())
ans=[0]*n
sm=n*(n+1)//2
for i in range(n-2):
m=ask(i+1,n-1)
ans[i]=sm-m
sm=m
m=ask(0,n-2)
ans[-2]=m-sum(ans)
ans[-1]=n*(n+1)//2-sum(ans)
print('!',*ans)
exit()
とりゐ