結果

問題 No.2124 Guess the Permutation
ユーザー gr1msl3ygr1msl3y
提出日時 2022-11-25 23:43:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 88,080 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-04-10 04:43:39
合計ジャッジ時間 2,180 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
68,600 KB
testcase_01 AC 55 ms
69,416 KB
testcase_02 AC 56 ms
69,016 KB
testcase_03 AC 56 ms
68,724 KB
testcase_04 AC 58 ms
69,840 KB
testcase_05 AC 62 ms
70,240 KB
testcase_06 AC 100 ms
82,416 KB
testcase_07 AC 129 ms
86,992 KB
testcase_08 AC 129 ms
88,080 KB
testcase_09 AC 128 ms
87,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = [0]*N
S = N*(N+1)//2
t = S
print('?', 1, N-1, flush=True)
ans[-1] = S-int(input())
for i in range(N-2):
    print('?', i+2, N, flush=True)
    ans[i] = S-int(input())
    S -= ans[i]
ans[-2] = S-ans[-1]
print('!', *ans, flush=True)
0