欢迎来到SFWR的博客

11 2019 档案

摘要:LCA倍增+大眼观察 #include<bits/stdc++.h> using namespace std; int n,m,a,b,ne,c,head[1001000],fa[501000][26],d[501000]; struct node{int nxt,v;}eg[1001000]; v 阅读全文
posted @ 2019-11-14 11:20 SFWR 阅读(78) 评论(0) 推荐(0) 编辑
摘要:复习一下树的直径,多次dfs求解 #include<bits/stdc++.h> using namespace std; int n,m,a,b,ne,c,tpo=1,tp=1,head[405000]; long long ans,d[205000][2],dl[205000]; struct 阅读全文
posted @ 2019-11-14 09:36 SFWR 阅读(77) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; int n,m,a,b,c,ne,tot,head[100008*30],ch[100008*30][3];long long val[100008*30],ans=-1; struct node{int nx 阅读全文
posted @ 2019-11-14 07:01 SFWR 阅读(122) 评论(0) 推荐(0) 编辑
摘要:复习一下scc #include<bits/stdc++.h> using namespace std; const int bw=1000001; int head[bw],head2[bw],low[bw],rd[bw],vist[bw],f[bw],nc[bw],vd[bw],dfn[bw], 阅读全文
posted @ 2019-11-13 22:01 SFWR 阅读(106) 评论(0) 推荐(0) 编辑
摘要:给出一个N次函数,保证在范围[l,r]内存在一点x,使得[l,x]上单调增,[x,r]上单调减。试求出x的值。 学习一下三分法 #include<bits/stdc++.h> using namespace std; const double dbs=0.000001; double l,r,num 阅读全文
posted @ 2019-11-13 07:05 SFWR 阅读(133) 评论(0) 推荐(0) 编辑
摘要:lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示。当他使用某种装备时,他只能使用该装备的某一个属性。并且每种装备最多只能使用一次。 游戏进行到最后,lxhgww遇到了终极boss,这个终极boss很奇怪,攻击他的装备所使用 阅读全文
posted @ 2019-11-12 21:21 SFWR 阅读(78) 评论(0) 推荐(0) 编辑
摘要:八中还是清新 比较水的一个并查集二分 #include<bits/stdc++.h> using namespace std; struct node{int a,b,c,d;}num[200000]; int f[200000],n,m,k; int find(int x){if(f[x]==x) 阅读全文
posted @ 2019-11-11 21:49 SFWR 阅读(88) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示