結果

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

ソースコード

diff #

mod = 998244353
N = int(input())
C = list(map(int, input().split()))
x, y, z = 0, 0, 0
if 0 in C:
  z += 1
if max(C) > 0:
  x += 1
if min(C) < 0:
  y += 1

ans = pow(2, N - x - y - z, mod) * (x + y) * pow(3, z, mod) % mod
if N == 1:
  ans = 1
print(ans)
0