计算几何题目总结 (只保证模板正确 代码过题)
摘要:凸包 poj 1113 Graham Scan 算法 极角排序+栈模拟 //#include<bits/stdc++.h> #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> #include
阅读全文
dfs序 线段树 dfs序列 主席树
摘要:并查集 #include<stdio.h> int stt[10005]; void sset(int x) { for(int i=1;i<=x;i++) stt[i]=i; } int ffind(int x) { if(x==stt[x]) return x; else return stt[
阅读全文
拉格朗日乘子法
摘要:https://www.cnblogs.com/sddai/p/5728195.html 详细讲解 https://blog.csdn.net/qq_40036484/article/details/80457800 一般讲解
阅读全文
组合数学 待补题
摘要:HDU 4372 - Count the Buildings(组合计数) 第一类斯特拉数
阅读全文
杜教筛 (包括线筛) 莫比乌斯函数前缀和 欧拉函数前缀和 因数和函数前缀和 因子个数前缀和 ( 分析 )
摘要:线筛各种函数 元函数 恒等函数 单位函数 莫比乌斯函数 欧拉函数 因子个数函数 因子和函数 #include<bits/stdc++.h> #define ll long long using namespace std; const int maxn=1e6+10; int e[maxn]; in
阅读全文
计算几何题目总结
摘要:模板 (只用这一个) 点 线 圆 //#include<bits/stdc++.h> #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> #include <queue> #include <
阅读全文
- Power Strings (字符串哈希) (KMP)
摘要:https://www.cnblogs.com/widsom/p/8058358.htm (详细解释) //#include<bits/stdc++.h> #include<vector> #include<cstdio> #include<cstring> #include<iostream> #
阅读全文
2019南昌邀请赛 L 计算几何 G(待补)
摘要:#include const double PI=acos(-1.0); const double TT=PI/3; using namespace std; struct Point { double x,y; Point(){} Point(double x, double y) :x(x), y(y){} };; struct Segment{ Point a,b; Segment(...
阅读全文
Visible Lattice Points SPOJ - VLATTICE 三维+莫比乌斯反演
摘要:#include #define ll long long using namespace std; const int maxn=1e7+10; int vis[maxn]; int mu[maxn]; int prime[maxn]; int tot=0; int sum1[maxn]; int sum2[maxn]; void get_mu() { mu[1]=1; vis[1]=...
阅读全文
P2257 莫比乌斯+整除分块
摘要:#include #define ll long long using namespace std; const int maxn=1e7+10; int vis[maxn]; int mu[maxn]; int prime[maxn]; int tot=0; int sum1[maxn]; int sum2[maxn]; void get_mu() { mu[1]=1; vis[1]=...
阅读全文
P2568 莫比乌斯反演+整除分块
摘要:#include<bits/stdc++.h> #define LL long long using namespace std; const int maxn=1e7+10; bool vis[maxn]; int prime[maxn]; int mu[maxn]; int sum1[maxn]
阅读全文
洛古 P2568 莫比乌斯+暴力
摘要:#include #define LL long long using namespace std; const int maxn=1e7+10; bool vis[maxn]; int prime[maxn]; int mu[maxn]; int sum[maxn]; int cnt=0; void get_mu()// mo bi su si han shu { mu[1]=1; ...
阅读全文
bzoj 4589 FWT
摘要:#include #define ll long long using namespace std; const int maxn=5e4+100; const int mod=1e9+7; const int MOD=1e9+7; const int inv2=5e8+4; int a[1>1,j=0;j>=1; } FWT(b,-1); } int main() { g...
阅读全文
poj 1151 (未完成) 扫描线 线段树 离散化
摘要:#include #include #include #include using namespace std; #define y1 y11 #define ls rt vx; vector vy; double x[maxn]; double y[maxn]; struct node { int yl,yr,k; }pp[maxn]; vector vxxx[maxn]; double tr...
阅读全文
倍增 ST表
摘要:void make_ST(){ for(int i=1;i<=n;i++){ st[i][0]=height[i]; for(int j=1;i+(1<<j)-1<=n;j++){ st[i][j]=min(st[i][j-1],st[i+(1<<(j-1))][j-1]); } } }
阅读全文
QMD ST表 倍增
摘要:#include #include using namespace std; const int maxn=1e5+10; int a[maxn]; int st[maxn][50]; int ST[maxn][50]; int quick(int a,int n) { int ans=1; while(n) { if(n&1) ans*=a; ...
阅读全文
SG函数 2019- 杭师范校赛
摘要:#include using namespace std; const int maxn=1e6+10; int sg[maxn]; int f[maxn]; int s[maxn]; void make_SG() { memset(sg,0,sizeof(sg)); int n=200; for(int i=1;i>T; while(T--) { ...
阅读全文
C# 作业
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Wind...
阅读全文
快快读 离散化 牛客题
摘要:#include //#define int long long #define ll long long using namespace std; struct FastIO { static const int S = 4e6; int wpos; char wbuf[S]; FastIO() : wpos(0) {} inline int xchar...
阅读全文