結果
問題 | No.2124 Guess the Permutation |
ユーザー |
![]() |
提出日時 | 2022-11-18 21:32:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 95 ms / 2,000 ms |
コード長 | 256 bytes |
コンパイル時間 | 85 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 27,608 KB |
平均クエリ数 | 374.60 |
最終ジャッジ日時 | 2024-09-20 01:56:24 |
合計ジャッジ時間 | 1,682 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
def ask(l, r):print("?", l+1, r, flush=True)return int(input())n = int(input())ans = [0]*ns = n*(n+1)//2ans[-1] = s-ask(0, n-1)for i in range(n-2):ans[i] = s-ask(i+1, n)s -= ans[i]ans[-2] = n*(n+1)//2-sum(ans)print("!", *ans)