제출 #401640

#제출 시각아이디문제언어결과실행 시간메모리
401640snasibov05Vision Program (IOI19_vision)C++14
0 / 100
2 ms1096 KiB
#include "vision.h"

using namespace std;

#define pb push_back

void construct_network(int H, int W, int K) {

    vector<int> v;
    int k = H*W;

    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            int cur = i * W + j;
            vector<int> arr;
            arr.pb(cur);
            for (int l = 0; l < K; ++l) {
                int to = (i + l) * W + j + (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
                to = (i + l) * W + j - (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
                to = (i - l) * W + j + (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
                to = (i - l) * W + j - (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
            }
        }
    }

    add_or(v);

}
#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...