Submission #198757

#TimeUsernameProblemLanguageResultExecution timeMemory
198757AkashiVision Program (IOI19_vision)C++14
44 / 100
16 ms3060 KiB
#include <bits/stdc++.h> #include "vision.h" using namespace std; bool viz[205][205]; int wh[205][205]; void construct_network(int H, int W, int K) { vector <int> v; int Last = 0; for(int i = 0; i < H ; ++i){ for(int j = 0; j < W ; ++j){ viz[i][j] = 1; v.clear(); for(int x = -K; x <= K ; ++x){ int y = K - abs(x); int l = i + x, c = j + y; if(l >= 0 && c >= 0 && l < H && c < W){ if(!viz[l][c]) v.push_back(l * W + c); } y = -y; l = i + x, c = j + y; if(l >= 0 && c >= 0 && l < H && c < W){ if(!viz[l][c]) v.push_back(l * W + c); } } if(v.size() == 0) continue ; wh[i][j] = add_or(v); Last = wh[i][j]; } } int st = Last + 1, dr = 0; for(int i = 0; i < H ; ++i){ for(int j = 0; j < W ; ++j){ if(wh[i][j]){ vector <int> v; v.push_back(i * W + j); v.push_back(wh[i][j]); dr = add_and(v); } } } v.clear(); for(int i = st; i <= dr ; ++i) v.push_back(i); add_or(v); return ; }
#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...