結果

問題 No.1741 Arrays and XOR Procedure
ユーザー rlangevin
提出日時 2023-07-06 12:42:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 23,932 KB
最終ジャッジ日時 2024-07-20 07:56:16
合計ジャッジ時間 5,435 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

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