結果

問題 No.8119 間に合いませんでした><;
ユーザー 👑 Nachia
提出日時 2025-04-01 22:58:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 984 bytes
コンパイル時間 761 ms
コンパイル使用メモリ 73,880 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-04-01 22:58:27
合計ジャッジ時間 3,515 ms
ジャッジサーバーID
(参考情報)
judge6 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25 TLE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifdef NACHIA
#define _GLIBCXX_DEBUG
#else
#define NDEBUG
#endif
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(i64 i=0; i<i64(n); i++)
const i64 INF = 1001001001001001001;
template<typename A> void chmin(A& l, const A& r){ if(r < l) l = r; }
template<typename A> void chmax(A& l, const A& r){ if(l < r) l = r; }
using namespace std;

i64 dp[15000] = {};

void testcase(){
    i64 N; cin >> N;
    string S; cin >> S;
    if(N%10 != 0){ cout << "0\n"; return; }
    dp[0] = 1;
    rep(s,N/10+1) if(S[s*10] == 'o'){
        dp[s] %= 998244353;
        i64 f = s * 10;
        i64 len = (N - f) / 10;
        for(i64 t=1; t<=len; t++){
            if(S[f+t*2] == 'o' && S[f+t*5] == 'o'){
                dp[s+t] += dp[s];
            }
        }
    }
    cout << dp[N/10] << endl;
}

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    testcase();
    return 0;
}
0