题目:http://poj.org/problem?id=1753
这个题在开始接触的训练计划的时候做过,当时用的是DFS遍历,其机制就是把每个棋子翻一遍,然后顺利的过了,所以也就没有深究。
省赛前一次做PC2遇到了机会一模一样的题,只不过是把棋盘的界限由4X4改为了5X5,然后一直跑不出结果来,但是当时崔老湿那个队过了,在最后总结的时候,崔老湿就说和这个题一样,不过要枚举第一行进行优化。...
分类:
其他好文 时间:
2014-06-20 12:47:10
阅读次数:
205
Java集合01----ArrayList的遍历方式及应用
1.ArrayList的遍历方式
a.一般for循环(随机访问)
Integer value = null;
int size = list.size();
for (int i=0; i<size; i++) {
value = (Integer)list.get(i);
}
b.增强型for循环(for...
分类:
编程语言 时间:
2014-06-20 10:22:41
阅读次数:
240
泛型:泛型只是提供给编译器。在编译完之后,生产字节码文件时就擦除类型信息,泛型就不在了泛型的术语:整个Arraylist:称为泛型类型。Arraylist中的E称为类型变量或类型参数整个Arraylisst称为:参数化的类型Arraylist中的Integer称为类型参数的实例。Arraylist中...
分类:
其他好文 时间:
2014-06-11 08:03:03
阅读次数:
265
题目描述In the Game Red Alert, a group of soviet
infantry marches towards our base. And we have N Prism Tanks to defend our base.
Suppose the coming infan...
分类:
其他好文 时间:
2014-06-11 07:18:54
阅读次数:
285
static void jindutiao_ZF(Args _args){
RunBaseProgress progress; integer i,j;; i = 10000; progress = new...
分类:
其他好文 时间:
2014-06-08 07:24:32
阅读次数:
189
JDK1.5之后的功能自动装箱:指的是开发人员可以把一个基本数据类型直接赋给对应的包装类自动拆箱:指开发人员可以把一个包装类对象直接赋给对应的基本数据类型public
static void main(String[] args) { Integer i = 1; //装箱 int j...
分类:
编程语言 时间:
2014-06-07 23:38:09
阅读次数:
350
Evaluate the value of an arithmetic expression
in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be
an integer or another ex...
分类:
其他好文 时间:
2014-06-07 20:34:41
阅读次数:
214
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca...
分类:
其他好文 时间:
2014-06-07 12:21:30
阅读次数:
284
这个题比较简单,考虑特殊情况如12000,注意检查反转后数字是否会越界溢出。...
分类:
其他好文 时间:
2014-06-07 12:01:08
阅读次数:
258