結果

問題 No.2124 Guess the Permutation
ユーザー ytftytft
提出日時 2022-11-24 18:01:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 82,484 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-04-08 15:18:14
合計ジャッジ時間 2,071 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
69,468 KB
testcase_01 AC 60 ms
69,460 KB
testcase_02 AC 61 ms
69,460 KB
testcase_03 AC 61 ms
69,460 KB
testcase_04 AC 65 ms
69,460 KB
testcase_05 AC 66 ms
69,460 KB
testcase_06 AC 101 ms
80,416 KB
testcase_07 AC 123 ms
82,484 KB
testcase_08 AC 122 ms
82,484 KB
testcase_09 AC 123 ms
82,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
A=[0 for i in range(N)]
for i in range(1,N-1):
	print('?',1,i+1,flush=True)
	A[i]=int(input())
print('?',2,N,flush=True)
A[0]=N*(N+1)//2-int(input())
A[N-1]=N*(N+1)//2
for i in range(N-1,0,-1):
	A[i]-=A[i-1]
print('!',*A)
0