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 |
1 |
Correct |
76 ms |
10232 KB |
Output is correct |
2 |
Correct |
77 ms |
10104 KB |
Output is correct |
3 |
Correct |
78 ms |
10104 KB |
Output is correct |
4 |
Correct |
75 ms |
10340 KB |
Output is correct |
5 |
Correct |
77 ms |
10232 KB |
Output is correct |
6 |
Correct |
77 ms |
10252 KB |
Output is correct |
7 |
Correct |
79 ms |
10228 KB |
Output is correct |
8 |
Correct |
79 ms |
10216 KB |
Output is correct |
9 |
Correct |
79 ms |
10120 KB |
Output is correct |
10 |
Correct |
88 ms |
10360 KB |
Output is correct |
11 |
Correct |
87 ms |
10240 KB |
Output is correct |
12 |
Correct |
81 ms |
10216 KB |
Output is correct |
13 |
Correct |
82 ms |
10104 KB |
Output is correct |
14 |
Correct |
86 ms |
10216 KB |
Output is correct |
15 |
Correct |
88 ms |
10348 KB |
Output is correct |
16 |
Correct |
79 ms |
10356 KB |
Output is correct |
17 |
Correct |
81 ms |
10104 KB |
Output is correct |
18 |
Correct |
79 ms |
10228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
76 ms |
10232 KB |
Output is correct |
2 |
Correct |
77 ms |
10104 KB |
Output is correct |
3 |
Correct |
78 ms |
10104 KB |
Output is correct |
4 |
Correct |
75 ms |
10340 KB |
Output is correct |
5 |
Correct |
77 ms |
10232 KB |
Output is correct |
6 |
Correct |
77 ms |
10252 KB |
Output is correct |
7 |
Correct |
79 ms |
10228 KB |
Output is correct |
8 |
Correct |
79 ms |
10216 KB |
Output is correct |
9 |
Correct |
79 ms |
10120 KB |
Output is correct |
10 |
Correct |
88 ms |
10360 KB |
Output is correct |
11 |
Correct |
87 ms |
10240 KB |
Output is correct |
12 |
Correct |
81 ms |
10216 KB |
Output is correct |
13 |
Correct |
82 ms |
10104 KB |
Output is correct |
14 |
Correct |
86 ms |
10216 KB |
Output is correct |
15 |
Correct |
88 ms |
10348 KB |
Output is correct |
16 |
Correct |
79 ms |
10356 KB |
Output is correct |
17 |
Correct |
81 ms |
10104 KB |
Output is correct |
18 |
Correct |
79 ms |
10228 KB |
Output is correct |
19 |
Correct |
91 ms |
10112 KB |
Output is correct |
20 |
Correct |
83 ms |
10380 KB |
Output is correct |
21 |
Correct |
86 ms |
10356 KB |
Output is correct |
22 |
Correct |
78 ms |
10344 KB |
Output is correct |
23 |
Correct |
82 ms |
10104 KB |
Output is correct |
24 |
Correct |
88 ms |
10604 KB |
Output is correct |
25 |
Correct |
90 ms |
10728 KB |
Output is correct |
26 |
Correct |
77 ms |
10216 KB |
Output is correct |
27 |
Correct |
76 ms |
10052 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
76 ms |
10232 KB |
Output is correct |
2 |
Correct |
77 ms |
10104 KB |
Output is correct |
3 |
Correct |
78 ms |
10104 KB |
Output is correct |
4 |
Correct |
75 ms |
10340 KB |
Output is correct |
5 |
Correct |
77 ms |
10232 KB |
Output is correct |
6 |
Correct |
77 ms |
10252 KB |
Output is correct |
7 |
Correct |
79 ms |
10228 KB |
Output is correct |
8 |
Correct |
79 ms |
10216 KB |
Output is correct |
9 |
Correct |
79 ms |
10120 KB |
Output is correct |
10 |
Correct |
88 ms |
10360 KB |
Output is correct |
11 |
Correct |
87 ms |
10240 KB |
Output is correct |
12 |
Correct |
81 ms |
10216 KB |
Output is correct |
13 |
Correct |
82 ms |
10104 KB |
Output is correct |
14 |
Correct |
86 ms |
10216 KB |
Output is correct |
15 |
Correct |
88 ms |
10348 KB |
Output is correct |
16 |
Correct |
79 ms |
10356 KB |
Output is correct |
17 |
Correct |
81 ms |
10104 KB |
Output is correct |
18 |
Correct |
79 ms |
10228 KB |
Output is correct |
19 |
Correct |
91 ms |
10112 KB |
Output is correct |
20 |
Correct |
83 ms |
10380 KB |
Output is correct |
21 |
Correct |
86 ms |
10356 KB |
Output is correct |
22 |
Correct |
78 ms |
10344 KB |
Output is correct |
23 |
Correct |
82 ms |
10104 KB |
Output is correct |
24 |
Correct |
88 ms |
10604 KB |
Output is correct |
25 |
Correct |
90 ms |
10728 KB |
Output is correct |
26 |
Correct |
77 ms |
10216 KB |
Output is correct |
27 |
Correct |
76 ms |
10052 KB |
Output is correct |
28 |
Incorrect |
100 ms |
12232 KB |
WA in grader: Too many instructions |
29 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
76 ms |
10232 KB |
Output is correct |
2 |
Correct |
77 ms |
10104 KB |
Output is correct |
3 |
Correct |
78 ms |
10104 KB |
Output is correct |
4 |
Correct |
75 ms |
10340 KB |
Output is correct |
5 |
Correct |
77 ms |
10232 KB |
Output is correct |
6 |
Correct |
77 ms |
10252 KB |
Output is correct |
7 |
Correct |
79 ms |
10228 KB |
Output is correct |
8 |
Correct |
79 ms |
10216 KB |
Output is correct |
9 |
Correct |
79 ms |
10120 KB |
Output is correct |
10 |
Correct |
88 ms |
10360 KB |
Output is correct |
11 |
Correct |
87 ms |
10240 KB |
Output is correct |
12 |
Correct |
81 ms |
10216 KB |
Output is correct |
13 |
Correct |
82 ms |
10104 KB |
Output is correct |
14 |
Correct |
86 ms |
10216 KB |
Output is correct |
15 |
Correct |
88 ms |
10348 KB |
Output is correct |
16 |
Correct |
79 ms |
10356 KB |
Output is correct |
17 |
Correct |
81 ms |
10104 KB |
Output is correct |
18 |
Correct |
79 ms |
10228 KB |
Output is correct |
19 |
Correct |
91 ms |
10112 KB |
Output is correct |
20 |
Correct |
83 ms |
10380 KB |
Output is correct |
21 |
Correct |
86 ms |
10356 KB |
Output is correct |
22 |
Correct |
78 ms |
10344 KB |
Output is correct |
23 |
Correct |
82 ms |
10104 KB |
Output is correct |
24 |
Correct |
88 ms |
10604 KB |
Output is correct |
25 |
Correct |
90 ms |
10728 KB |
Output is correct |
26 |
Correct |
77 ms |
10216 KB |
Output is correct |
27 |
Correct |
76 ms |
10052 KB |
Output is correct |
28 |
Incorrect |
100 ms |
12232 KB |
WA in grader: Too many instructions |
29 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
83 ms |
10232 KB |
Output is correct |
2 |
Correct |
78 ms |
10100 KB |
Output is correct |
3 |
Correct |
84 ms |
9988 KB |
Output is correct |
4 |
Correct |
77 ms |
10240 KB |
Output is correct |
5 |
Correct |
80 ms |
10232 KB |
Output is correct |
6 |
Correct |
83 ms |
10228 KB |
Output is correct |
7 |
Correct |
84 ms |
10080 KB |
Output is correct |
8 |
Correct |
89 ms |
10116 KB |
Output is correct |
9 |
Correct |
85 ms |
10356 KB |
Output is correct |
10 |
Correct |
79 ms |
10232 KB |
Output is correct |
11 |
Correct |
78 ms |
10232 KB |
Output is correct |
12 |
Correct |
79 ms |
10108 KB |
Output is correct |
13 |
Correct |
77 ms |
9976 KB |
Output is correct |
14 |
Correct |
79 ms |
10380 KB |
Output is correct |
15 |
Correct |
84 ms |
10232 KB |
Output is correct |
16 |
Correct |
83 ms |
10216 KB |
Output is correct |
17 |
Correct |
80 ms |
10212 KB |
Output is correct |
18 |
Correct |
79 ms |
10104 KB |
Output is correct |
19 |
Correct |
90 ms |
10340 KB |
Output is correct |
20 |
Correct |
79 ms |
10232 KB |
Output is correct |
21 |
Correct |
78 ms |
10104 KB |
Output is correct |
22 |
Correct |
77 ms |
10104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
82 ms |
10228 KB |
Output is correct |
2 |
Correct |
79 ms |
10076 KB |
Output is correct |
3 |
Correct |
153 ms |
13728 KB |
Output is correct |
4 |
Incorrect |
100 ms |
11248 KB |
WA in grader: Too many instructions |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
110 ms |
12740 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
76 ms |
10232 KB |
Output is correct |
2 |
Correct |
77 ms |
10104 KB |
Output is correct |
3 |
Correct |
78 ms |
10104 KB |
Output is correct |
4 |
Correct |
75 ms |
10340 KB |
Output is correct |
5 |
Correct |
77 ms |
10232 KB |
Output is correct |
6 |
Correct |
77 ms |
10252 KB |
Output is correct |
7 |
Correct |
79 ms |
10228 KB |
Output is correct |
8 |
Correct |
79 ms |
10216 KB |
Output is correct |
9 |
Correct |
79 ms |
10120 KB |
Output is correct |
10 |
Correct |
88 ms |
10360 KB |
Output is correct |
11 |
Correct |
87 ms |
10240 KB |
Output is correct |
12 |
Correct |
81 ms |
10216 KB |
Output is correct |
13 |
Correct |
82 ms |
10104 KB |
Output is correct |
14 |
Correct |
86 ms |
10216 KB |
Output is correct |
15 |
Correct |
88 ms |
10348 KB |
Output is correct |
16 |
Correct |
79 ms |
10356 KB |
Output is correct |
17 |
Correct |
81 ms |
10104 KB |
Output is correct |
18 |
Correct |
79 ms |
10228 KB |
Output is correct |
19 |
Correct |
91 ms |
10112 KB |
Output is correct |
20 |
Correct |
83 ms |
10380 KB |
Output is correct |
21 |
Correct |
86 ms |
10356 KB |
Output is correct |
22 |
Correct |
78 ms |
10344 KB |
Output is correct |
23 |
Correct |
82 ms |
10104 KB |
Output is correct |
24 |
Correct |
88 ms |
10604 KB |
Output is correct |
25 |
Correct |
90 ms |
10728 KB |
Output is correct |
26 |
Correct |
77 ms |
10216 KB |
Output is correct |
27 |
Correct |
76 ms |
10052 KB |
Output is correct |
28 |
Incorrect |
100 ms |
12232 KB |
WA in grader: Too many instructions |
29 |
Halted |
0 ms |
0 KB |
- |