結果
| 問題 |
No.145 yukiover
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-19 01:35:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 404 bytes |
| コンパイル時間 | 374 ms |
| コンパイル使用メモリ | 53,404 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-04 16:44:05 |
| 合計ジャッジ時間 | 1,364 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 9 |
ソースコード
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
vector<int>v(256);
const string target="yuki";
int dfs(int d){
if(d==target.size())return 0;
char c=target[d];
if(v[c]){v[c]--;if(dfs(d+1))return 1;}
for(c++;c<='z';c++)if(v[c]){v[c]--;return 1;}
return 0;
}
int main(){
int R=0,c;
for(;~(c=getchar());)v[c]++;
for(;dfs(0);)R++;
printf("%d\n",R);
}