3.4.1的破解,谢谢
spiritjp@163.com
@LINQ
不知道你是不是播放win分区的文件?是的话要先加载win分区后才能播放
re: Google编程挑战赛250分题目及答案 Spirit 2005-12-15 13:32
一种递归解法:
public class SkipStones {
private String water = "...X...";
public int maxDistance(String water) {
this.water = water;
int max = 0;
int sum = 0;
for (int initial = 1; initial < water.length() + 1; initial++) {
sum = bounce(0, initial);
max = (sum > max ? sum : max);
}
return max;
}
private int bounce(int startDistance, int bounceDistance) {
if (bounceDistance == 0)
return startDistance;
if ((startDistance + bounceDistance) > water.length())
return -1;
if (water.charAt(startDistance + bounceDistance - 1) == 'X')
return startDistance;
return bounce(startDistance + bounceDistance, bounceDistance / 2);
}
public static void main(String[] args) {
SkipStones skipStones = new SkipStones();
System.out.println(skipStones.maxDistance(args[0]));
}
}