Submission #424745

#TimeUsernameProblemLanguageResultExecution timeMemory
424745oleh1421Vision Program (IOI19_vision)C++17
44 / 100
26 ms3012 KiB
//#include "grader.cpp" #include "vision.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; void construct_network(int H, int W, int K) { int ind=H*W-1; vector<int>v; for (int i=0;i<H;i++){ for (int j=0;j<W;j++){ vector<int>Ask; for (int x=0;x<=K;x++){ int y=K-x; for (int dx:{-1,1}){ for (int dy:{-1,1}){ int nx=i+x*dx,ny=j+y*dy; if (nx<0 || nx>=H || ny<0 || ny>=W) continue; Ask.push_back(nx*W+ny); } } } if (!Ask.empty()){ add_or(Ask); ind++; add_and({ind,i*W+j}); ind++; v.push_back(ind); } } } add_or(v); } /** 2 3 3 0 0 0 1 0 0 0 2 0 0 1 0 0 0 1 1 0 0 1 2 0 1 0 2 0 1 1 0 0 1 1 1 0 1 1 2 0 2 1 0 0 2 1 1 0 2 1 2 1 0 1 1 1 0 1 2 1 1 1 2 -1 **/
#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...