結果
| 問題 |
No.3070 Collecting Coins Speedrun 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 22:13:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 451 bytes |
| コンパイル時間 | 320 ms |
| コンパイル使用メモリ | 82,112 KB |
| 実行使用メモリ | 91,008 KB |
| 最終ジャッジ日時 | 2025-03-21 22:13:50 |
| 合計ジャッジ時間 | 3,349 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 15 |
ソースコード
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 len(pos) == 0:
print(pow(2, len(neg)+zero, mod))
exit()
if len(neg) == 0:
print(pow(2, len(pos)+zero, mod))
exit()
ans = pow(2, len(pos)-1, mod)*pow(2, len(neg)-1, mod)*2 % mod
if zero:
ans *= 3
print(ans % mod)