解题思路:
注意事项:
参考代码:
#include<iostream> #include<set> #include<algorithm> #include<string> using namespace std; string s1; set<string> st; void alls() { for(int i=0;i<=s1.size()-8;i++) { st.insert(s1.substr(i,8)); } // for(set<string>::iterator it=st.begin();it!=st.end();it++) // { // cout<<*it<<endl; // } } int main() { int n; string s2; int as=0; cin>>s1>>n; alls(); for(int i=0;i<n;i++) { cin>>s2; sort(s2.begin(),s2.end()); do { if(st.count(s2)) { as++; } } while(next_permutation(s2.begin(),s2.end())); } cout<<as<<endl; return 0; }
0.0分
0 人评分
WU-蓝桥杯算法提高VIP-交换Easy (C++代码)浏览:1119 |
WU-整数平均值 (C++代码)浏览:1244 |
1009题解浏览:751 |
DNA (C语言代码)浏览:394 |
简单的a+b (C语言代码)浏览:950 |
C二级辅导-阶乘数列 (C语言代码)浏览:521 |
大神老白 (C语言代码)浏览:601 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:534 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:713 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:511 |