結果
| 問題 | 
                            No.1741 Arrays and XOR  Procedure
                             | 
                    
| コンテスト | |
| ユーザー | 
                             titia
                         | 
                    
| 提出日時 | 2021-11-12 22:48:53 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 348 bytes | 
| コンパイル時間 | 268 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 23,796 KB | 
| 最終ジャッジ日時 | 2024-11-25 20:36:13 | 
| 合計ジャッジ時間 | 3,440 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 WA * 12 | 
ソースコード
import sys
input = sys.stdin.readline
N=int(input())
B=list(map(int,input().split()))
mod=998244353
if N%2==1:
    x=B.count(-1)
    if B[0]!=-1 and B[-1]!=-1:
        if B[0]^B[-1]==1:
            print(pow(2,x,mod))
        else:
            print(0)
    else:
        print(pow(2,x-1,mod))
else:
    x=B.count(-1)
    print(pow(2,x-1,mod))
            
            
            
        
            
titia