結果

問題 No.2124 Guess the Permutation
ユーザー KudeKude
提出日時 2022-11-18 21:26:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 305 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 11,952 KB
実行使用メモリ 38,536 KB
最終ジャッジ日時 2023-10-20 06:14:12
合計ジャッジ時間 6,516 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
input = stdin.buffer.read

def ask(x):
    print(f'? 1 {x + 1}')
    return int(input())

def answer(d):
    print('!', *d)

n = int(input())
ans = []
sm = 0
for i in range(n - 1):
    x = ask(i) - sm
    ans.append(x)
    sm += x

x = n * (n + 1) // 2 - sm
ans.append(x)
answer(ans)
0