結果
| 問題 | No.3070 Collecting Coins Speedrun 2 |
| コンテスト | |
| ユーザー |
SPD_9X2
|
| 提出日時 | 2025-03-22 22:54:03 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 72 ms / 2,000 ms |
| コード長 | 431 bytes |
| 記録 | |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 96,236 KB |
| 実行使用メモリ | 98,464 KB |
| 最終ジャッジ日時 | 2026-07-07 20:32:06 |
| 合計ジャッジ時間 | 4,129 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
"""
"""
import sys
N = int(input())
c = list(map(int,input().split()))
m = 0
z = 0
p = 0
for i in c:
if i > 0:
p += 1
elif i == 0:
z += 1
else:
m += 1
mod = 998244353
ans = pow(2,max(0,m-1),mod) * pow(2,max(0,p-1),mod)
if m > 0 and p > 0:
ans *= 2
if z == 1:
if m > 0 and p > 0:
ans *= 3
elif m+p > 0:
ans *= 2
else:
ans *= 1
print (ans % mod)
SPD_9X2