답안 #144347

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
144347 2019-08-16T17:19:49 Z johutha Vision Program (IOI19_vision) C++14
58 / 100
91 ms 8312 KB
#include <vector>
#include "vision.h"
#include <iostream>

using namespace std;

int H, W;

int getv(int x, int y)
{
    return y*W + x;
}

bool notin(int x, int y)
{
    return x < 0 || x >= W || y < 0 || y >= H;
}

int smaller(int K)
{
    vector<vector<int>> topd;
    vector<vector<int>> botd;
    for (int i = -H + 1; i < W; i++)
    {
        vector<int> d;
        for (int j = 0; j < H; j++)
        {
            int x = i + j;
            int y = H - 1 - j;
            if (notin(x, y)) continue;
            d.push_back(getv(x, y));
        }
        topd.push_back(d);
    }

    for (int i = 0; i < W + H - 1; i++)
    {
        vector<int> d;
        for (int j = 0; j < H; j++)
        {
            int x = i - j;
            int y = H - 1 - j;
            if (notin(x, y)) continue;
            d.push_back(getv(x, y));
        }
        botd.push_back(d);
    }

    vector<int> dia1;
    vector<int> dia2;

    for (int i = 0; i < (int)botd.size() - K; i++)
    {
        vector<int> allt;
        vector<int> allb;
        for (int j = i; j <= i + K; j++)
        {
            for (int x : botd[j])
            {
                allb.push_back(x);
            }
            for (int x : topd[j])
            {
                allt.push_back(x);
            }
        }
        int or1 = add_or(allt);
        int xor1 = add_xor(allt);
        int bothin1 = add_xor({or1, xor1});
        int or2 = add_or(allb);
        int xor2 = add_xor(allb);
        int bothin2 = add_xor({or2, xor2});
        dia1.push_back(bothin1);
        dia2.push_back(bothin2);
    }
    int or1 = add_or(dia1);
    int or2 = add_or(dia2);
    return add_and({or1, or2});
}

void construct_network(int iH, int iW, int K)
{
    H = iH;
    W = iW;

    add_xor({smaller(K), smaller(K - 1)});
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 256 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 256 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 256 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 3 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 256 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 256 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 3 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
28 Correct 13 ms 1144 KB Output is correct
29 Correct 3 ms 376 KB Output is correct
30 Correct 2 ms 376 KB Output is correct
31 Correct 3 ms 424 KB Output is correct
32 Correct 3 ms 376 KB Output is correct
33 Correct 4 ms 376 KB Output is correct
34 Correct 13 ms 1196 KB Output is correct
35 Correct 16 ms 1528 KB Output is correct
36 Correct 12 ms 1148 KB Output is correct
37 Correct 3 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 256 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 256 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 3 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
28 Correct 13 ms 1144 KB Output is correct
29 Correct 3 ms 376 KB Output is correct
30 Correct 2 ms 376 KB Output is correct
31 Correct 3 ms 424 KB Output is correct
32 Correct 3 ms 376 KB Output is correct
33 Correct 4 ms 376 KB Output is correct
34 Correct 13 ms 1196 KB Output is correct
35 Correct 16 ms 1528 KB Output is correct
36 Correct 12 ms 1148 KB Output is correct
37 Correct 3 ms 376 KB Output is correct
38 Incorrect 9 ms 4728 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 632 KB Output is correct
2 Correct 10 ms 1016 KB Output is correct
3 Correct 10 ms 1032 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 4 ms 632 KB Output is correct
6 Correct 10 ms 1016 KB Output is correct
7 Correct 10 ms 888 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 3 ms 632 KB Output is correct
10 Correct 9 ms 888 KB Output is correct
11 Correct 10 ms 1016 KB Output is correct
12 Correct 10 ms 1016 KB Output is correct
13 Correct 8 ms 892 KB Output is correct
14 Correct 3 ms 376 KB Output is correct
15 Correct 4 ms 632 KB Output is correct
16 Correct 9 ms 888 KB Output is correct
17 Correct 11 ms 1020 KB Output is correct
18 Correct 11 ms 1016 KB Output is correct
19 Correct 8 ms 760 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 5 ms 760 KB Output is correct
4 Correct 66 ms 6108 KB Output is correct
5 Correct 91 ms 8312 KB Output is correct
6 Correct 70 ms 6392 KB Output is correct
7 Correct 6 ms 632 KB Output is correct
8 Correct 11 ms 1144 KB Output is correct
9 Incorrect 9 ms 4344 KB WA in grader: Too many inputs
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 54 ms 5620 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 7 ms 760 KB Output is correct
4 Correct 11 ms 1272 KB Output is correct
5 Correct 3 ms 632 KB Output is correct
6 Correct 4 ms 632 KB Output is correct
7 Correct 29 ms 2936 KB Output is correct
8 Correct 29 ms 3064 KB Output is correct
9 Correct 54 ms 5620 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 256 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 256 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 3 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
28 Correct 13 ms 1144 KB Output is correct
29 Correct 3 ms 376 KB Output is correct
30 Correct 2 ms 376 KB Output is correct
31 Correct 3 ms 424 KB Output is correct
32 Correct 3 ms 376 KB Output is correct
33 Correct 4 ms 376 KB Output is correct
34 Correct 13 ms 1196 KB Output is correct
35 Correct 16 ms 1528 KB Output is correct
36 Correct 12 ms 1148 KB Output is correct
37 Correct 3 ms 376 KB Output is correct
38 Incorrect 9 ms 4728 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -