結果

問題 No.3070 Collecting Coins Speedrun 2
ユーザー nonon
提出日時 2025-03-21 21:45:40
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 3,239 ms
コンパイル使用メモリ 275,428 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-21 21:45:46
合計ジャッジ時間 4,671 ms
ジャッジサーバーID
(参考情報)
judge6 / judge7
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#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; i < N; i++) {
        int x;
        cin >> x;
        (x > 0 ? pos : x < 0 ? neg : zero)++;
    }
    mint ans = 1;
    if (pos) ans *= mint(2).pow(pos - 1);
    if (neg) ans *= mint(2).pow(neg - 1);
    if (pos > 0 && neg > 0) ans *= 2;
    if (zero > 0) ans *= (pos > 0 && neg > 0 ? 3 : 2);
    cout << ans.val() << endl;
}
0