結果

問題 No.2124 Guess the Permutation
ユーザー ああいいああいい
提出日時 2022-11-29 13:17:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 86,016 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-04-16 08:39:44
合計ジャッジ時間 2,039 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
68,320 KB
testcase_01 AC 63 ms
68,184 KB
testcase_02 AC 64 ms
68,568 KB
testcase_03 AC 64 ms
68,568 KB
testcase_04 AC 66 ms
68,696 KB
testcase_05 AC 71 ms
69,464 KB
testcase_06 AC 117 ms
81,624 KB
testcase_07 AC 138 ms
85,848 KB
testcase_08 AC 144 ms
85,852 KB
testcase_09 AC 135 ms
86,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

now = N * (N + 1) / 2
ans = []
for i in range(N - 1,1,-1):
    l = 1
    r = i
    print("?",l,r)
    S = int(input())
    t = now - S
    ans.append(int(t))
    now -= t
print("?",2,N)
S = int(input())
one = N * (N + 1) // 2 - S
ans.append(int(now - one))
ans.append(one)
print("!",*reversed(ans))
0