結果

問題 No.2124 Guess the Permutation
ユーザー vwxyzvwxyz
提出日時 2023-12-19 01:52:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 26,112 KB
平均クエリ数 374.60
最終ジャッジ日時 2023-12-19 01:52:53
合計ジャッジ時間 2,557 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
25,984 KB
testcase_01 AC 48 ms
25,984 KB
testcase_02 AC 48 ms
25,984 KB
testcase_03 AC 50 ms
25,984 KB
testcase_04 AC 50 ms
25,984 KB
testcase_05 AC 52 ms
25,984 KB
testcase_06 AC 71 ms
26,112 KB
testcase_07 AC 89 ms
26,112 KB
testcase_08 AC 97 ms
26,112 KB
testcase_09 AC 91 ms
26,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

N=int(input())
P=[None]*N
print("?",2,N)
P[0]=N*(N+1)//2-int(input())
s=P[0]
for i in range(1,N-1):
    print("?",1,i+1)
    P[i]=int(input())-s
    s+=P[i]
P[N-1]=N*(N+1)//2-sum(P[:-1])
print("!",*P)
0