题目链接:Codeforces Round #403 div2 C. Andryusha and Colored Balloons 题意: 给你一棵n个节点的树,然后让你染色,规定相连的三个 节点不能同色,问需要的最少颜色,并输出其中一种方案。 题解: 因为只有相邻3个节点不同色。 所以直接DFS, ...
分类:
其他好文 时间:
2017-03-06 14:35:42
阅读次数:
204
Codeforces #403 Div1.A~D(Div2.B~F)简要题解 [ Div2.B.The Meeting Place Cannot Be Changed | A.Andryusha and Colored Balloons | B.Innokenty and a Football L... ...
分类:
其他好文 时间:
2017-03-06 12:12:16
阅读次数:
262
题意:给定n个立方体,让你重新涂尽量少的面,使得所有立方体都相同。 析:暴力求出每一种姿态,然后枚举每一种立方体的姿态,求出最少值。 代码如下: ...
分类:
其他好文 时间:
2017-02-17 00:07:55
阅读次数:
169
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
分类:
其他好文 时间:
2017-02-02 10:47:18
阅读次数:
157
3093: [Fdu校赛2012] A Famous Game Description Mr. B and Mr. M like to play with balls. They have many balls colored in blue and red. Firstly, Mr. B rand ...
分类:
其他好文 时间:
2017-01-23 15:32:31
阅读次数:
191
f(i,j,S)表示到(i,j),且经由的路径上的颜色集合为S的价值的最小值,从上方和左方转移过来即可。 要注意,内存不足,需要滚动数组优化,即使用了map,还是需要。 路径输出的时候,可以再跑一遍dp,这样就不用再开一个大数组了。 我的写法比较菜。卡了常数 ...
分类:
编程语言 时间:
2017-01-15 22:56:01
阅读次数:
261
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
分类:
其他好文 时间:
2017-01-07 09:08:10
阅读次数:
175
http://poj.org/problem?id=1979 Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is ...
分类:
其他好文 时间:
2016-12-07 20:03:53
阅读次数:
304
Red and Black Problem Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing ...
分类:
其他好文 时间:
2016-11-08 01:27:19
阅读次数:
167
Time Limit: 5000MS Memory Limit: 128000K Total Submissions: 36032 Accepted: 9427 Description You are given a bunch of wooden sticks. Each endpoint of ...
分类:
其他好文 时间:
2016-11-01 19:38:03
阅读次数:
191