結果

問題 No.3070 Collecting Coins Speedrun 2
ユーザー flippergo
提出日時 2025-03-23 12:21:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 574 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 82,944 KB
最終ジャッジ日時 2025-03-23 12:21:09
合計ジャッジ時間 3,911 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = list(map(int,input().split()))
MOD = 998244353
if N==1:
    ans = 1
else:
    k = 0
    for i in range(N):
        if C[i]<0:
            k += 1
        else:break
    if 0 not in C:
        ans = pow(2,N-1,MOD)
    elif k==0 or k==N-1:
        ans = pow(2,N,MOD)
    else:
        ans = 3*pow(2,N-2,MOD)
print(ans)
0