Submission #401645

#TimeUsernameProblemLanguageResultExecution timeMemory
401645snasibov05Vision Program (IOI19_vision)C++14
33 / 100
3 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 && j + (K - l) < W && i + l < H){ 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 && j - (K - l) >= 0 && i + l < H){ 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 && j + (K - l) < W && i - l >= 0){ 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 && j - (K - l) >= W && i - l >= H){ 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...