题意:
给出一个串,要求分成k份,每份的长度在[a,b]之间 求可行的一个方案。
题解:
搜索题,直接搜索超时,用dp存下走过的情况。dp[i][j]表示前i个点,分成了j个集合是否走过。
#include<iostream>
#include<math.h>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
const int oo=0x3f3f3f3f;
const ll OO=1LL<<61;
const int maxn=205;
int n,m,a,b;
int mark[maxn];
int dp[maxn][maxn];
char str[maxn];
void output()
{
mark[0]=0;
for(int i=1;i<=m;i++)
{
for(