51nod 1384:全排列(STL)
2024-09-06 00:19:10
记住next_permutation函数的用法,另外string在这里比char[]慢好多啊。。
//#include<bits/stdc++.h> //using namespace std; //typedef long long LL; // //int main() //{ // string s; // while(cin>>s) // { // int l=s.length(); // sort(s.begin(),s.end()); // do // { // cout<<s<<endl; // }while(next_permutation(s.begin(),s.end())); // } //} //437ms 1888KB #include<bits/stdc++.h> using namespace std; typedef long long LL; int main() { ]; while(~scanf("%s",s)) { int l=strlen(s); sort(s,s+l); do { puts(s); }while(next_permutation(s,s+l)); } } //78ms 1872KB
最新文章
- WPF阴影效果(DropShadowEffect)
- AngularJS 2.0
- ios 友盟第三方登录遇到的各种坑。
- 【matlab】将matlab中数据输出保存为txt或dat格式
- 生成new, old的 shell script
- Hashtable,HashMap,Dictionary的区别
- GitHub学习资料
- c++中的const参数,const变量,const指针,const对象,以及const成员函数
- Android相关
- 在Mac下显示所有文件
- MellPlayer, 基于网易云歌单的命令行播放器
- Git时光机穿梭之工作区和暂存区
- 执行manage.py syncdb提示Unknown command: &#39;syncdb&#39;
- Java DB 访问之(四) spring mvc 组合mybatis
- 王家林人工智能AI课程大纲和电子书 - 老师微信13928463918
- Gnome osc,资源,,,,,因为官网难下
- spring-mybatis-springMVC 整合
- Java桌面程序打包成exe可执行文件
- Memcached使用与纠错(附代码和相关dll)
- .net core中Quartz的使用