結果

問題 No.2124 Guess the Permutation
ユーザー flippergo
提出日時 2025-03-05 07:50:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 705 ms
コンパイル使用メモリ 82,672 KB
実行使用メモリ 87,968 KB
平均クエリ数 374.60
最終ジャッジ日時 2025-03-05 07:50:07
合計ジャッジ時間 2,740 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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