結果

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

ソースコード

diff #

mod = 998244353
n = int(input())
c = list(map(int, input().split()))
if n == 1:
    print(1)
    exit()
if c[-1] <= 0 or 0 <= c[0]:
    print(pow(2, n - 1, mod))
elif 0 in c:
    print(2 * pow(2, n - 3, mod) * 3 % mod)
else:
    print(2 * pow(2, n - 2, mod))
0