next_permutation函数
来源:互联网 发布:mac safari 播放flash 编辑:程序博客网 时间:2024/06/11 02:21
今天做弱校联盟的题,A Big Dinner感觉用到了一个以前不会函数 ,就记录下来~
- 附上网址:http://www.bnuoj.com/bnuoj/problem_show.php?pid=24249
- 题目含义很简单:就是将不同的排列写出来就好。
- 代码:
> #include<iostream>> #include<cstdio>> #include <string>> #include <algorithm>> #include <cstring>> #include <cmath>> #include <queue>> #include <cstdlib>> #define MAX 1510> #define ll long long using namespace std; int a[5]; int main() {> int T,ii=1;> scanf("%d",&T);> while(T--)> {> printf("Case #%d:\n",ii++);> scanf("%d%d%d",&a[0],&a[1],&a[2]);> sort(a,a+3);> do> {> printf("%d %d %d\n",a[0],a[1],a[2]);> }while(next_permutation(a,a+3));> } }
“`
1 0
- next_permutation函数
- next_permutation函数
- next_permutation()函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- next_permutation函数
- 数据结构例程——串的模式匹配(Brute-Force算法)
- Gson源码分析二
- 最有影响力的计算机视觉---论文
- CF #324 (Div. 2)
- 第一个只出现一次的字符
- next_permutation函数
- ACM学习-动态规划-不老的传说问题
- 面试
- android中巧妙更改spinner、AutoCompleteTextView分割线的颜色值(spinner AutoCompleteTextView divider color)
- JavaScript编程常用函数
- Xms Xmx PermSize MaxPermSize 区别
- Spring MVC页面列表的循环和判断
- ZOJ 题目3777 Problem Arrangement(状态压缩DP)
- 创建型模式简介