摘要: 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; } 阅读全文
posted @ 2020-10-13 16:10 yesuweiYYYY 阅读(55) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2020-10-13 16:06 yesuweiYYYY 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2020-10-13 15:57 yesuweiYYYY 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-10-13 15:49 yesuweiYYYY 阅读(99) 评论(0) 推荐(0) 编辑
摘要: dp[2]; dp[n&1]=dp[(n+1)&1] 阅读全文
posted @ 2020-10-13 15:21 yesuweiYYYY 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 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 : 阅读全文
posted @ 2020-10-13 15:18 yesuweiYYYY 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-10-13 14:40 yesuweiYYYY 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 选块翻译:ctrl+alt+f 缩进:tab 取消缩进:shift + tab 代码规范化:ctrl+alt+l 阅读全文
posted @ 2020-10-13 14:32 yesuweiYYYY 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-10-13 14:28 yesuweiYYYY 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 下面是ACM比赛中常用的几个库 #include<bits/stdc++.h> #include <iostream> #include <cstdio> #include <fstream> #include <algorithm> #include <cmath> #include <deque 阅读全文
posted @ 2020-10-13 14:22 yesuweiYYYY 阅读(80) 评论(0) 推荐(0) 编辑