結果
問題 | No.2124 Guess the Permutation |
ユーザー | hir355 |
提出日時 | 2022-11-18 21:39:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 352 bytes |
コンパイル時間 | 1,227 ms |
コンパイル使用メモリ | 81,732 KB |
実行使用メモリ | 170,848 KB |
平均クエリ数 | 374.80 |
最終ジャッジ日時 | 2023-10-20 06:26:13 |
合計ジャッジ時間 | 2,342 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 63 ms
69,840 KB |
testcase_01 | AC | 58 ms
69,840 KB |
testcase_02 | AC | 58 ms
69,840 KB |
testcase_03 | AC | 59 ms
69,840 KB |
testcase_04 | AC | 62 ms
69,840 KB |
testcase_05 | AC | 66 ms
69,840 KB |
testcase_06 | AC | 105 ms
82,940 KB |
testcase_07 | AC | 134 ms
89,096 KB |
testcase_08 | AC | 131 ms
89,004 KB |
testcase_09 | WA | - |
ソースコード
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)