제출 #281582

#제출 시각아이디문제언어결과실행 시간메모리
281582NONAMEVision Program (IOI19_vision)C++14
44 / 100
177 ms3060 KiB
#include "vision.h"

void construct_network(int H, int W, int K) {
    std::vector <int> res, res1;
        
    int cnt = 0;
    for (int x1 = 0; x1 < H; ++x1)
    for (int y1 = 0; y1 < W; ++y1) {
        std::vector <int> cur;

        for (int x2 = 0; x2 < H; ++x2)
        for (int y2 = 0; y2 < W; ++y2) {
            if ((abs(x1 - x2) + abs(y1 - y2)) != K)
                continue;

            cur.push_back(x2 * W + y2);
        }

        if (cur.empty())
            continue;

        add_or(cur);
        res.push_back(H * W + cnt);
        ++cnt;
        add_and({x1 * W + y1, res.back()});
        res1.push_back(H * W + cnt);
        ++cnt;
    }

    add_or(res1);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...