結果
| 問題 | 
                            No.1702 count good string
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kiyoshi0205
                         | 
                    
| 提出日時 | 2021-10-08 22:09:51 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 4 ms / 2,000 ms | 
| コード長 | 583 bytes | 
| コンパイル時間 | 4,231 ms | 
| コンパイル使用メモリ | 161,876 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-23 04:32:23 | 
| 合計ジャッジ時間 | 5,531 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 47 | 
ソースコード
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
using namespace std;
#include<atcoder/all>
using mint=atcoder::modint1000000007;
mint dp[2][10];
string s,t="yukicoder";
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>s>>s;
  dp[0][0]=1;
  for(auto x:s){
    if(x=='?'){
      for(unsigned int j=0;j<9;++j)dp[1][j+1]+=dp[0][j];
    }else{
      unsigned int j=t.find(x);
      if(j<9){
        dp[0][j+1]+=dp[0][j];
        dp[1][j+1]+=dp[1][j];
      }
    }
  }
  cout<<(dp[0][9]+dp[1][9]).val()<<'\n';
}
            
            
            
        
            
kiyoshi0205