結果

問題 No.1741 Arrays and XOR Procedure
ユーザー ああいいああいい
提出日時 2021-12-08 12:42:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 687 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 24,580 KB
最終ジャッジ日時 2023-09-23 04:52:54
合計ジャッジ時間 7,699 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,828 KB
testcase_01 AC 16 ms
8,116 KB
testcase_02 AC 16 ms
7,752 KB
testcase_03 AC 225 ms
24,580 KB
testcase_04 AC 16 ms
7,748 KB
testcase_05 AC 151 ms
11,508 KB
testcase_06 AC 198 ms
18,308 KB
testcase_07 AC 193 ms
18,336 KB
testcase_08 AC 147 ms
11,496 KB
testcase_09 AC 156 ms
14,596 KB
testcase_10 AC 169 ms
14,948 KB
testcase_11 AC 132 ms
13,684 KB
testcase_12 AC 107 ms
12,392 KB
testcase_13 AC 157 ms
14,464 KB
testcase_14 AC 119 ms
12,952 KB
testcase_15 AC 142 ms
14,148 KB
testcase_16 AC 24 ms
8,624 KB
testcase_17 AC 66 ms
10,500 KB
testcase_18 AC 127 ms
13,120 KB
testcase_19 AC 23 ms
8,420 KB
testcase_20 AC 176 ms
16,140 KB
testcase_21 AC 136 ms
13,864 KB
testcase_22 AC 128 ms
13,496 KB
testcase_23 AC 60 ms
10,340 KB
testcase_24 AC 27 ms
8,652 KB
testcase_25 AC 171 ms
15,804 KB
testcase_26 AC 82 ms
11,220 KB
testcase_27 AC 22 ms
8,584 KB
testcase_28 AC 133 ms
13,800 KB
testcase_29 AC 148 ms
14,204 KB
testcase_30 AC 128 ms
13,724 KB
testcase_31 WA -
testcase_32 AC 82 ms
11,184 KB
testcase_33 AC 100 ms
12,200 KB
testcase_34 AC 48 ms
9,668 KB
testcase_35 WA -
testcase_36 AC 29 ms
8,920 KB
testcase_37 AC 79 ms
10,960 KB
testcase_38 AC 172 ms
15,808 KB
testcase_39 AC 75 ms
10,800 KB
testcase_40 AC 18 ms
8,192 KB
testcase_41 AC 45 ms
9,324 KB
testcase_42 AC 23 ms
8,504 KB
testcase_43 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
B = list(map(int,input().split()))
P = 998244353

power = [0] * N
i = 2
while i < N:
    for j in range(1,(N-1)//i + 1):
        power[i*j] += 1
    i *= 2
now = 0
count1 = 0
count2 = 0
S = 0
if B[0] == -1:
    count1 += 1
else:
    S += B[0]
if B[N-1] == -1:
    count1 += 1
else:
    S += B[0]
    
for i in range(1,N-1):
    now = now + power[N-i] - power[i]
    if now > 0:
        if B[i] == -1:count2 += 1
    else:
        if B[i] == -1:count1 += 1
        else:S += B[i]
if count1 == 0 and S % 2 == 0:
    print(0)
    exit()
if count1 == 0:u = count2
else:u = count1 + count2 -1

u = count1 + count2 - 1
t = 1
for _ in range(u):
    t *= 2
    t %= P
print(t)
0