結果

問題 No.8119 間に合いませんでした><;
ユーザー 獅子座じゃない人
提出日時 2025-02-05 21:19:45
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 719 bytes
コンパイル時間 6,451 ms
コンパイル使用メモリ 275,004 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2025-02-05 21:19:58
合計ジャッジ時間 13,085 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 23 TLE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

constexpr long long MOD = 998244353;

int main() {
    int n; string s;
    cin >> n >> s;

    if (n % 10 != 0) {
        cout << 0 << endl;
        return 0;
    }

    vector<long long> dp(n / 10 + 1);
    dp[0] = 1;

    for (int i = 0; i < n / 10; i++) {
        for (int k = 1; k <= n / 10 - i; k++) {
            bool ok = true;
            if (s[i * 10 + 2 * k] == 'x') ok = false;
            if (s[i * 10 + (2 + 3) * k] == 'x') ok = false;
            if (s[i * 10 + (2 + 3 + 5) * k] == 'x') ok = false;

            if (ok) {
                dp[i + k] += dp[i];
                dp[i + k] %= MOD;
            }
        }
    }

    cout << dp[n / 10] << endl;
}
0