摘要:
int ppo(int x,int p){ int t=x,res=1; while(p>0){ if(p&1)res=(res*t)%mod; t=(t*t)%mod; p>>=1; } return res%mod; } 阅读全文
摘要:
#include<bits/stdc++.h>using namespace std;const int maxn=5e5+10;void in(int &x){ int y=1;char c=getchar();x=0; while(c<'0'||c>'9'){if(c=='-')y=-1;c=g 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; const int maxn=5e5+10; vector<int>g[maxn]; int head[maxn],tot; void add(int fr,int to){ g[fr].push_back(t 阅读全文
摘要:
typedef struct P { double x,y; }P; /*bool cmp1(P a,P b)//在这里一定要注意 atan2函数y写在逗号前 返回的极角范围为-π~π { if(atan2(a.y,a.x)==atan2(b.y,b.x))return a.x<b.x; else 阅读全文
摘要:
dp[2]; dp[n&1]=dp[(n+1)&1] 阅读全文
摘要:
struct edge{ int u,v,value; bool operator < (const edge &t){ return value<t.value; }}e[maxn];int fath[maxn];int find(int x){ return x == fath[x] ? x : 阅读全文
摘要:
long long sum[maxn*4],lazy[maxn*4];long long a[maxn];void PushUp(long long rt){sum[rt]=sum[rt<<1]+sum[rt<<1|1];}//重置当前节点(rt)的信息void PushDown(long long 阅读全文
摘要:
选块翻译:ctrl+alt+f 缩进:tab 取消缩进:shift + tab 代码规范化:ctrl+alt+l 阅读全文
摘要:
long long cnt=1; long long sum[maxn*150],lazy[maxn*150],Lnode[maxn*150],Rnode[maxn*150]; void PushUp(long long rt){sum[rt]=sum[Lnode[rt]]+sum[Rnode[rt 阅读全文
摘要:
下面是ACM比赛中常用的几个库 #include<bits/stdc++.h> #include <iostream> #include <cstdio> #include <fstream> #include <algorithm> #include <cmath> #include <deque 阅读全文