結果
| 問題 |
No.3070 Collecting Coins Speedrun 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-31 02:05:25 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 747 bytes |
| コンパイル時間 | 3,509 ms |
| コンパイル使用メモリ | 275,000 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-31 02:05:31 |
| 合計ジャッジ時間 | 5,375 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 WA * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, e) for (int i = (int)(s); i < (int)(e); ++i)
#define all(a) (a).begin(),(a).end()
#include <atcoder/modint>
using namespace atcoder;
using mint = modint998244353;
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int N;
cin >> N;
if (N == 1) {
cout << 1 << '\n';
return 0;
}
int L = 0, R = 0;
bool zero = false;
rep(i, 0, N) {
int C;
cin >> C;
if (C == 0) zero = true;
else if (C < 0) ++L;
else ++R;
}
mint ans = mint(2).pow(N - 2);
if (L*R > 0 && zero) ans *= 3;
else ans *= 2;
cout << ans.val() << '\n';
}