题目: Mr. Panda likes ice cream very much especially the ice cream tower. An ice cream tower consists of K ice cream balls stacking up as a tower. In order to make the tower stable, the lower ice cream ball should be at least twice as large as the ball…
2017-08-18 21:53:38 writer:pprp 题意如下: Problem D. Ice Cream Tower Input file: Standard Input Output file: Standard Ouptut Time limit: seconds Mr. Panda likes ice cream very much especially the ice cream tower. An ice cream tower consists of K ice crea…
传送门 分析 这道题做了好长时间,题意就很难理解. 我们注意到这句话Vertices which have the i-th (1 ≤ i ≤ m) type of ice cream form a connected subgraph 也就是说在最后的图中相同颜色的点构成一个连通图 也就是说如果1和2.3在不同的点共同出现,那么2和3一定不会在某个点共同出现.于是我们可以直接暴力dfs,在每个点对没有颜色的冰激凌贪心染最小的颜色. 需要注意有某种冰激凌没有出现的情况. trick 代码 #in…