結果

問題 No.2124 Guess the Permutation
ユーザー roarisroaris
提出日時 2022-11-18 22:58:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 276 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 81,852 KB
実行使用メモリ 82,168 KB
平均クエリ数 374.60
最終ジャッジ日時 2023-10-20 07:57:17
合計ジャッジ時間 2,281 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
69,828 KB
testcase_01 AC 58 ms
69,828 KB
testcase_02 AC 61 ms
69,828 KB
testcase_03 AC 59 ms
69,828 KB
testcase_04 AC 60 ms
69,828 KB
testcase_05 AC 63 ms
69,828 KB
testcase_06 AC 91 ms
77,420 KB
testcase_07 AC 121 ms
82,168 KB
testcase_08 AC 120 ms
82,168 KB
testcase_09 AC 121 ms
82,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N = int(input())
ans = [0]*N

print(f'? 2 {N}')
res = int(input())
ans[0] = N*(N+1)//2-res

for i in range(N-2):
    print(f'? {1+i} {2+i}')
    res = int(input())
    ans[1+i] = res-ans[i]

ans[-1] = N*(N+1)//2-sum(ans)
s = ' '.join(map(str, ans))
print(f'! {s}')
0