結果

問題 No.2124 Guess the Permutation
ユーザー takumiytakumiy
提出日時 2022-11-28 17:35:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,864 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-04-15 16:34:14
合計ジャッジ時間 1,622 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 53 ms
27,480 KB
testcase_02 AC 54 ms
27,352 KB
testcase_03 AC 52 ms
27,512 KB
testcase_04 WA -
testcase_05 AC 56 ms
27,224 KB
testcase_06 AC 75 ms
27,480 KB
testcase_07 WA -
testcase_08 AC 97 ms
27,224 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

print('?', 1, 2)
prev = int(input())
ans = []
used = [False] * (N + 1)
l = 1
for r in range(3, N + 1):
    print('?', l, r)
    S = int(input())
    ans.append(S - prev)
    used[S - prev] = True
    prev = S
    
first = []
for i in range(1, N + 1):
    if not used[i]:
        first.append(i)
        
print('!', *first, *ans)
0