Submission #602454

# Submission time Handle Problem Language Result Execution time Memory
602454 2022-07-23T06:19:11 Z Johann Vision Program (IOI19_vision) C++14
44 / 100
9 ms 1868 KB
#include "vision.h"

using namespace std;

typedef vector<int> vi;
#define sz(x) (int)(x).size()

int h, w, k;

int calc_pos(int x, int y) {
    return y * w + x;
}

void construct_network(int H, int W, int K) {
    h = H;
    w = W;
    k = K;
    vi all(0);
    for (int x = 0; x < W; ++x) {
        for (int y = 0; y < H; ++y) {
            vi neigs;
            for (int dx = -K; dx < K; ++dx) {
                int nx = x + dx, ny = y + min(abs(dx - K), abs(dx + K));
                if (0 <= nx && nx < W && 0 <= ny && ny < H)
                    neigs.push_back(calc_pos(nx, ny));
            }
            if (sz(neigs) > 0)
                all.push_back(add_and({calc_pos(x, y), add_or(neigs)}));
        }
    }
    if (sz(all) == 0) {
        for (int x = 0; x < W; ++x) {
            for (int y = 0; y < H; ++y) {
                all.push_back(calc_pos(x, y));
            }
        }
        add_not(add_or(all));
    } else {
        add_or(all);
    };
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 284 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 284 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 0 ms 272 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 288 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 284 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 284 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 0 ms 272 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 288 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 284 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 288 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 1 ms 284 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 284 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 284 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 0 ms 272 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 288 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 284 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 288 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 1 ms 284 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 3 ms 468 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 2 ms 468 KB Output is correct
35 Correct 2 ms 420 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 284 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 284 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 0 ms 272 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 288 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 284 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 288 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 1 ms 284 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 3 ms 468 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 2 ms 468 KB Output is correct
35 Correct 2 ms 420 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Incorrect 4 ms 1868 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Correct 1 ms 280 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 292 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 288 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 284 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 5 ms 720 KB Output is correct
4 Correct 9 ms 1232 KB Output is correct
5 Correct 6 ms 852 KB Output is correct
6 Correct 3 ms 420 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 2 ms 1048 KB WA in grader: Too many instructions
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 976 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 284 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 284 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 0 ms 272 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 288 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 284 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 288 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 1 ms 284 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 3 ms 468 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 2 ms 468 KB Output is correct
35 Correct 2 ms 420 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Incorrect 4 ms 1868 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -