本月博客排行
-
第1名
arpenker -
第2名
kaizi1992 -
第3名
wy_19921005
年度博客排行
-
第1名
龙儿筝 -
第2名
宏天软件 -
第3名
青否云后端云 - wallimn
- vipbooks
- gashero
- wy_19921005
- benladeng5225
- fantaxy025025
- javashop
- e_e
- tanling8334
- arpenker
- sam123456gz
- kaizi1992
- zysnba
- xiangjie88
- lemonhandsome
- ganxueyun
- xyuma
- Xeden
- wangchen.ily
- zhanjia
- jh108020
- johnsmith9th
- zxq_2017
- jbosscn
- forestqqqq
- ajinn
- daizj
- xpenxpen
- wjianwei666
- ranbuijj
- 喧嚣求静
- kingwell.leng
- silverend
- lchb139128
- kristy_yy
- jveqi
- lich0079
- lzyfn123
- java-007
- sunj
- yeluowuhen
- lerf
- xiaoxinye
- flashsing123
- zhangjijun
- lxguy
- lyndon.lin
最新文章列表
【最短路+dfs+dijkstra】杭电 hdu 1142 A Walk Through the Forest
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights reserved.
URL : http://acm.hdu.edu ...
hdu 1298 T9(字典树+dfs)
T9
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 674 Accepted Submission(s): 271
Problem Description
A while ago it was quite cumbersome ...
DFSConfigKeys分布式文件参数
/**
* This class contains constants for configuration keys used
* in hdfs.
*
*/
@InterfaceAudience.Private
public class DFSConfigKeys extends CommonConfigurationKeys {
public static final ...
杭电 hdu 2717 Catch That Cow
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights reserved.
URL : http://acm.hdu.edu.cn ...
杭电 hdu 1312 Red and Black
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights reserved.
URL : http://acm.hdu.edu.cn ...
杭电 hdu 1241 Oil Deposits
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights reserved.
URL : http://acm.hdu.edu.cn ...
杭电 hdu 1045 Fire Net
这题有点意思……
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights reserved.
URL : http://ac ...
杭电 hdu 2614 Beat
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights reserved.
URL : http://acm.hdu.edu.cn ...
杭电 hdu 1035 Robot Motion
嘿嘿,一次AC……哦耶~~~
总得来说不算是难题,不过在处理坐标的时候出了问题,呃,这个代码中会有略微提到,因为比较简单,就不多说了,相信通过自己测试数据,也能理解的。
/* THE PROGRAM IS MADE BY PYY */
/*---------------------------------------------------------------------------- ...
hdu 1016 Prime Ring Problem
简单的搜索题,用递归
/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
Copyright (c) 2011 panyanyany All rights reserved.
URL : http://ac ...
HDU 2553 N皇后问题 .
N皇后问题
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1753 Accepted Submission(s): 769
Problem Description
在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个 ...
HDU 1028 Ignatius and the Princess III .
Ignatius and the Princess III
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4658 Accepted Submission(s): 3263
Problem Description
"W ...
HDU 1010 Tempter of the Bone .
Tempter of the Bone
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23728 Accepted Submission(s): 6527
Problem Description
The doggie found ...
USACO Section 1.5.4 [Checker Challenge] Java题解
题意分析:
该题是需要深度优化的八皇后问题,首先看一下,经典八皇后问题的一般解法:
public class Queens {
private final static int MAX = 8;
// site[i] = j => col:i row:j
private static int[] site = new int[MAX];
private static b ...
USACO Section 1.5.3 [Superprime Rib] Java题解
题意分析:
7331是素数,733是素数,73是素数,7也是素数。这样7331就是我们要的。给定位数N,就所有这样的数
解题思路:
这题也是用递归。初始的数只可能为{2,3,5,7},递归时检查不是素数就退出,是的话for i = 0: 9 dfs(10*num+i)继续递归,如果位数到了N且是素数,则输出。
代码实现:
https://github.com/leonlu/USACOJavaSo ...
USACO Section 1.5.2 [Prime Palindromes] Java题解
题意分析:
找出a和b间既对称既是素数的数。
解题思路:
用递归去解这题。初始数据为单个的0-9和双数的00-99,扔进递归里每次在两边加0-9再递归,直到过长(大于b的长度)。这样每次递归的参数都可能是要的数值,所以递归方法首先要检查是否满足条件,除了要检查是否是素数、是否在[a,b]之间,还要注意有前导零的是不符合条件的。
素数检查代码,一般不需要写到究极,如下的就可用了。
if(tmp % ...
USACO Section 1.4.4 [Mother's Milk] Java题解
题意分析:
有容量为A,B,C的三个牛奶桶,容量范围为1-20。开始时,A,B为空C为满。三个桶之间一个桶倒入另一个桶来回倒(要么倒满,要么倒光)。给定A,B,C。求A桶为空时C的可能值。
解题思路:
用DFS解。用searched[x][y]数组记录搜索过的状态,不使用三维数组是因为前2维决定了第三维。用amount[z]的布尔值记录当x=0时z的值。
private static void d ...
USACO Section 1.4.2 [The Clocks] Java题解
题意分析:
有编号为A-I的9个时钟,时钟只有指向3、6、9、12四种状态,一次转动只能顺时针转90度,已知9种转动方式,每种转动方式指定不同的几个钟顺时针转90度,要使所有钟都回到12点,根据不同的输入,要如何组合这9种转动方式呢?找出最短序列,同样长度的情况下以序列编号小为先。
解题思路1:
某一种转动方式若使用4次即没使用。因此1-9每一种转动方式至多使用4次,因此9种转动方式最多产生4(e ...