結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-11-18 21:30:23 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 123 ms / 2,000 ms |
| コード長 | 320 bytes |
| 記録 | |
| コンパイル時間 | 640 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 35,340 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2026-04-08 14:27:11 |
| 合計ジャッジ時間 | 3,110 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
import sys
input = sys.stdin.readline
N=int(input())
SUM=(N+1)*N//2
ANS=[0]*N
NOW=SUM
for i in range(N-2):
print("?",i+2,N,flush=True)
x=int(input())
ANS[i]=NOW-x
NOW-=ANS[i]
print("?",N-2,N-1,flush=True)
x=int(input())
ANS[-2]=x-ANS[-3]
ANS[-1]=SUM-sum(ANS)
print("!",*ANS,flush=True)
titia