03 2022 档案
摘要:基本思想/注意事项 点(向量)的定义: struct point{ double x; double y; }; 直线、线段以两点表示,避免用斜率和方程 基础 double d_mult(point a,point b){ return a.x*b.x+a.y*b.y; } //点乘 double
阅读全文
摘要:#include<cstdio> #include<cstring> #define ll long long const int N=1000010; int head[N<<1]; int next[N<<1]; int goal[N<<1]; ll ans=0; ll max(ll a,ll
阅读全文
摘要:沃日,结构体里开不了1e7的数组,没法封装,不够优雅。 #include<cstdio> #include<cmath> const int N=1e7+10; const double pi=acos(-1.0); struct complex{ double x,y; }; complex op
阅读全文
摘要:本质是堆 头文件 #include<queue> using namespace std; 定义 priority_queue<int> q; //默认大根堆 priority_queue<int,vector<int>,greater<int>> q; //小根堆 priority_queue<i
阅读全文
摘要:头文件 #include<set> using namespace std; 定义 set <int,greater<int> > s //从s.begin()到s.end()的遍历结果为从大到小 set <int,less<int> > s //从s.begin()到s.end()的遍历结果为从小
阅读全文
摘要:“缩花”的思想虽然易懂,但与具体实现严重不符,其实根本没有“缩”的过程。建议用“增广路树+树上并查集维护信息”理解更直观 #include<cstdio> #include<queue> #include<cstring> using namespace std; const int N=1010;
阅读全文
摘要:#include<cstdio> #include<cstring> const int N=510; const int INF=1e18; int n,m; int val[N][N]; int match[N]; bool vis[N]; int ex[N],ey[N],slack[N]; i
阅读全文

浙公网安备 33010602011771号