結果

問題 No.2124 Guess the Permutation
ユーザー syunsukesyunsuke
提出日時 2022-11-26 16:18:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 82,280 KB
実行使用メモリ 87,144 KB
平均クエリ数 374.60
最終ジャッジ日時 2024-04-14 03:16:37
合計ジャッジ時間 2,837 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
68,832 KB
testcase_01 AC 68 ms
68,608 KB
testcase_02 AC 70 ms
68,948 KB
testcase_03 AC 70 ms
68,740 KB
testcase_04 AC 74 ms
69,088 KB
testcase_05 AC 76 ms
69,720 KB
testcase_06 AC 116 ms
82,068 KB
testcase_07 AC 146 ms
86,952 KB
testcase_08 AC 145 ms
85,984 KB
testcase_09 AC 133 ms
87,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

L = ["!"]
S = (1+N)*(N)//2
print("?",2,N,flush=True)
a = int(input())
L.append(S-a)
R = L[-1]
for i in range(N-2):
    print("?",1,2+i,flush=True)
    s = int(input())
    L.append(s-R)
    R += L[-1]

L.append(S-R)
print(*L)
0