E. Bear and Drawing】的更多相关文章

     E. Bear and Drawing time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Limak is a little bear who learns to draw. People usually start with houses, fences and flowers but why would bears…
Limak is a little bear who learns to draw. People usually start with houses, fences and flowers but why would bears do it? Limak lives in the forest and he decides to draw a tree. Recall that tree is a connected graph consisting of n vertices and n -…
正解:构造 解题报告: 传送门! 这题首先可以画下图找下规律,,,然后通过找规律可以发现,最终的方案一定是一条主干+一些枝条,而且这些枝条的分杈一定小于等于2 明确一下主干的定义,最左边的节点和最右边的节点之间的路径为主干 如图…
题目链接:http://codeforces.com/contest/573/problem/C题目大意:在两行无限长的点列上面画n个点以及n-1条边使得构成一棵树,并且要求边都在同一平面上且除了节点处任意两条边之间没有公共交点.给定n和n-1条边的关系,问这棵树能否满足要求地画在这个两行平行点列上? 解题思路:我们假设这么k一棵树已经被画好在了这个两行平行点列上,我们在其中选择最左边地点和最右边的点,并且设连接最左边的点和最右边的点为主链,可以发现,在树所在地区域内,主链会将剩下的区域划分为零…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud 这场的前两题完全是手速题...A题写了7分钟,交的时候已经500+了,好在B题出的速度勉强凑活吧,and C题也没有FST A. Bear and Poker Limak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are n pla…
以后每做完一场CF,解题报告都写在一起吧   暴力||二分 A - Bear and Elections 题意:有n个候选人,第一个候选人可以贿赂其他人拿到他们的票,问最少要贿赂多少张票第一个人才能赢 分析:正解竟然是暴力!没敢写暴力,卡了很久,导致这场比赛差点爆零!二分的话可以优化,但对于这题来说好像不需要... 收获:以后CF div2的A题果断暴力   代码(暴力): /************************************************ * Author :R…
D. Bear and Two Paths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bearland has n cities, numbered 1 through n. Cities are connected via bidirectional roads. Each road connects two dist…
C. Bear and Square Grid time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You have a grid with n rows and n columns. Each cell is either empty (denoted by '.') or blocked (denoted by 'X'). T…
D. Bear and Two Paths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bearland has n cities, numbered 1 through n. Cities are connected via bidirectional roads. Each road connects two dist…
D. Bear and Tree Jumps   A tree is an undirected connected graph without cycles. The distance between two vertices is the number of edges in a simple path between them. Limak is a little polar bear. He lives in a tree that consists of n vertices, num…