随笔分类 -  搜索

摘要:emm,a出3题,补了两题 A,B水题 #include<bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define read(a) scanf("%d",&a 阅读全文
posted @ 2017-10-02 20:17 walfy 阅读(265) 评论(0) 推荐(0)
摘要:花了6个小时,终于成功ac。。。。。。 两边dfs,第一遍求子树和,第二遍判断有没有2*t【s】/3和t【s】/3,因为要求的节点可能是在同一条线上,同时要有2*t【s】/3和t【s】/3的情况,且2*t【s】/3距根节点更近 还要注意的是如果同一条线上有两个t【s】/3的点是行不通的,必须要在两个 阅读全文
posted @ 2017-08-04 15:24 walfy 阅读(308) 评论(0) 推荐(0)
摘要:两边bfs,先一边找到从1到n的路径并记录下来,然后挨个标记,最后一边bfs找1能到达的点,比较一下就行了 #include<map> #include<set> #include<cmath> #include<queue> #include<stack> #include<vector> #in 阅读全文
posted @ 2017-07-16 10:21 walfy 阅读(206) 评论(0) 推荐(0)
摘要:给n个圆要么包含,要么相分离,没有两个公共点,当成一棵树,把包含的面积大的放在上面 如图最上面的par记为-1,level记为0,当par 1||level==1时就加否则减, 就是第一,二层先加,第三层减,然后后面的一直交替就行了 #include<map> #include<set> #incl 阅读全文
posted @ 2017-06-18 23:29 walfy 阅读(130) 评论(0) 推荐(0)
摘要:After retirement as contestant from WHU ACM Team, flymouse volunteered to do the odds and ends such as cleaning out the computer lab for training as e 阅读全文
posted @ 2017-04-06 14:14 walfy 阅读(246) 评论(0) 推荐(0)
摘要:vector当邻接表存图 C. Online Courses In BSU time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. 阅读全文
posted @ 2017-03-24 17:55 walfy 阅读(182) 评论(0) 推荐(0)