結果

問題 No.1702 count good string
ユーザー chocoruskchocorusk
提出日時 2021-10-08 22:01:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,221 bytes
コンパイル時間 3,631 ms
コンパイル使用メモリ 188,200 KB
実行使用メモリ 7,708 KB
最終ジャッジ日時 2023-09-30 10:10:21
合計ジャッジ時間 6,695 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
7,344 KB
testcase_01 AC 6 ms
7,228 KB
testcase_02 AC 6 ms
7,488 KB
testcase_03 AC 5 ms
7,484 KB
testcase_04 AC 5 ms
7,356 KB
testcase_05 AC 5 ms
7,288 KB
testcase_06 AC 6 ms
7,424 KB
testcase_07 AC 6 ms
7,328 KB
testcase_08 AC 5 ms
7,228 KB
testcase_09 AC 5 ms
7,504 KB
testcase_10 AC 6 ms
7,292 KB
testcase_11 AC 5 ms
7,500 KB
testcase_12 AC 5 ms
7,224 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 6 ms
7,224 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 6 ms
7,228 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 6 ms
7,304 KB
testcase_46 AC 5 ms
7,220 KB
testcase_47 AC 6 ms
7,344 KB
testcase_48 AC 5 ms
7,232 KB
testcase_49 AC 5 ms
7,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
using mint=modint998244353;

int main()
{
    int n; cin>>n;
    string s0="yukicoder";
    string s; cin>>s;
    auto calc=[&](){
        mint dp[10][100010];
        dp[0][0]=1;
        for(int i=0; i<n; i++){
            for(int j=0; j<10; j++){
                if(j<9 && s0[j]==s[i]){
                    dp[j+1][i+1]+=dp[j][i];
                }
                dp[j][i+1]+=dp[j][i];
            }
        }
        return dp[9][n];
    };
    mint ans=calc();
    for(int i=0; i<9; i++){
        char c=s0[i];
        s0[i]='?';
        ans+=calc();
        s0[i]=c;
    }
    cout<<ans.val()<<endl;
    return 0;
}
0