結果

問題 No.2124 Guess the Permutation
ユーザー harurunharurun
提出日時 2022-11-18 21:36:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 11,896 KB
実行使用メモリ 26,600 KB
平均クエリ数 374.60
最終ジャッジ日時 2023-10-20 06:23:11
合計ジャッジ時間 2,072 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
26,512 KB
testcase_01 AC 54 ms
26,512 KB
testcase_02 AC 55 ms
26,512 KB
testcase_03 AC 55 ms
26,512 KB
testcase_04 AC 57 ms
26,512 KB
testcase_05 AC 59 ms
26,516 KB
testcase_06 AC 76 ms
26,556 KB
testcase_07 AC 95 ms
26,600 KB
testcase_08 AC 94 ms
26,600 KB
testcase_09 AC 94 ms
26,600 KB
権限があれば一括ダウンロードができます

ソースコード

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