結果

問題 No.3070 Collecting Coins Speedrun 2
ユーザー i_taku
提出日時 2025-03-25 16:27:34
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 424 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 82,236 KB
実行使用メモリ 84,944 KB
最終ジャッジ日時 2025-03-25 16:27:38
合計ジャッジ時間 3,663 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
m = z = p = 0
for a in A:
    if a < 0:
        m += 1
    if a == 0:
        z += 1
    if a > 0:
        p += 1

mod = 998244353
if m > 0 and p > 0:
    ans = 2 * pow(2, m - 1, mod) * pow(3, z, mod) * pow(2, p - 1, mod) % mod
elif m == 0 and p == 0:
    print(1)
else:
    ans = pow(2, max(0, m - 1), mod) * pow(2, z, mod) * pow(2, max(0, p - 1), mod) % mod
print(ans)
0