|洛谷|数学|P1088 火星人
来源:互联网 发布:读研 知乎 编辑:程序博客网 时间:2024/05/23 18:32
http://www.luogu.org/problem/show?pid=1088
求字典序第k小全排列,可以用C++的next_permutation函数
#include<cstdio>#include<algorithm>#include<cstring>#include<queue>#define ms(i,j) memset(i,j, sizeof i);using namespace std;int a[10005];int main(){ int n,k; scanf("%d%d", &n ,&k); for (int i=1;i<=n;i++) scanf("%d", &a[i]); while (k--) next_permutation(a+1 ,a+1+n); for (int i=1;i<=n;i++) printf("%d ", a[i]); return 0;}
0 0
- |洛谷|数学|P1088 火星人
- 洛谷 P1088 火星人
- 洛谷 P1088 火星人
- 洛谷 P1088 火星人
- 洛谷 P1088 火星人
- P1088 火星人
- P1088 火星人
- P1088 火星人
- 火星人(Luogu P1088)解题报告
- 求全排列的数学方法(洛谷1088 火星人noip2004普及组第4题)
- 【重走普及路】【数学问题】火星人
- 洛谷1088 火星人
- 【洛谷 1088】 火星人
- 火星人-洛谷 1088
- 火星人
- 火星人
- 火星人
- 火星人
- fmt:formatDate 八方罗列举例全
- Kubernets搭建Kubernetes-dashboard
- Andorid Studio使用技巧
- python中使用xlrd、xlwt操作excel表格详解
- 红外遥控器
- |洛谷|数学|P1088 火星人
- HTML+CSS基础 frameset-frame将两个独立网页(每行一个)合在另一个单独的网页上(鼠标可以调整大小)
- 高质量C++编程
- fl2440工作于AP模式
- 微信:小程序学习笔记(1)
- Xcode 7 缺少 *.dylib库的解决方法
- gcc compile error :headfile not defined
- 音视频开发需要知道的几个问题
- Spring学习一(Spring介绍)