結果
| 問題 | 
                            No.2124 Guess the Permutation
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-03-02 21:13:55 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 127 ms / 2,000 ms | 
| コード長 | 305 bytes | 
| コンパイル時間 | 385 ms | 
| コンパイル使用メモリ | 82,280 KB | 
| 実行使用メモリ | 88,380 KB | 
| 平均クエリ数 | 374.60 | 
| 最終ジャッジ日時 | 2025-03-02 21:13:58 | 
| 合計ジャッジ時間 | 2,503 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 | 
ソースコード
n=int(input())
tot=(1+n)*n//2
res=[0]*(n+1)
for i in range(2,n):
    print("?",i,n,flush=True)
    x=int(input())
    res[i-1]=tot-x
    tot-=res[i-1]
print("?",1,n-1,flush=True)
x=int(input())
x=(1+n)*n//2-x
res[n]=x
tot-=x
res[n-1]=tot
res=["!"]+[str(i) for i in res[1:]]
print(" ".join(res))