結果

問題 No.2124 Guess the Permutation
ユーザー とりゐとりゐ
提出日時 2022-10-20 16:18:36
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 200 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 94,240 KB
平均クエリ数 373.60
最終ジャッジ日時 2024-06-30 09:02:56
合計ジャッジ時間 2,298 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

def ask(l,r):
  print('?',l+1,r+1,flush=True)
  return int(input())

n=int(input())
ans=[0]*n
sm=n*(n+1)//2
for i in range(n-1):
  m=ask(i+1,n-1)
  ans[i]=sm-m
  sm=m
ans[-1]=sm
print('!',*ans)
exit()
0