結果

問題 No.1959 Prefix MinMax
ユーザー ああいいああいい
提出日時 2022-05-28 17:50:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 706 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 92,552 KB
平均クエリ数 26.72
最終ジャッジ日時 2023-10-20 23:28:28
合計ジャッジ時間 6,879 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
69,916 KB
testcase_01 AC 64 ms
69,916 KB
testcase_02 AC 63 ms
69,916 KB
testcase_03 AC 64 ms
69,916 KB
testcase_04 AC 64 ms
69,916 KB
testcase_05 AC 64 ms
69,916 KB
testcase_06 AC 65 ms
69,916 KB
testcase_07 AC 126 ms
92,544 KB
testcase_08 AC 114 ms
92,544 KB
testcase_09 AC 116 ms
92,544 KB
testcase_10 AC 113 ms
92,544 KB
testcase_11 AC 114 ms
92,544 KB
testcase_12 AC 114 ms
92,544 KB
testcase_13 AC 124 ms
92,544 KB
testcase_14 AC 123 ms
92,544 KB
testcase_15 AC 125 ms
92,544 KB
testcase_16 AC 115 ms
92,544 KB
testcase_17 AC 115 ms
92,544 KB
testcase_18 AC 118 ms
92,544 KB
testcase_19 AC 116 ms
92,544 KB
testcase_20 AC 126 ms
92,544 KB
testcase_21 AC 114 ms
92,544 KB
testcase_22 AC 118 ms
92,544 KB
testcase_23 AC 117 ms
92,544 KB
testcase_24 AC 127 ms
92,544 KB
testcase_25 AC 117 ms
92,544 KB
testcase_26 AC 118 ms
92,544 KB
testcase_27 AC 116 ms
92,544 KB
testcase_28 AC 115 ms
92,544 KB
testcase_29 AC 115 ms
92,544 KB
testcase_30 AC 116 ms
92,544 KB
testcase_31 AC 116 ms
92,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

def calc(N):
    now = 0
    ans = [0] * N
    print("?",end = " ")
    for _ in range(N-1):
        print(now,end = " ")
        now ^= 1
    print()
    B = list(map(int,input().split()))
    ans[0] = B[0]
    for i in range(1,N):
        if B[i-1] != B[i]:
            ans[i] = B[i]
    now = 1
    print("?",end = " ")
    for _ in range(N - 1):
        print(now,end = " ")
        now ^= 1
    print()
    B = list(map(int,input().split()))
    for i in range(1,N):
        if B[i-1] != B[i]:
            ans[i] = B[i]
    print("!",*ans)
for _ in range(T):
    N = int(input())
    calc(N)
0