結果
問題 |
No.2124 Guess the Permutation
|
ユーザー |
![]() |
提出日時 | 2022-11-18 21:44:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 380 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 82,032 KB |
実行使用メモリ | 92,920 KB |
平均クエリ数 | 374.60 |
最終ジャッジ日時 | 2024-09-20 02:06:54 |
合計ジャッジ時間 | 1,984 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 6 WA * 3 |
ソースコード
n = int(input()) s = 0 a = [0] * n b = [0] * n for i in range(n - 1): print('?', 1, i + 2) b[i + 1] = int(input()) for i in range(1, n + 1): a[0] = i b[0] = i for j in range(n - 1): a[j + 1] = b[j + 1] - b[j] if a[j + 1] <= 0 or a[j + 1] > n: break else: if len(set(a)) == n: print('!', *a) break