题目描述超牛{ superbull.pas/c/cpp} 农场有N (1 t2 then begin father[t1]:=t2; ans:=ans+cost[i]; end; end;end; procedure qsort(a,b:longint);var i,j,x,te...
分类:
其他好文 时间:
2015-04-19 17:47:42
阅读次数:
155
题意:
n*m块区域,每一块有正反两面,两面分别是白色和黑色。
翻转一块区域的同时, 与其相邻的四块区域也会同时被反转
问最少需要翻转的次数 ,使所有的区域都变成白色 输出其翻转方案
思路:
枚举第一行的翻转状态
如果已经知道了第一行的状态,那么后面几行的状态就随之确定了——(如果该区域的上面一个区域是黑色,那这个区域必然是要反转才能让他上面的区域变成白色)
然后比较和记录最少的...
分类:
其他好文 时间:
2015-04-14 07:19:47
阅读次数:
141
DIV居中:<divstyle="margin-left:auto;margin-right:auto;width:760px;background-color:Silver;">DIV居中CSS代码<ahref="http://jihua.cnblogs.com">jihua.cnblogs.com</a></div>DIV靠右:<divstyle="margin-left:auto;margin-right:2px;width:760..
分类:
其他好文 时间:
2015-04-13 07:12:11
阅读次数:
113
题意:
总共最多有15种疾病
有n头牛,每头牛有di种疾病,分别用1-15之间的数字来表示
要求选择最多头牛 使他们的疾病种数不超过K
思路:
枚举状态,状态是当前有哪几种病,然后判断每头牛是否能选择即可
code:
#include
#include
#include
using namespace std;
const int maxn = 40000;
int cow[10...
分类:
其他好文 时间:
2015-04-11 17:54:38
阅读次数:
104
一、CSS四种选择器
1. 类选择器(class选择器)
基本使用
.类选择器{
属性名: 属性值;
….
}
2. id选择器
基本使用
#id选择器{
属性名: 属性值;
….
}
案例:
/*id选择器的使用*/
#id1{
background-color:silver...
分类:
Web程序 时间:
2015-04-10 22:36:37
阅读次数:
175
标准颜色名称和RGB颜色值
Black = #000000
Green = #008000
Silver = #C0C0C0
Lime = #00FF00
Gray = #808080
Olive = #808000
White = #FFFFFF
Yellow = #FFFF00
Maroon = #800000
Navy = #000080
Red = #FF0000
...
分类:
其他好文 时间:
2015-03-31 18:03:25
阅读次数:
154
Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ ...
分类:
其他好文 时间:
2015-03-15 00:32:06
阅读次数:
159
类似BackpackII问题 1 static int maximize_loot(int[] gold, int[] silver) { 2 int[][] res = new int[gold.length+silver.length+1][10001]; 3 ...
分类:
系统相关 时间:
2015-03-07 06:16:13
阅读次数:
251
题目大意:给出一个单向带权图和一个点s,求点u,u到s的最短路径和s到u的最短路径之和最大。
先求一次dijkstra,然后把所有的边反向,权值不变,再求一次dijkstra,将两者加起来求最大的值就是所求的答案。
#include
#include
#include
#include
using namespace std;
const int maxn=1010;
cons...
分类:
编程语言 时间:
2015-03-02 09:36:09
阅读次数:
206
关于设计模式,我觉得一个软件工程领域的准则特别适用:No Silver Bullet——没有银弹。设计模式越来越多的走向神坛,和MVC概念一样,简单的东西变得越来越复杂,在开发变得越来越庞大的同时,需要记住,简洁也是一种美。下文是译言网的一篇文章,指出了设计模式的滥用,当设计模式变得流行后,我在一个...
分类:
其他好文 时间:
2015-02-28 10:06:07
阅读次数:
361