結果
| 問題 |
No.1702 count good string
|
| コンテスト | |
| ユーザー |
yel_ow
|
| 提出日時 | 2025-06-10 05:31:56 |
| 言語 | C++17(gnu拡張) (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 931 bytes |
| コンパイル時間 | 2,393 ms |
| コンパイル使用メモリ | 200,600 KB |
| 実行使用メモリ | 62,080 KB |
| 最終ジャッジ日時 | 2025-06-10 05:32:04 |
| 合計ジャッジ時間 | 7,450 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 42 |
ソースコード
//#include <monsterenergy>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int MAX = 1e9;
const int MIN = -1*1e9;
const ll MAXLL = 1e18;
const ll MINLL = -1*1e18;
const string Y = "yukicoder";
int main()
{
int N; cin >> N;
string S; cin >> S;
vector DP(N+1,vector(10,vector<int>(2)));
DP[0][0][0] = 1;
for(int i = 0; i < N; i++)
{
for(int j = 0; j < 9; j++)
{
if(S[i] == '?')
{
DP[i+1][j+1][1] += DP[i][j][0];
}
else if(S[i] == Y[j])
{
DP[i+1][j+1][0] += DP[i][j][0];
DP[i+1][j+1][1] += DP[i][j][1];
}
DP[i+1][j][1] += DP[i][j][1];
DP[i+1][j][0] += DP[i][j][0];
}
}
cout << DP[N][9][0]+DP[N][9][1] << endl;
return 0;
}
yel_ow