0_0_39667370_12937\Main.java:4: 错误: 需要class, interface或enum
public HDU_4004 {
^
0_0_39667370_12937\Main.java:5: 错误: 需要class, interface或enum
public static void main(String[] args) {
^
0_0_39667370_12937\Main.java:8: 错误: 需要class, interface或enum
while (sc.hasNext()) {
^
0_0_39667370_12937\Main.java:10: 错误: 需要class, interface或enum
int n = sc.nextInt(); // 石头的数量
^
0_0_39667370_12937\Main.java:11: 错误: 需要class, interface或enum
int m = sc.nextInt(); // 最多跳跃次数
^
0_0_39667370_12937\Main.java:14: 错误: 需要class, interface或enum
int[] stones = new int[n + 2];
^
0_0_39667370_12937\Main.java:15: 错误: 需要class, interface或enum
stones[0] = 0; // 起点
^
0_0_39667370_12937\Main.java:16: 错误: 需要class, interface或enum
for (int i = 1; i <= n; i++) {
^
0_0_39667370_12937\Main.java:16: 错误: 需要class, interface或enum
for (int i = 1; i <= n; i++) {
^
0_0_39667370_12937\Main.java:16: 错误: 需要class, interface或enum
for (int i = 1; i <= n; i++) {
^
0_0_39667370_12937\Main.java:18: 错误: 需要class, interface或enum
}
^
0_0_39667370_12937\Main.java:22: 错误: 需要class, interface或enum
Arrays.sort(stones);
^
0_0_39667370_12937\Main.java:24: 错误: 需要class, interface或enum
int left = 1, right = L, result = L;
^
0_0_39667370_12937\Main.java:25: 错误: 需要class, interface或enum
while (left <= right) {
^
0_0_39667370_12937\Main.java:27: 错误: 需要class, interface或enum
if (canCrossRiver(stones, n, m, mid)) {
^
0_0_39667370_12937\Main.java:29: 错误: 需要class, interface或enum
right = mid - 1; // 尝试找更小的能力
^
0_0_39667370_12937\Main.java:30: 错误: 需要class, interface或enum
} else {
^
0_0_39667370_12937\Main.java:32: 错误: 需要class, interface或enum
}
^
0_0_39667370_12937\Main.java:37: 错误: 需要class, interface或enum
}
^
0_0_39667370_12937\Main.java:40: 错误: 需要class, interface或enum
}
^
0_0_39667370_12937\Main.java:45: 错误: 需要class, interface或enum
int jumps = 0; // 跳跃次数
^
0_0_39667370_12937\Main.java:46: 错误: 需要class, interface或enum
for(int i = 1 ; i < n+2 ; i++)
^
0_0_39667370_12937\Main.java:46: 错误: 需要class, interface或enum
for(int i = 1 ; i < n+2 ; i++)
^
0_0_39667370_12937\Main.java:46: 错误: 需要class, interface或enum
for(int i = 1 ; i < n+2 ; i++)
^
0_0_39667370_12937\Main.java:49: 错误: 需要class, interface或enum
while(i < n+2 && lastPosition + maxJump >= stones[i])
^
0_0_39667370_12937\Main.java:52: 错误: 需要class, interface或enum
}
^
0_0_39667370_12937\Main.java:54: 错误: 需要class, interface或enum
lastPosition = stones[i];
^
0_0_39667370_12937\Main.java:55: 错误: 需要class, interface或enum
jumps++;
^
0_0_39667370_12937\Main.java:56: 错误: 需要class, interface或enum
if(jumps > m)return false;
^
0_0_39667370_12937\Main.java:57: 错误: 需要class, interface或enum
}
^
0_0_39667370_12937\Main.java:59: 错误: 需要class, interface或enum
}
^
31 个错误
|