結果

問題 No.3070 Collecting Coins Speedrun 2
ユーザー PNJ
提出日時 2025-03-22 15:40:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 764 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 83,156 KB
最終ジャッジ日時 2025-03-22 15:40:44
合計ジャッジ時間 3,510 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

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(x + y + z, z, mod) % mod
if N == 1:
  ans = 1
print(ans)
0