結果

問題 No.1959 Prefix MinMax
ユーザー tktk_snsntktk_snsn
提出日時 2022-05-28 02:35:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 796 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 12,012 KB
実行使用メモリ 62,988 KB
最終ジャッジ日時 2023-10-20 22:26:12
合計ジャッジ時間 7,061 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
write = sys.stdout.write
sys.setrecursionlimit(10 ** 7)


def query(A):
    write("? {}\n".format(" ".join(str(x) for x in A)))
    B = list(map(int, input().split()))
    return B


def answer(A):
    write("! {}\n".format(" ".join(str(x) for x in A)))


def solve():
    N = int(input())

    sgn = 0
    P = [-1] * N
    fix = [-1] * N
    for _ in range(10):
        A = [sgn] * N
        for i in range(N):
            if fix[i] != -1:
                A[i] = fix[i]

        B = query(A[1:])
        P[0] = B[0]
        for i in range(1, N):
            if B[i] != B[i-1]:
                P[i] = B[i]
                if fix[i] == -1:
                    fix[i] = sgn
        sgn = 1 - sgn

    answer(P)


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