結果
| 問題 |
No.2577 Simple Permutation Guess
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-05 01:16:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 608 bytes |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 85,808 KB |
| 平均クエリ数 | 5.20 |
| 最終ジャッジ日時 | 2024-09-26 23:51:22 |
| 合計ジャッジ時間 | 13,549 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 63 RE * 48 |
ソースコード
n = int(input())
v = 1
for i in range(n):
v *= i + 1
def make(mid):
tmp = [0] * n
used = [False] * n
cur = 0
c = v
for i in range(n):
c /= n - i
for j in range(n):
if used[j]:
continue
if cur + c > mid:
tmp[i] = j + 1
used[j] = True
break
cur += c
return tmp
ok = 0
ng = v
while ok + 1 < ng:
mid = (ok + ng) // 2
print("?", *make(mid), flush=True)
if input() == "1":
ok = mid
else:
ng = mid
print("!", *make(ok), flush=True)