結果

問題 No.2124 Guess the Permutation
ユーザー vwxyz
提出日時 2023-12-19 01:52:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,480 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-09-27 08:35:11
合計ジャッジ時間 1,664 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

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