蓝桥杯手链样式

笔记见平板

#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector> 
using namespace std;
vector<string>v;
vector<string>::iterator it;
int main()
{
    string str="aaabbbbccccc";
    int cnt=0;
    do{
        for(it=v.begin();it!=v.end();it++)
        {
            if((*it).find(str)!=string::npos)
            {
                break;
            }
        
        }
        if(it!=v.end())
            continue;
        string str2=str+str;
        v.push_back(str2);
        reverse(str2.begin(),str2.end());
        v.push_back(str2);
        cnt++;    
    }while(next_permutation(str.begin(),str.end()));
    cout<<cnt<<endl;
    return 0;
} 

 

posted @ 2020-04-07 18:05  Tomorrow1126  阅读(117)  评论(0编辑  收藏  举报