結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2022-10-20 16:21:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 127 ms / 2,000 ms |
| コード長 | 250 bytes |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 82,856 KB |
| 実行使用メモリ | 87,848 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2024-06-30 08:52:58 |
| 合計ジャッジ時間 | 2,284 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()
とりゐ