結果

問題 No.2124 Guess the Permutation
ユーザー hir355hir355
提出日時 2022-11-18 21:44:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 92,232 KB
平均クエリ数 374.60
最終ジャッジ日時 2023-10-20 06:30:15
合計ジャッジ時間 2,302 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 59 ms
69,908 KB
testcase_02 AC 62 ms
69,908 KB
testcase_03 AC 61 ms
69,908 KB
testcase_04 WA -
testcase_05 AC 68 ms
69,908 KB
testcase_06 AC 117 ms
92,048 KB
testcase_07 WA -
testcase_08 AC 132 ms
86,724 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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
0