摘要:
思路:直接vector暴力#include#include#include#include#define Maxn 2000010using namespace std;vector g;char str[Maxn],ss[20];int main(){ int t,i,j,l,pos,ll,r; scanf("%d",&t); while(t--){ g.clear(); scanf("%s",str); l=strlen(str); for(i=0;i<l;i++) g.push_back(st... 阅读全文
摘要:
思路:枚举每个位置的最小字符,用最大匹配判断是否可行#include#include#include#include#include#define Maxn 1010using namespace std;int match[Maxn],vi[Maxn],num[Maxn],g[Maxn][Maxn],f[Maxn],ch[Maxn],n,le;void init(){ memset(match,-1,sizeof(match)); memset(vi,0,sizeof(vi)); memset(num,0,sizeof(num)); memset(g,0,sizeof... 阅读全文