摘要:
#include<bits/stdc++.h>#define endl '\n'#define INF0x3f3f3f3f#define int long longusing namespace std;const int N =1e4 + 10;int a[N],b[N];int n; //找左节 阅读全文
摘要:
#include<bits/stdc++.h>using namespace std;const int maxn = 1e4;int n,m;int mod =1e4;int temp[maxn][maxn];int res[maxn][maxn],a[maxn][maxn];void mul(i 阅读全文
摘要:
//递归 #include<iostream>using namespace std;const int maxn = 1e5+5;typedef long long ll;ll fastpow(ll a , ll n){ if(n==1) return a; ll temp = fastpow(a 阅读全文
摘要:
排列: #include<bits/stdc++.h>using namespace std;const int maxn = 1e3 +5;#define swap(a,b){int temp = a ; a = b ; b = temp;}int data[maxn];void so(){ fo 阅读全文
摘要:
1.构造函数(1)只要参数和类型不完全相同,就可以定义任意多个构造函数,以适应不同的初始化场合。(2)构造函数不需要写返回类型,且函数名与结构体名相同。(3)结构体内会生成一个默认的构造函数(但不可见,如studentInfo(){}),如下,所以才可以直接定义studentInfo类型的变量而不进 阅读全文
摘要:
引用引入了对象的一个同义词。定义引用的表示方法与定义指针相似,只是用&代替了*。引用(reference)是c++对c语言的重要扩充。引用就是某 一变量(目标)的一个别名,对引用的操作与对变量直接操作完全一样。其格式为:类型 &引用变量名 = 已定义过的变量名。 引用的特点: ①一个变量可取多个别名 阅读全文
摘要:
已知先序中序求后序 #include<bits/stdc++.h> using namespace std;const int N = 1010;int pre[N],in[N],post[N]; // 先序.中序.后序int k;struct node{ int value; node *l,*r 阅读全文
摘要:
#include<bits/stdc++.h>using namespace std;const int maxn = 10005;int s[maxn];void init(){ // 初始化使初始的每个结点都是自己的根结点 for(int i = 1 ; i <= maxn ; i++){ s[ 阅读全文
摘要:
#include<bits/stdc++.h>using namespace std;int a[10][10];bool h[10][10],l[10][10],g[10][10],flag;int pre[9][9] = { //可以通过行列判断是在哪个9宫格1,1,1,2,2,2,3,3,3, 阅读全文