摘要: http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=2085A.囧Time Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 80 (40 users)Total Accepted: 34 (34 users)Special Judge: NoDescriptionDS最近很囧,总是不能把妹子哄开心。所以,邪恶的他也想让你们囧一囧。他给你一个数字 n 让你输出囧字的迭代(详见样例)。 Input第一行一个整数,代表数据的组数。 每组数据一 阅读全文
posted @ 2014-03-30 15:02 galaxy77 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 【题意】根据一个排列,按照字典排列的顺序输出它的下面k个排列。 用C++的STL库的next_permutation()函数直接生成下一个排列 就可以了 3 2 1 的下一个排列会是 1 2 3#include#include#include#includeusing namespace std;int p[1111];int main(){ int t,n,k; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&k); for(int i=0;i<n;i++) scanf(... 阅读全文
posted @ 2014-03-30 13:34 galaxy77 阅读(238) 评论(0) 推荐(0) 编辑