結果

問題 No.2124 Guess the Permutation
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-16 19:22:43
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 674 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 95,068 KB
平均クエリ数 2.00
最終ジャッジ日時 2023-08-21 08:12:22
合計ジャッジ時間 3,731 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n=int(input())
ans = [0]*n
print(f'? {1} {2}',flush=True)
t = int(input())
print(f'? {2} {3}',flush=True)
t2 = int(input())
    
for i in range(1,n+1):
    f = 0
    for j in range(1,n+1):
        if i == j:
            continue
        x = (t + t2) - (i + j)
        if x > 0 and x%2==0:
            y=x//2
            if y+i == t and y + j == t2:
                ans[0] = i
                ans[2] = j
                ans[1] = y
                f = 1
                break
    if f == 1:
        break
                
assert 1!=1,ans
ind = 3
while n > ind:
    print(f'? {ind-1} {ind}')
    t=int(input())
    ans[ind] = t - ans[ind-1]
    ind += 1
    

print('!',*ans)

0