結果

問題 No.1741 Arrays and XOR Procedure
ユーザー titiatitia
提出日時 2021-11-12 22:48:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 23,916 KB
最終ジャッジ日時 2024-05-04 10:22:21
合計ジャッジ時間 3,348 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,752 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 74 ms
23,916 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 WA -
testcase_06 AC 75 ms
19,336 KB
testcase_07 AC 75 ms
19,212 KB
testcase_08 WA -
testcase_09 AC 68 ms
17,044 KB
testcase_10 AC 71 ms
16,400 KB
testcase_11 AC 59 ms
15,616 KB
testcase_12 AC 52 ms
14,364 KB
testcase_13 AC 66 ms
16,140 KB
testcase_14 AC 55 ms
14,760 KB
testcase_15 AC 64 ms
15,900 KB
testcase_16 AC 29 ms
11,008 KB
testcase_17 WA -
testcase_18 AC 59 ms
15,108 KB
testcase_19 AC 28 ms
11,008 KB
testcase_20 WA -
testcase_21 AC 58 ms
15,676 KB
testcase_22 WA -
testcase_23 AC 39 ms
12,544 KB
testcase_24 AC 29 ms
11,136 KB
testcase_25 AC 74 ms
17,768 KB
testcase_26 WA -
testcase_27 AC 26 ms
11,008 KB
testcase_28 AC 59 ms
15,332 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 45 ms
13,696 KB
testcase_33 AC 50 ms
14,048 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 30 ms
11,392 KB
testcase_37 AC 42 ms
13,568 KB
testcase_38 AC 67 ms
16,984 KB
testcase_39 AC 40 ms
12,928 KB
testcase_40 AC 26 ms
10,752 KB
testcase_41 AC 32 ms
11,904 KB
testcase_42 WA -
testcase_43 AC 25 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0