全排列next_permutation()用法


在头文件aglorithm里

就是1~n数组的现在的字典序到最大的字典序的依次增加。(最多可以是n!种情况)

int a[n];
do{
}while(next_permutation(a,a+n));

####或者知道有多少种情况 比如排好序就有n!

int a[n];
sort(a,a+n);
int chi=1;
for(int i=1;i<=n;i++){
chi*=i;
}
while(chi--){
next_permutation(a,a+n);
}

## 构造函数赋值


过于菜了c++没学好,希望以后能慢慢这些填坑。。。(不定时更新,一些知识)

strcut node{
int x,y;
node(){}
node(int sx,int sy):x(sx),y(sy){}
friend bool operator<(const node a,const node b){
return a.y>b.y;
}
}; int arr[10];//vector<int>arr;
for(int i=0;i<10;i++)
{
arr[i]=i;
}
for(auto &a:arr)
{
cout << a;
}

我的头文件

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define il inline
#define it register int
#define inf 0x3f3f3f3f
#define lowbit(x) (x)&(-x)
#define pii pair<int,int>
#define mak(n,m) make_pair(n,m)
#define mem(a,b) memset(a,b,sizeof(a))
#define mod 1000000007
#define ios ios::sync_with_stdio(false)
const int maxn=1e6+10;
const int mo=1e9;
ll ksm(ll a,ll b){if(b<0)return 0;ll ans=1;while(b){if(b&1)ans=ans*a%mod;a=a*a%mod;b>>=1;}return ans;}
const double pi=acos(-1.0);
int t;
int n,m;
int main() {
scanf("%d",&t);
while(t--){ }
return 0;
}

上海演了水哥的退役赛,心情不是很舒服,四题铜首,我也想成为像水哥以及~~对面那队(对面最起码沉迷算法七八年,我这一年菜鸡也只能尽全力靠近他们了,ps冠军队)~~的样子
我还要更加更加的努力才行。
以后每天没有早课就八点去实验室。每周至少两套题加补题,不想再那样无所作为了,靠自己,把自己的算法一点点往这个博客里添加,还有三年不到,至少这一次我要拼尽全力。

最新文章

  1. C#.net 中 修饰符 详解 (来自MSDN)
  2. 要引用这几个才有GetOwinContext与GetAutofacLifetimeScope
  3. 使用ocr的自动备份还原ocr
  4. 使用的组件:Jcrop
  5. 在线音乐API的研究 (Part 2.1)
  6. Spring框架学习之第1节
  7. 基于gSOAP使用头文件的C语言版web service开发过程例子
  8. Controlling GameObjects Using Components
  9. js判断加载大小页面
  10. java实现——009Fibonacci数列
  11. Android 通知 相关api记录
  12. win8以上系统查看iis网站进程内存占用情况
  13. ubuntu16.04中supervisor安装与简单使用(转载)
  14. 【vue】vue +element 搭建项目,el-input 常用的验证
  15. Linux Network Commands
  16. XAF 与 CIIP
  17. 物理standby database的日常维护
  18. 4字节emoji表情对应的Unicode编码获取和编码转换
  19. Maven项目打包,Jar包不更新的问题
  20. 测试Js权限

热门文章

  1. nmonchart 分析.nmon监控数据成html展示
  2. Shell脚本命令汇总中
  3. MS Sqlserver删除字段最后的多余字符
  4. Centos7 下mysql 密码重置
  5. C/S编程
  6. 更改mysql数据库默认的字符集(编码方式)
  7. Servlet转发
  8. RAID 5+备份硬盘实验:mdadm
  9. JEECG右上角用户信息完整显示
  10. 深入理解python(四)python基础知识之函数