이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
import java.util.Arrays;
public class vision {
public void construct_network(int H, int W, int K) {
int commands = 0;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (j + K < W) {
int[] command = {i * W + j, i * W + j + K};
grader.add_and(command);
commands++;
}
for (int k = i + 1; k < H; k++) {
int remaining = K - k + i;
if (remaining > 0) {
if (j + remaining < W) {
int[] command = {i * W + j, k * W + j + remaining};
grader.add_and(command);
commands++;
}
if (j - remaining >= 0) {
int[] command = {i * W + j, k * W + j - remaining};
//System.out.println(Arrays.toString(command));
grader.add_and(command);
commands++;
}
} else if (remaining == 0) {
int[] command = {i * W + j, k * W + j};
grader.add_and(command);
commands++;
}
}
}
}
int[] command = new int[commands];
for (int i = H * W, j = 0; j < commands; i++, j++) command[j] = i;
grader.add_or(command);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |