結果

問題 No.1959 Prefix MinMax
ユーザー titiatitia
提出日時 2022-05-28 01:40:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 699 ms
コンパイル使用メモリ 11,888 KB
実行使用メモリ 26,620 KB
平均クエリ数 26.72
最終ジャッジ日時 2023-10-20 22:14:38
合計ジャッジ時間 5,441 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
26,260 KB
testcase_01 AC 51 ms
26,260 KB
testcase_02 AC 50 ms
26,260 KB
testcase_03 AC 51 ms
26,260 KB
testcase_04 AC 50 ms
26,260 KB
testcase_05 AC 52 ms
26,260 KB
testcase_06 AC 52 ms
26,260 KB
testcase_07 AC 84 ms
26,576 KB
testcase_08 AC 85 ms
26,568 KB
testcase_09 AC 85 ms
26,564 KB
testcase_10 AC 86 ms
26,568 KB
testcase_11 AC 85 ms
26,556 KB
testcase_12 AC 86 ms
26,548 KB
testcase_13 AC 84 ms
26,592 KB
testcase_14 AC 85 ms
26,552 KB
testcase_15 AC 84 ms
26,572 KB
testcase_16 AC 83 ms
26,572 KB
testcase_17 AC 84 ms
26,568 KB
testcase_18 AC 83 ms
26,576 KB
testcase_19 AC 84 ms
26,568 KB
testcase_20 AC 82 ms
26,552 KB
testcase_21 AC 84 ms
26,572 KB
testcase_22 AC 84 ms
26,560 KB
testcase_23 AC 85 ms
26,568 KB
testcase_24 AC 84 ms
26,576 KB
testcase_25 AC 84 ms
26,576 KB
testcase_26 AC 84 ms
26,580 KB
testcase_27 AC 83 ms
26,568 KB
testcase_28 AC 83 ms
26,588 KB
testcase_29 AC 85 ms
26,564 KB
testcase_30 AC 84 ms
26,620 KB
testcase_31 AC 84 ms
26,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for tests in range(T):
    N=int(input())

    A=[0]*(N-1)
    for i in range(N-1):
        if i%2==1:
            A[i]=1

    print("?",*A,flush=True)
    B=list(map(int,input().split()))

    A=[1]*(N-1)
    for i in range(N-1):
        if i%2==1:
            A[i]=0

    print("?",*A,flush=True)
    C=list(map(int,input().split()))

    ANS=[0]*N

    ANS[0]=B[0]

    for i in range(1,N):
        if B[i]!=B[i-1]:
            ANS[i]=B[i]
        if C[i]!=C[i-1]:
            ANS[i]=C[i]

    print("!",*ANS,flush=True)

    

    
0