結果
問題 | No.145 yukiover |
ユーザー |
|
提出日時 | 2015-04-19 01:39:09 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 366 ms |
コンパイル使用メモリ | 53,864 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 16:44:06 |
合計ジャッジ時間 | 1,103 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#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;v[c]++;} 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); }