結果

問題 No.1741 Arrays and XOR Procedure
ユーザー rlangevinrlangevin
提出日時 2023-07-06 12:42:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 24,552 KB
最終ジャッジ日時 2023-09-27 13:54:42
合計ジャッジ時間 5,228 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 16 ms
7,764 KB
testcase_02 AC 16 ms
7,748 KB
testcase_03 AC 129 ms
24,552 KB
testcase_04 AC 16 ms
7,808 KB
testcase_05 AC 99 ms
12,024 KB
testcase_06 AC 117 ms
18,172 KB
testcase_07 AC 117 ms
18,180 KB
testcase_08 AC 101 ms
12,200 KB
testcase_09 AC 101 ms
14,644 KB
testcase_10 AC 110 ms
14,712 KB
testcase_11 AC 88 ms
14,024 KB
testcase_12 AC 70 ms
12,328 KB
testcase_13 AC 99 ms
14,556 KB
testcase_14 AC 81 ms
12,924 KB
testcase_15 AC 93 ms
14,648 KB
testcase_16 AC 21 ms
8,420 KB
testcase_17 AC 44 ms
10,488 KB
testcase_18 AC 81 ms
13,644 KB
testcase_19 AC 20 ms
8,536 KB
testcase_20 AC 111 ms
15,936 KB
testcase_21 AC 88 ms
14,336 KB
testcase_22 AC 82 ms
13,844 KB
testcase_23 AC 42 ms
10,104 KB
testcase_24 AC 22 ms
8,632 KB
testcase_25 AC 108 ms
15,944 KB
testcase_26 AC 55 ms
11,356 KB
testcase_27 AC 20 ms
8,332 KB
testcase_28 AC 92 ms
14,216 KB
testcase_29 AC 95 ms
14,240 KB
testcase_30 AC 85 ms
13,500 KB
testcase_31 AC 20 ms
8,524 KB
testcase_32 AC 57 ms
11,380 KB
testcase_33 AC 65 ms
12,048 KB
testcase_34 AC 34 ms
9,648 KB
testcase_35 AC 16 ms
7,856 KB
testcase_36 AC 24 ms
8,796 KB
testcase_37 AC 54 ms
10,960 KB
testcase_38 AC 109 ms
15,344 KB
testcase_39 AC 53 ms
10,784 KB
testcase_40 AC 17 ms
7,776 KB
testcase_41 AC 35 ms
9,284 KB
testcase_42 AC 20 ms
8,372 KB
testcase_43 AC 16 ms
7,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
B=list(map(int,input().split()))
m=998244353
o,e,f=0,0,0
for i in range(N):
 if (N-1)&i==i:o+=B[i]==-1;f^=B[i]==1
 else:e+=B[i]==-1
if o:print(pow(2,e+o-1,m))
else:print(pow(2,e,m)) if f else print(0)
0