摘要:
hdu1285 http://acm.hdu.edu.cn/showproblem.php?pid=1285 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<vector> #inc 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; const int M=3e5+5; struct node{ int l,r,cnt,lazy; node(int l1=0,int r1=0,int cnt1=0,int lazy1=0):l(l1),r( 阅读全文
摘要:
网1:飞行员匹配 题目链接:https://www.oj.swust.edu.cn/problem/show/1736 俩种做法: /**********二分图匹配做法***********/ #include<bits/stdc++.h> using namespace std; const in 阅读全文
摘要:
bool spfa(){ queueque; que.push(s); memset(dis,INF,sizeof(dis)); dis[s]=0; while(!que.empty()){ int u=que.front(); que.pop(); vis[u]=0; for(int i=head[u];~i;i=edge[i].nextt){ int v=ed... 阅读全文
摘要:
bool bfs(){ memset(deep,0,sizeof(deep)); queueque; que.push(s); deep[s]=1; while(!que.empty()){ int u=que.front(); que.pop(); for(int i=head[u];i!=-1;i=e[i].nextt){ int v=e[i].v; if(... 阅读全文
摘要:
https://acm.ecnu.edu.cn/contest/173/problem/E/ 区间操作,线段树; 维护乘的次数和除的次数 最后答案是,div和mul共同作用的结果, 分两种来考虑,第一种是当前有足够多次1操作,所以当再来一次操作时,直接在此基础上进行修改,除就减,乘就加; 第二种比较 阅读全文
摘要:
https://acm.ecnu.edu.cn/contest/173/problem/C/ 联通块染色,若i,j满足题目中的条件,那么他们在每幅图中的染色情况相同,即hash值相同 使用unsigned long long hash 自动对2^64取模; 阅读全文
摘要:
https://www.luogu.org/problemnew/show/P3369 #include<bits/stdc++.h> using namespace std; inline int read(){ int sum=0,x=1; char ch=getchar(); while(ch 阅读全文
摘要:
莫队+重点轻点 题意:给你n个点(每个点都有一个颜色,0代表黑色,1代表白色),m条边,每条边有一个权值.现在有有两个操作,一个是修改某个点的颜色(白变成黑/黑变成白),另外一个是询问那些边的两个端点都为指定颜色的权值总和 分析:将所有点分为重点和轻点,但是这次重点和重点之前的边要建在一个图中,剩余 阅读全文
摘要:
https://www.luogu.org/problemnew/show/P1494 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int M=5e4+4; 5 struct nod 阅读全文