Submission #737145

# Submission time Handle Problem Language Result Execution time Memory
737145 2023-05-06T17:19:52 Z PoonYaPat Vision Program (IOI19_vision) C++14
58 / 100
62 ms 6468 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii; //(x,y)

int h,w,k;
vector<int> a[400],b[400];

int cor(pii c) {return c.first*w+c.second;}

int check(int p) {
    vector<int> v;
    for (int i=0; i<h+w-1; ++i) {
        vector<int> temp;
        for (int j=i; j<=min(i+p,h+w-2); ++j) {
            for (auto s : a[j]) temp.push_back(s);
        }

        int x=add_or(temp), y=add_xor(temp);
        y=add_not(y);
        x=add_and({x,y});
        v.push_back(x);
    }
    int fir=add_or(v);

    v.clear();
    for (int i=0; i<h+w-1; ++i) {
        vector<int> temp;
        for (int j=i; j<=min(i+p,h+w-2); ++j) {
            for (auto s : b[j]) temp.push_back(s);
        }

        int x=add_or(temp), y=add_xor(temp);
        y=add_not(y);
        x=add_and({x,y});
        v.push_back(x);
    }
    int sec=add_or(v);

    return add_and({fir,sec});
}

void construct_network(int H, int W, int K) {
    h=H; w=W; k=K;
    for (int i=0; i<h; ++i) {
        for (int j=0; j<w; ++j) {
            a[i+j].push_back(cor({i,j}));
            b[i-j+w-1].push_back(cor({i,j}));
        }
    }

    int x=check(k), y=check(k-1);

    y=add_not(y);
    add_and({x,y});
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 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 320 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 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 320 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 312 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 316 KB Output is correct
26 Correct 2 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 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 320 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 312 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 316 KB Output is correct
26 Correct 2 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 12 ms 1236 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 7 ms 980 KB Output is correct
32 Correct 2 ms 340 KB Output is correct
33 Correct 2 ms 468 KB Output is correct
34 Correct 10 ms 1236 KB Output is correct
35 Correct 16 ms 1752 KB Output is correct
36 Correct 19 ms 1984 KB Output is correct
37 Correct 20 ms 1992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 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 320 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 312 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 316 KB Output is correct
26 Correct 2 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 12 ms 1236 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 7 ms 980 KB Output is correct
32 Correct 2 ms 340 KB Output is correct
33 Correct 2 ms 468 KB Output is correct
34 Correct 10 ms 1236 KB Output is correct
35 Correct 16 ms 1752 KB Output is correct
36 Correct 19 ms 1984 KB Output is correct
37 Correct 20 ms 1992 KB Output is correct
38 Incorrect 4 ms 4436 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 12 ms 1432 KB Output is correct
3 Correct 11 ms 1364 KB Output is correct
4 Correct 16 ms 1748 KB Output is correct
5 Correct 2 ms 596 KB Output is correct
6 Correct 10 ms 1276 KB Output is correct
7 Correct 15 ms 1624 KB Output is correct
8 Correct 15 ms 1792 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 8 ms 960 KB Output is correct
11 Correct 16 ms 1364 KB Output is correct
12 Correct 13 ms 1348 KB Output is correct
13 Correct 18 ms 1620 KB Output is correct
14 Correct 16 ms 1672 KB Output is correct
15 Correct 2 ms 572 KB Output is correct
16 Correct 8 ms 996 KB Output is correct
17 Correct 12 ms 1420 KB Output is correct
18 Correct 12 ms 1472 KB Output is correct
19 Correct 14 ms 1620 KB Output is correct
20 Correct 15 ms 1748 KB Output is correct
21 Correct 1 ms 316 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 316 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 7 ms 852 KB Output is correct
4 Correct 62 ms 6468 KB Output is correct
5 Incorrect 4 ms 4436 KB WA in grader: Too many inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 47 ms 5832 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 5 ms 852 KB Output is correct
4 Correct 9 ms 1212 KB Output is correct
5 Correct 2 ms 596 KB Output is correct
6 Correct 2 ms 596 KB Output is correct
7 Correct 25 ms 3024 KB Output is correct
8 Correct 32 ms 3016 KB Output is correct
9 Correct 47 ms 5848 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 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 320 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 312 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 316 KB Output is correct
26 Correct 2 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 12 ms 1236 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 7 ms 980 KB Output is correct
32 Correct 2 ms 340 KB Output is correct
33 Correct 2 ms 468 KB Output is correct
34 Correct 10 ms 1236 KB Output is correct
35 Correct 16 ms 1752 KB Output is correct
36 Correct 19 ms 1984 KB Output is correct
37 Correct 20 ms 1992 KB Output is correct
38 Incorrect 4 ms 4436 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -