Submission #401676

#TimeUsernameProblemLanguageResultExecution timeMemory
401676snasibov05Vision Program (IOI19_vision)C++14
44 / 100
16 ms2628 KiB
#include "vision.h" #include <set> 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; for (int l = 0; l <= K; ++l) { int to = (i + l) * W + j + (K - l); if (to >= 0 && to < H*W && j + (K - l) < W && i + l < H){ arr.pb(to); } to = (i + l) * W + j - (K - l); if (to >= 0 && to < H*W && j - (K - l) >= 0 && i + l < H){ arr.pb(to); } to = (i - l) * W + j + (K - l); if (to >= 0 && to < H*W && j + (K - l) < W && i - l >= 0){ arr.pb(to); } to = (i - l) * W + j - (K - l); if (to >= 0 && to < H*W && j - (K - l) >= W && i - l >= H){ arr.pb(to); } } if (arr.empty()) continue; add_or(arr); arr = {k , cur}; k++; add_and(arr), 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...