Submission #416260

#TimeUsernameProblemLanguageResultExecution timeMemory
416260xyzVision Program (IOI19_vision)C++17
44 / 100
20 ms3012 KiB
#include <bits/stdc++.h> #include "vision.h" using namespace std; typedef long long ll; int ok[205][205]; void construct_network(int H, int W, int K) { int cur = H * W; for(int i = 0; i < H; i ++){ for(int j = 0; j < W; j ++){ vector<int> ask; for(int z = -K; z <= K; z ++){ int y = K - abs(z); if(i + z >= 0 && i + z < H && j + y >= 0 && j + y < W) ask.push_back((i + z) * W + j + y); if(i + z >= 0 && i + z < H && j - y >= 0 && j - y < W) ask.push_back((i + z) * W + (j - y)); } if(ask.empty()){ ok[i][j] = -1; continue; } add_or(ask); add_and({cur, i * W + j}); cur ++; ok[i][j] = cur; cur ++; } } vector<int> ask; for(int i = 0; i < H; i ++) for(int j = 0; j < W; j ++) if(ok[i][j] != -1) ask.push_back(ok[i][j]); add_or(ask); }
#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...