結果

問題 No.1959 Prefix MinMax
ユーザー 👑 rin204rin204
提出日時 2022-05-27 22:06:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 93,100 KB
平均クエリ数 26.72
最終ジャッジ日時 2023-10-20 20:50:03
合計ジャッジ時間 5,388 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
70,560 KB
testcase_01 AC 66 ms
72,608 KB
testcase_02 AC 64 ms
70,560 KB
testcase_03 AC 65 ms
70,560 KB
testcase_04 AC 65 ms
72,608 KB
testcase_05 AC 66 ms
72,608 KB
testcase_06 AC 66 ms
72,608 KB
testcase_07 AC 100 ms
93,068 KB
testcase_08 AC 100 ms
93,060 KB
testcase_09 AC 100 ms
93,096 KB
testcase_10 AC 99 ms
93,052 KB
testcase_11 AC 100 ms
93,084 KB
testcase_12 AC 100 ms
93,096 KB
testcase_13 AC 100 ms
93,052 KB
testcase_14 AC 101 ms
93,056 KB
testcase_15 AC 101 ms
93,100 KB
testcase_16 AC 101 ms
93,084 KB
testcase_17 AC 101 ms
93,068 KB
testcase_18 AC 101 ms
93,100 KB
testcase_19 AC 100 ms
93,064 KB
testcase_20 AC 102 ms
93,100 KB
testcase_21 AC 101 ms
93,088 KB
testcase_22 AC 100 ms
93,000 KB
testcase_23 AC 101 ms
93,008 KB
testcase_24 AC 101 ms
93,080 KB
testcase_25 AC 101 ms
93,084 KB
testcase_26 AC 102 ms
93,068 KB
testcase_27 AC 102 ms
93,040 KB
testcase_28 AC 102 ms
93,028 KB
testcase_29 AC 101 ms
93,040 KB
testcase_30 AC 102 ms
93,020 KB
testcase_31 AC 101 ms
93,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import random



def solve():
    n = int(input())
    A = [i & 1 for i in range(n - 1)]
    print("?", *A, flush=True)
    B1 = list(map(int, input().split()))
    A = [(i & 1) ^ 1 for i in range(n - 1)]
    print("?", *A, flush=True)
    B2 = list(map(int, input().split()))
    P = [-1] * n
    used = [False] * (n + 1)
    for i in range(n):
        if not used[B1[i]]:
            P[i] = B1[i]
        else:
            P[i] = B2[i]
        used[P[i]] = True
    print("!", *P, flush=True)



for _ in range(int(input())):
    solve()
0