結果

問題 No.2124 Guess the Permutation
ユーザー harurunharurun
提出日時 2022-11-18 21:36:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 27,464 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-09-20 02:00:47
合計ジャッジ時間 1,532 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  N=int(input())
  T=N*(N+1)//2
  P=[]
  for i in range(1,N-1):
    print(f"? {i+1} {N}")
    S=int(input())
    P.append(T-S)
    T-=T-S
  print(f"? {1} {N-1}")
  S=int(input())
  U=N*(N+1)//2-S
  P.append(T-U)
  P.append(U)
  print("! ",end="")
  print(" ".join(map(str,P)))
  return

main()

  
0