結果

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

ソースコード

diff #

mod = 998244353
n = int(input())
c = list(map(int, input().split()))
if n == 1:
    print(1)
    exit()
if c[-1] < 0:
    c = [-x for x in reversed(c)]
if c[0] >= 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