結果
| 問題 |
No.3070 Collecting Coins Speedrun 2
|
| コンテスト | |
| ユーザー |
nonon
|
| 提出日時 | 2025-03-22 09:30:37 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 475 bytes |
| コンパイル時間 | 3,519 ms |
| コンパイル使用メモリ | 274,424 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2025-03-22 09:30:42 |
| 合計ジャッジ時間 | 4,881 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/modint>
using mint = atcoder::modint998244353;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
int pos = 0, neg = 0, zero = 0;
for (int i = 0, x; i < N; i++) {
cin >> x;
(x > 0 ? pos : x < 0 ? neg : zero)++;
}
mint ans = mint(2).pow(N - 1);
if (zero) ans *= mint(1 + (pos > 0) + (neg > 0)) / 2;
cout << ans.val() << endl;
}
nonon