結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,880 KB
testcase_01 AC 16 ms
8,296 KB
testcase_02 AC 16 ms
7,744 KB
testcase_03 AC 232 ms
24,576 KB
testcase_04 AC 16 ms
7,752 KB
testcase_05 AC 150 ms
11,396 KB
testcase_06 AC 202 ms
18,336 KB
testcase_07 AC 194 ms
18,428 KB
testcase_08 AC 155 ms
11,348 KB
testcase_09 AC 161 ms
14,616 KB
testcase_10 AC 160 ms
14,996 KB
testcase_11 AC 129 ms
13,620 KB
testcase_12 AC 103 ms
12,412 KB
testcase_13 AC 158 ms
14,560 KB
testcase_14 AC 113 ms
12,944 KB
testcase_15 AC 148 ms
14,248 KB
testcase_16 AC 24 ms
8,568 KB
testcase_17 AC 66 ms
10,576 KB
testcase_18 AC 121 ms
12,940 KB
testcase_19 AC 22 ms
8,560 KB
testcase_20 AC 166 ms
16,004 KB
testcase_21 AC 137 ms
13,780 KB
testcase_22 AC 128 ms
13,492 KB
testcase_23 AC 60 ms
10,368 KB
testcase_24 AC 27 ms
8,672 KB
testcase_25 AC 173 ms
15,736 KB
testcase_26 AC 82 ms
11,104 KB
testcase_27 AC 22 ms
8,604 KB
testcase_28 AC 137 ms
13,736 KB
testcase_29 AC 150 ms
14,160 KB
testcase_30 AC 135 ms
13,656 KB
testcase_31 AC 22 ms
8,456 KB
testcase_32 AC 83 ms
11,120 KB
testcase_33 AC 99 ms
12,064 KB
testcase_34 AC 47 ms
9,624 KB
testcase_35 WA -
testcase_36 AC 30 ms
8,792 KB
testcase_37 AC 78 ms
11,092 KB
testcase_38 AC 167 ms
15,732 KB
testcase_39 AC 73 ms
10,700 KB
testcase_40 AC 18 ms
8,392 KB
testcase_41 AC 46 ms
9,480 KB
testcase_42 AC 23 ms
8,596 KB
testcase_43 AC 15 ms
7,760 KB
権限があれば一括ダウンロードができます

ソースコード

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[N-1]
    
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