首页 > 其他 > 详细

蓝桥杯手链样式

时间:2020-04-07 19:48:16      阅读:74      评论:0      收藏:0      [点我收藏+]

笔记见平板

#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;
} 

 

蓝桥杯手链样式

原文:https://www.cnblogs.com/h694879357/p/12636347.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!