Submission #411400

# Submission time Handle Problem Language Result Execution time Memory
411400 2021-05-25T08:07:03 Z 조영욱(#7626) Vision Program (IOI19_vision) C++17
100 / 100
56 ms 4588 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

int xpos[201];
int xval[201];
int xfinal[201];
int ypos[201];
int yval[201];
int yfinal[201];
int pval[401];
int mval[401];

void construct_network(int n,int m,int k) {
    vector<int> just;
    just.push_back(0);
    just.push_back(add_not(0));
    int one=add_xor(just);
    int ret=add_not(one);
    for(int i=0;i<n;i++) {
        vector<int> v;
        for(int j=0;j<m;j++) {
            v.push_back(i*m+j);
        }
        vector<int> temp;
        temp.push_back(add_not(add_xor(v)));
        temp.push_back(add_or(v));
        vector<int> vec;
        vec.push_back(add_and(temp));
        vec.push_back(ret);
        ret=add_or(vec);
        xpos[i]=add_or(v);
    }
    int save=add_not(one);
    for(int i=0;i<n;i++) {
        vector<int> v;
        for(int j=i;j<=i+k&&j<n;j++){
            v.push_back(xpos[j]);
        }
        vector<int> temp;
        temp.push_back(save);
        vector<int> temp2;
        temp2.push_back(add_not(add_xor(v)));
        temp2.push_back(add_or(v));
        temp.push_back(add_and(temp2));
        save=add_or(temp);
    }
    for(int j=0;j<m;j++) {
        vector<int> v;
        for(int i=0;i<n;i++) {
            v.push_back(i*m+j);
        }
        vector<int> temp;
        temp.push_back(add_not(add_xor(v)));
        temp.push_back(add_or(v));
        vector<int> vec;
        vec.push_back(add_and(temp));
        vec.push_back(ret);
        ret=add_or(vec);
        ypos[j]=add_or(v);
    }
    int save1=add_not(one);
    for(int i=0;i<m;i++) {
        vector<int> v;
        for(int j=i;j<=i+k&&j<m;j++){
            v.push_back(ypos[j]);
        }
        vector<int> temp;
        temp.push_back(save1);
        vector<int> temp2;
        temp2.push_back(add_not(add_xor(v)));
        temp2.push_back(add_or(v));
        temp.push_back(add_and(temp2));
        save1=add_or(temp);
    }
    vector<int> tmp;
    tmp.push_back(save);
    tmp.push_back(save1);
    int val=add_and(tmp);
    vector<int> vec;
    vec.push_back(val);
    vec.push_back(ret);
    ret=add_or(vec); //ret=0:이미 글렀음
    for(int i=0;i<=n+m-2;i++) {
        vector<int> temp;
        for(int x=0;x<n;x++) {
            int y=i-x;
            if (y<0||y>=m) {
                continue;
            }
            temp.push_back(x*m+y);
        }
        pval[i]=add_or(temp);
    }
    for(int i=0;i<=n+m-2;i++) {
        vector<int> temp;
        int diff=i-m+1;
        for(int x=0;x<n;x++) {
            int y=x-diff;
            if (y<0||y>=m) {
                continue;
            }
            temp.push_back(x*m+y);
        }
        mval[i]=add_or(temp);
    }
    int got=add_not(one);
    for(int i=0;i<=n+m-2;i++) {
        if (i+k<=n+m-2) {
            vector<int> v;
            v.push_back(pval[i]);
            v.push_back(pval[i+k]);
            int temp=add_and(v);
            vector<int> tmp;
            tmp.push_back(got);
            tmp.push_back(temp);
            got=add_or(tmp);
            v.clear();
            tmp.clear();
            v.push_back(mval[i]);
            v.push_back(mval[i+k]);
            temp=add_and(v);
            tmp.push_back(got);
            tmp.push_back(temp);
            got=add_or(tmp);
        }
    }
    vector<int> v;
    v.push_back(ret);
    v.push_back(got);
    add_and(v);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 2 ms 204 KB Output is correct
24 Correct 2 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 2 ms 204 KB Output is correct
24 Correct 2 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 2 ms 332 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 2 ms 332 KB Output is correct
32 Correct 2 ms 332 KB Output is correct
33 Correct 2 ms 332 KB Output is correct
34 Correct 2 ms 332 KB Output is correct
35 Correct 2 ms 332 KB Output is correct
36 Correct 2 ms 332 KB Output is correct
37 Correct 2 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 2 ms 204 KB Output is correct
24 Correct 2 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 2 ms 332 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 2 ms 332 KB Output is correct
32 Correct 2 ms 332 KB Output is correct
33 Correct 2 ms 332 KB Output is correct
34 Correct 2 ms 332 KB Output is correct
35 Correct 2 ms 332 KB Output is correct
36 Correct 2 ms 332 KB Output is correct
37 Correct 2 ms 332 KB Output is correct
38 Correct 12 ms 1356 KB Output is correct
39 Correct 2 ms 460 KB Output is correct
40 Correct 3 ms 460 KB Output is correct
41 Correct 7 ms 844 KB Output is correct
42 Correct 7 ms 844 KB Output is correct
43 Correct 11 ms 1152 KB Output is correct
44 Correct 13 ms 1296 KB Output is correct
45 Correct 13 ms 1356 KB Output is correct
46 Correct 14 ms 1336 KB Output is correct
47 Correct 13 ms 1356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 460 KB Output is correct
2 Correct 6 ms 716 KB Output is correct
3 Correct 6 ms 716 KB Output is correct
4 Correct 6 ms 880 KB Output is correct
5 Correct 3 ms 460 KB Output is correct
6 Correct 5 ms 716 KB Output is correct
7 Correct 8 ms 788 KB Output is correct
8 Correct 6 ms 884 KB Output is correct
9 Correct 3 ms 460 KB Output is correct
10 Correct 4 ms 704 KB Output is correct
11 Correct 7 ms 716 KB Output is correct
12 Correct 6 ms 716 KB Output is correct
13 Correct 7 ms 844 KB Output is correct
14 Correct 6 ms 844 KB Output is correct
15 Correct 3 ms 588 KB Output is correct
16 Correct 5 ms 716 KB Output is correct
17 Correct 6 ms 716 KB Output is correct
18 Correct 6 ms 716 KB Output is correct
19 Correct 6 ms 756 KB Output is correct
20 Correct 6 ms 852 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 4 ms 716 KB Output is correct
4 Correct 5 ms 760 KB Output is correct
5 Correct 5 ms 588 KB Output is correct
6 Correct 6 ms 716 KB Output is correct
7 Correct 5 ms 588 KB Output is correct
8 Correct 7 ms 860 KB Output is correct
9 Correct 9 ms 1016 KB Output is correct
10 Correct 9 ms 972 KB Output is correct
11 Correct 9 ms 972 KB Output is correct
12 Correct 9 ms 972 KB Output is correct
13 Correct 4 ms 460 KB Output is correct
14 Correct 5 ms 716 KB Output is correct
15 Correct 6 ms 844 KB Output is correct
16 Correct 8 ms 844 KB Output is correct
17 Correct 3 ms 460 KB Output is correct
18 Correct 6 ms 768 KB Output is correct
19 Correct 7 ms 816 KB Output is correct
20 Correct 21 ms 2112 KB Output is correct
21 Correct 29 ms 2520 KB Output is correct
22 Correct 26 ms 2476 KB Output is correct
23 Correct 25 ms 2580 KB Output is correct
24 Correct 21 ms 2092 KB Output is correct
25 Correct 27 ms 2572 KB Output is correct
26 Correct 25 ms 2544 KB Output is correct
27 Correct 39 ms 3880 KB Output is correct
28 Correct 46 ms 4408 KB Output is correct
29 Correct 47 ms 4536 KB Output is correct
30 Correct 49 ms 4552 KB Output is correct
31 Correct 46 ms 4428 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 44 ms 3820 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 5 ms 716 KB Output is correct
4 Correct 8 ms 844 KB Output is correct
5 Correct 3 ms 588 KB Output is correct
6 Correct 3 ms 608 KB Output is correct
7 Correct 21 ms 2096 KB Output is correct
8 Correct 21 ms 2160 KB Output is correct
9 Correct 55 ms 3784 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 2 ms 204 KB Output is correct
24 Correct 2 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 2 ms 332 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 2 ms 332 KB Output is correct
32 Correct 2 ms 332 KB Output is correct
33 Correct 2 ms 332 KB Output is correct
34 Correct 2 ms 332 KB Output is correct
35 Correct 2 ms 332 KB Output is correct
36 Correct 2 ms 332 KB Output is correct
37 Correct 2 ms 332 KB Output is correct
38 Correct 12 ms 1356 KB Output is correct
39 Correct 2 ms 460 KB Output is correct
40 Correct 3 ms 460 KB Output is correct
41 Correct 7 ms 844 KB Output is correct
42 Correct 7 ms 844 KB Output is correct
43 Correct 11 ms 1152 KB Output is correct
44 Correct 13 ms 1296 KB Output is correct
45 Correct 13 ms 1356 KB Output is correct
46 Correct 14 ms 1336 KB Output is correct
47 Correct 13 ms 1356 KB Output is correct
48 Correct 3 ms 460 KB Output is correct
49 Correct 6 ms 716 KB Output is correct
50 Correct 6 ms 716 KB Output is correct
51 Correct 6 ms 880 KB Output is correct
52 Correct 3 ms 460 KB Output is correct
53 Correct 5 ms 716 KB Output is correct
54 Correct 8 ms 788 KB Output is correct
55 Correct 6 ms 884 KB Output is correct
56 Correct 3 ms 460 KB Output is correct
57 Correct 4 ms 704 KB Output is correct
58 Correct 7 ms 716 KB Output is correct
59 Correct 6 ms 716 KB Output is correct
60 Correct 7 ms 844 KB Output is correct
61 Correct 6 ms 844 KB Output is correct
62 Correct 3 ms 588 KB Output is correct
63 Correct 5 ms 716 KB Output is correct
64 Correct 6 ms 716 KB Output is correct
65 Correct 6 ms 716 KB Output is correct
66 Correct 6 ms 756 KB Output is correct
67 Correct 6 ms 852 KB Output is correct
68 Correct 1 ms 204 KB Output is correct
69 Correct 1 ms 204 KB Output is correct
70 Correct 1 ms 204 KB Output is correct
71 Correct 1 ms 204 KB Output is correct
72 Correct 4 ms 716 KB Output is correct
73 Correct 5 ms 760 KB Output is correct
74 Correct 5 ms 588 KB Output is correct
75 Correct 6 ms 716 KB Output is correct
76 Correct 5 ms 588 KB Output is correct
77 Correct 7 ms 860 KB Output is correct
78 Correct 9 ms 1016 KB Output is correct
79 Correct 9 ms 972 KB Output is correct
80 Correct 9 ms 972 KB Output is correct
81 Correct 9 ms 972 KB Output is correct
82 Correct 4 ms 460 KB Output is correct
83 Correct 5 ms 716 KB Output is correct
84 Correct 6 ms 844 KB Output is correct
85 Correct 8 ms 844 KB Output is correct
86 Correct 3 ms 460 KB Output is correct
87 Correct 6 ms 768 KB Output is correct
88 Correct 7 ms 816 KB Output is correct
89 Correct 21 ms 2112 KB Output is correct
90 Correct 29 ms 2520 KB Output is correct
91 Correct 26 ms 2476 KB Output is correct
92 Correct 25 ms 2580 KB Output is correct
93 Correct 21 ms 2092 KB Output is correct
94 Correct 27 ms 2572 KB Output is correct
95 Correct 25 ms 2544 KB Output is correct
96 Correct 39 ms 3880 KB Output is correct
97 Correct 46 ms 4408 KB Output is correct
98 Correct 47 ms 4536 KB Output is correct
99 Correct 49 ms 4552 KB Output is correct
100 Correct 46 ms 4428 KB Output is correct
101 Correct 1 ms 204 KB Output is correct
102 Correct 1 ms 204 KB Output is correct
103 Correct 44 ms 3820 KB Output is correct
104 Correct 1 ms 204 KB Output is correct
105 Correct 5 ms 716 KB Output is correct
106 Correct 8 ms 844 KB Output is correct
107 Correct 3 ms 588 KB Output is correct
108 Correct 3 ms 608 KB Output is correct
109 Correct 21 ms 2096 KB Output is correct
110 Correct 21 ms 2160 KB Output is correct
111 Correct 55 ms 3784 KB Output is correct
112 Correct 1 ms 204 KB Output is correct
113 Correct 1 ms 204 KB Output is correct
114 Correct 53 ms 4444 KB Output is correct
115 Correct 6 ms 844 KB Output is correct
116 Correct 3 ms 588 KB Output is correct
117 Correct 27 ms 2532 KB Output is correct
118 Correct 30 ms 2364 KB Output is correct
119 Correct 48 ms 4560 KB Output is correct
120 Correct 47 ms 4556 KB Output is correct
121 Correct 47 ms 4584 KB Output is correct
122 Correct 47 ms 4520 KB Output is correct
123 Correct 39 ms 3776 KB Output is correct
124 Correct 45 ms 4376 KB Output is correct
125 Correct 56 ms 4576 KB Output is correct
126 Correct 47 ms 4588 KB Output is correct
127 Correct 47 ms 4508 KB Output is correct
128 Correct 48 ms 4504 KB Output is correct