結果

問題 No.1959 Prefix MinMax
ユーザー hir355hir355
提出日時 2022-05-27 23:03:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 757 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 93,880 KB
平均クエリ数 97.97
最終ジャッジ日時 2023-10-20 21:24:49
合計ジャッジ時間 7,052 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
72,496 KB
testcase_01 AC 67 ms
72,496 KB
testcase_02 AC 61 ms
72,496 KB
testcase_03 AC 63 ms
72,496 KB
testcase_04 AC 66 ms
72,496 KB
testcase_05 AC 67 ms
72,496 KB
testcase_06 AC 67 ms
72,496 KB
testcase_07 AC 186 ms
93,712 KB
testcase_08 AC 181 ms
93,468 KB
testcase_09 AC 180 ms
93,720 KB
testcase_10 AC 178 ms
93,620 KB
testcase_11 AC 176 ms
93,600 KB
testcase_12 AC 178 ms
93,568 KB
testcase_13 AC 197 ms
93,760 KB
testcase_14 AC 194 ms
93,796 KB
testcase_15 AC 194 ms
93,752 KB
testcase_16 AC 182 ms
93,556 KB
testcase_17 AC 185 ms
93,648 KB
testcase_18 AC 180 ms
93,612 KB
testcase_19 AC 177 ms
93,636 KB
testcase_20 AC 192 ms
93,880 KB
testcase_21 AC 183 ms
93,600 KB
testcase_22 AC 181 ms
93,600 KB
testcase_23 AC 179 ms
93,596 KB
testcase_24 AC 200 ms
93,724 KB
testcase_25 AC 182 ms
93,684 KB
testcase_26 AC 182 ms
93,596 KB
testcase_27 AC 184 ms
93,524 KB
testcase_28 AC 178 ms
93,560 KB
testcase_29 AC 183 ms
93,532 KB
testcase_30 AC 184 ms
93,612 KB
testcase_31 AC 188 ms
93,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from random import randint
t = int(input())
for _ in range(t):
    n = int(input())
    ans = [0] * n
    a = [0] * (n - 1)
    for _ in range(5):
        for i in range(n - 1):
            a[i] = randint(0, 1)
        print('?', *a)
        b = list(map(int, input().split()))
        cnt = 1
        ans[0] = b[0]
        for i in range(n - 1):
            if b[i] != b[i + 1]:
                ans[i + 1] = b[i + 1]
    for _ in range(5):
        for i in range(n - 1):
            if ans[i + 1] == 0:
                a[i] ^= 1
        print('?', *a)
        b = list(map(int, input().split()))
        cnt = 1
        ans[0] = b[0]
        for i in range(n - 1):
            if b[i] != b[i + 1]:
                ans[i + 1] = b[i + 1]
    print('!', *ans)
0