
dfs
Cherry_0525
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【Tarjan+建反边+dfs】HDU - 3639 L - Hawk-and-Chicken
L - Hawk-and-Chicken HDU - 3639 Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk. S...原创 2018-09-01 00:24:29 · 164 阅读 · 0 评论 -
【连通块+bfs】F - Paint the Grid Reloaded ZOJ - 3781
F - Paint the Grid Reloaded ZOJ - 3781 Leo has a grid withNrows andMcolumns. All cells are painted with either black or white initially. Two cellsAandBare calledconnectedif they share an e...原创 2019-04-12 20:53:30 · 389 阅读 · 0 评论 -
【拓扑排序+dfs】Frame Stacking POJ - 1128
Frame Stacking POJ - 1128 Consider the following 5 picture frames placed on an 9 x 8 array. ........ ........ ........ ........ .CCC.... EEEEEE.. ........ ........ ..BBBB.. .C.C.... E....E.. DD...原创 2019-04-15 16:25:57 · 207 阅读 · 0 评论 -
【DFS+思维】codeforces 1092 F. Tree with Maximum Cost
F. Tree with Maximum Cost time limit per test 2 seconds memory limit per test 256 megabytes You are given a tree consisting exactly ofnnvertices. Tree is a connected undirected graph withn−1n−...原创 2019-04-02 18:09:17 · 264 阅读 · 0 评论 -
【DFS+思维】F1. Tree Cutting (Easy Version)
http://codeforces.com/contest/1118/problem/F1 F1. Tree Cutting (Easy Version) time limit per test 2 seconds You are given an undirected tree ofnnvertices. Some vertices are colored blue, some a...原创 2019-03-27 19:30:30 · 315 阅读 · 0 评论 -
【DFS+pair+思维】保留1节点的度数为d,求树 F2. Spanning Tree with One Fixed Degree Codeforces Round #544 (Div. 3)
F2. Spanning Tree with One Fixed Degree Codeforces Round #544 (Div. 3) http://codeforces.com/problemset/problem/1133/F2 time limit per test 3 seconds memory limit per test 256 megabytes ...原创 2019-03-15 20:51:52 · 237 阅读 · 0 评论 -
【DFS+线段树】以不同节点为根,求第k小的子树大小 CF 2016-2017 BSUIR Contest E. Kth subtree
E. Kth subtree 2016-2017 7th BSUIR Open Programming Contest. Semifinal http://codeforces.com/gym/102134/problem/E E. Kth subtree time limit per test 2.0 s memory limit per test 256 MB input s...原创 2019-03-14 20:50:25 · 555 阅读 · 0 评论 -
【dfs】洛谷 P1087 FBI树 建树版和非建树版
洛谷 P1087 FBI树 https://www.luogu.org/problemnew/show/P1087 题目描述 我们可以把由“0”和“1”组成的字符串分为三类:全“0”串称为B串,全“1”串称为I串,既含“0”又含“1”的串则称为F串。 FBI树是一种二叉树,它的结点类型也包括F结点,B结点和I结点三种。由一个长度为2^N的“01”串S可以构造出一棵FBI树T,递归的构造方法...原创 2019-03-05 16:48:18 · 125 阅读 · 0 评论 -
【DFS+思维】 GYM101620J Justified Jungle
http://codeforces.com/gym/101620/attachments #include <bits/stdc++.h> using namespace std; set <int> s; int head[1000005],to[2000005],nxt[2000005],Size[1000005],num[1000005]; int tot,...原创 2018-11-08 21:05:53 · 243 阅读 · 0 评论 -
【DFS+思维】HDU - 6228 L - Tree
L - Tree HDU - 6228 Consider a un-rooted tree T which is not the biological significance of tree or plant, but a tree as an undirected graph in graph theory with n nodes, labelled from 1 to n. If yo...原创 2018-09-28 19:22:13 · 228 阅读 · 0 评论 -
【DFS+剪枝】HDU - 5113 B - Black And White
B - Black And White HDU - 5113 In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous regions, producing a figure called ...原创 2018-09-20 19:42:28 · 193 阅读 · 0 评论 -
【DFS算方案数】AtCoder Beginner Contest 133 E - Virus Tree 2
https://atcoder.jp/contests/abc133/tasks/abc133_e E - Virus Tree 2 Time Limit: 2 sec / Memory Limit: 1024 MB Score :500500points Problem Statement You are given a tree withNNvertices andN...原创 2019-07-08 16:09:58 · 429 阅读 · 0 评论