답안 #737149

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
737149 2023-05-06T17:24:04 Z PoonYaPat Vision Program (IOI19_vision) C++14
58 / 100
77 ms 8268 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-p-1; ++i) {
        vector<int> temp;
        for (int j=i; j<=i+p; ++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-p-1; ++i) {
        vector<int> temp;
        for (int j=i; j<=i+p; ++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});
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 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 0 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 212 KB Output is correct
13 Correct 1 ms 340 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 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 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 0 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 212 KB Output is correct
13 Correct 1 ms 340 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 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 320 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 356 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 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 0 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 212 KB Output is correct
13 Correct 1 ms 340 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 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 320 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 356 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 324 KB Output is correct
28 Correct 10 ms 1108 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 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 1108 KB Output is correct
35 Correct 14 ms 1492 KB Output is correct
36 Correct 11 ms 1120 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 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 0 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 212 KB Output is correct
13 Correct 1 ms 340 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 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 320 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 356 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 324 KB Output is correct
28 Correct 10 ms 1108 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 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 1108 KB Output is correct
35 Correct 14 ms 1492 KB Output is correct
36 Correct 11 ms 1120 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Incorrect 4 ms 4476 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 8 ms 960 KB Output is correct
3 Correct 8 ms 980 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 2 ms 576 KB Output is correct
6 Correct 7 ms 980 KB Output is correct
7 Correct 7 ms 848 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 6 ms 960 KB Output is correct
11 Correct 9 ms 940 KB Output is correct
12 Correct 10 ms 980 KB Output is correct
13 Correct 6 ms 724 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 10 ms 852 KB Output is correct
17 Correct 8 ms 980 KB Output is correct
18 Correct 8 ms 980 KB Output is correct
19 Correct 7 ms 852 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 5 ms 748 KB Output is correct
4 Correct 60 ms 6016 KB Output is correct
5 Correct 77 ms 8268 KB Output is correct
6 Correct 70 ms 6348 KB Output is correct
7 Correct 4 ms 596 KB Output is correct
8 Correct 9 ms 1216 KB Output is correct
9 Incorrect 5 ms 4288 KB WA in grader: Too many inputs
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 5820 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 1108 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 3088 KB Output is correct
8 Correct 25 ms 3044 KB Output is correct
9 Correct 48 ms 5888 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 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 0 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 212 KB Output is correct
13 Correct 1 ms 340 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 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 320 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 356 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 324 KB Output is correct
28 Correct 10 ms 1108 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 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 1108 KB Output is correct
35 Correct 14 ms 1492 KB Output is correct
36 Correct 11 ms 1120 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Incorrect 4 ms 4476 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -