結果

問題 No.1959 Prefix MinMax
ユーザー mkawa2mkawa2
提出日時 2023-12-16 11:38:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 26,376 KB
平均クエリ数 97.97
最終ジャッジ日時 2023-12-16 11:38:58
合計ジャッジ時間 7,443 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
26,112 KB
testcase_01 AC 53 ms
26,112 KB
testcase_02 AC 50 ms
26,112 KB
testcase_03 AC 52 ms
26,112 KB
testcase_04 AC 53 ms
26,112 KB
testcase_05 AC 54 ms
26,112 KB
testcase_06 AC 54 ms
26,112 KB
testcase_07 AC 160 ms
26,368 KB
testcase_08 AC 163 ms
26,368 KB
testcase_09 AC 160 ms
26,368 KB
testcase_10 AC 161 ms
26,368 KB
testcase_11 AC 161 ms
26,368 KB
testcase_12 AC 158 ms
26,368 KB
testcase_13 AC 159 ms
26,368 KB
testcase_14 AC 163 ms
26,368 KB
testcase_15 AC 159 ms
26,368 KB
testcase_16 AC 158 ms
26,368 KB
testcase_17 AC 158 ms
26,368 KB
testcase_18 AC 162 ms
26,368 KB
testcase_19 AC 160 ms
26,368 KB
testcase_20 AC 163 ms
26,368 KB
testcase_21 AC 158 ms
26,368 KB
testcase_22 AC 159 ms
26,368 KB
testcase_23 AC 159 ms
26,368 KB
testcase_24 AC 158 ms
26,368 KB
testcase_25 AC 162 ms
26,368 KB
testcase_26 AC 164 ms
26,368 KB
testcase_27 AC 157 ms
26,368 KB
testcase_28 AC 161 ms
26,368 KB
testcase_29 AC 162 ms
26,368 KB
testcase_30 AC 161 ms
26,368 KB
testcase_31 AC 158 ms
26,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n=int(input())
    ans=[0]*n
    pre=[i&1 for i in range(n-1)]
    for _ in range(10):
        a=[0]*(n-1)
        for i in range(n-1):
            if ans[i+1]:
                a[i]=pre[i]
            elif ans[i]:
                a[i]=pre[i]^1
            elif i:
                a[i]=a[i-1]^1
            else:
                a[i]=1
        print("?",*a,flush=True)
        b=list(map(int,input().split()))
        for i in range(n):
            if ans[i]:continue
            if i==0 or b[i]!=b[i-1]:ans[i]=b[i]
        pre=a
    print("!",*ans,flush=True)

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