結果
問題 | No.2124 Guess the Permutation |
ユーザー |
![]() |
提出日時 | 2022-11-18 21:39:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 352 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 81,904 KB |
実行使用メモリ | 88,408 KB |
平均クエリ数 | 374.80 |
最終ジャッジ日時 | 2024-09-20 02:03:31 |
合計ジャッジ時間 | 1,867 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 WA * 1 |
ソースコード
n = int(input()) s = 0 a = [0] * n b = [0] * (n - 1) for i in range(n - 1): print('?', i + 1, i + 2) b[i] = int(input()) for i in range(1, n + 1): a[0] = i for j in range(n - 1): a[j + 1] = b[j] - a[j] if a[j + 1] <= 0 or a[j + 1] > n: break else: if len(set(a)) == n: print('!', *a)