結果
問題 |
No.3070 Collecting Coins Speedrun 2
|
ユーザー |
![]() |
提出日時 | 2025-03-21 22:39:24 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 765 bytes |
コンパイル時間 | 5,404 ms |
コンパイル使用メモリ | 332,408 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-21 22:39:35 |
合計ジャッジ時間 | 6,632 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 WA * 5 |
ソースコード
#include <atcoder/all> #include <bits/stdc++.h> #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++) using namespace atcoder; using namespace std; typedef long long ll; using mint = modint998244353; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); int n; cin >> n; int pl = 0, mi = 0, ze = 0; rep(i, 0, n) { int x; cin >> x; if (x > 0) pl++; else if (x < 0) mi++; else ze++; } mint ans = 1; if (pl && mi && ze) { ans *= 3; } if (pl) ans *= pow_mod(2, pl - 1, 998244353); if (mi) ans *= pow_mod(2, mi - 1, 998244353); if (pl && mi) ans *= 2; cout << ans.val() << endl; }