結果

問題 No.3070 Collecting Coins Speedrun 2
ユーザー ルク
提出日時 2025-03-21 22:19:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 90,752 KB
最終ジャッジ日時 2025-03-21 22:19:08
合計ジャッジ時間 3,504 ms
ジャッジサーバーID
(参考情報)
judge3 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
pos = []
neg = []
mod = 998244353
zero = False
a = list(map(int, input().split()))
for i in a:
    if i > 0:
        pos.append(i)
    elif i < 0:
        neg.append(i)
    else:
        zero = True
if n == 1 and zero:
    print(1)
    exit()
ans = pow(2, len(pos)-1, mod)*pow(2, len(neg)-1, mod)*2 % mod
if zero:
    ans *= 3
print(ans % mod)
0