結果

問題 No.1741 Arrays and XOR Procedure
ユーザー rlangevinrlangevin
提出日時 2023-07-06 12:27:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 104,612 KB
最終ジャッジ日時 2023-09-27 13:39:23
合計ジャッジ時間 9,062 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,016 KB
testcase_01 AC 63 ms
70,816 KB
testcase_02 AC 64 ms
71,000 KB
testcase_03 AC 106 ms
104,544 KB
testcase_04 AC 66 ms
71,148 KB
testcase_05 AC 98 ms
104,392 KB
testcase_06 AC 103 ms
104,612 KB
testcase_07 AC 105 ms
104,472 KB
testcase_08 AC 100 ms
104,456 KB
testcase_09 AC 98 ms
100,888 KB
testcase_10 AC 98 ms
100,952 KB
testcase_11 AC 96 ms
95,228 KB
testcase_12 AC 89 ms
90,836 KB
testcase_13 AC 101 ms
101,000 KB
testcase_14 AC 93 ms
92,828 KB
testcase_15 AC 96 ms
97,904 KB
testcase_16 AC 72 ms
76,356 KB
testcase_17 AC 82 ms
83,176 KB
testcase_18 AC 91 ms
92,896 KB
testcase_19 AC 69 ms
76,420 KB
testcase_20 AC 103 ms
104,532 KB
testcase_21 AC 98 ms
97,784 KB
testcase_22 AC 90 ms
95,484 KB
testcase_23 AC 77 ms
81,968 KB
testcase_24 AC 70 ms
76,076 KB
testcase_25 AC 105 ms
104,260 KB
testcase_26 AC 83 ms
85,860 KB
testcase_27 AC 71 ms
76,244 KB
testcase_28 AC 92 ms
95,388 KB
testcase_29 AC 98 ms
97,920 KB
testcase_30 AC 93 ms
95,544 KB
testcase_31 AC 71 ms
76,144 KB
testcase_32 AC 81 ms
86,084 KB
testcase_33 AC 84 ms
88,940 KB
testcase_34 AC 74 ms
79,772 KB
testcase_35 AC 66 ms
71,056 KB
testcase_36 AC 71 ms
76,260 KB
testcase_37 AC 81 ms
85,836 KB
testcase_38 AC 109 ms
104,464 KB
testcase_39 AC 83 ms
84,268 KB
testcase_40 AC 73 ms
76,224 KB
testcase_41 AC 78 ms
78,920 KB
testcase_42 AC 74 ms
76,340 KB
testcase_43 AC 64 ms
70,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
B = list(map(int, input().split()))
mod = 998244353
odd, even, zero_or_one = 0, 0, 0
for i in range(N):
    if (N - 1) & i == i:
        if B[i] == -1:
            odd += 1
        elif B[i] == 1:
            zero_or_one ^= 1
    else:
        if B[i] == -1:
            even += 1

if odd:
    print(pow(2, even + odd - 1, mod))
else:
    if zero_or_one:
        print(pow(2, even, mod))
    else:
        print(0)
0