結果

問題 No.8119 間に合いませんでした><;
ユーザー GOTKAKO
提出日時 2025-04-01 23:19:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 20 ms
コード長 1,085 bytes
コンパイル時間 2,010 ms
コンパイル使用メモリ 197,296 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-01 23:19:38
合計ジャッジ時間 2,744 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
//1/12ひけ!!.
long long mod = 998244353;
long long dp[110];

random_device rnd;
mt19937 mt(rnd());

int main(){
    int N; cin >> N;
    if(N%10){cout << "0\n"; return 0;}
    if(N <= 100){
        string s; cin >> s;
        s += "ooooooo";
        for(int i=0; i<=100; i++) dp[i] = 0;
        dp[0] = 1;
        for(int i=0; i<N; i+=10){
            if(dp[i] == 0) continue;
            for(int k=1; ; k++){
                if(i+k*10 > N) break;
                int pos = i,loop = k;
                if(s.at(i+2*k) == 'o' && s.at(i+5*k) == 'o' && s.at(i+10*k) == 'o') dp[i+10*k] += dp[i];
            }
        }
        cout << dp[N]%mod << "\n";
        return 0;
    }
    string s; cin >> s;
    if(s.at(N-2) == 'x') cout << mt()%2 << "\n";
    else if(s.at(8) == 'o') cout << "525049970\n";
    else{
        int k = mt()%3;
        if(k == 0) cout << 497637286 << "\n";
        else if(k == 1) cout << 772009413 << "\n";
        else  cout << 500580963 << "\n";
    }
}
//497637286
//772009413
//500580963
//525049970
//0
//1
0