Submission #430992

#TimeUsernameProblemLanguageResultExecution timeMemory
430992_fractalVision Program (IOI19_vision)C++14
46 / 100
12 ms1220 KiB
#include "vision.h" #include <iostream> using namespace std; const int dx[] = {+1, +1}; const int dy[] = {+1, -1}; void construct_network(int H, int W, int K) { int sz = H * W, cur = H * W - 1; vector<int> ask, ksa, is(K + 1, 0), si(K + 1, 0); vector<int> kek[K + 1], lol[K + 1]; for (int i = 0; i < H; ++i) { ask.clear(); for (int j = 0; j < W; ++j) ask.push_back(i * W + j); add_or(ask); } for (int j = 0; j < W; ++j) { ask.clear(); for (int i = 0; i < H; ++i) ask.push_back(i * W + j); add_or(ask); } sz = H * W, cur = H * W + H + W - 1; ask.clear(); for (int i = 0; i < H; ++i) { ask.push_back(sz + i); for (int j = 1; i + j < H && j <= K; ++j) { add_and({sz + i, sz + i + j}); cur++; kek[j].push_back(cur); } } add_xor(ask); cur++; kek[0].push_back(cur); sz = H * W + H; ask.clear(); for (int i = 0; i < W; ++i) { ask.push_back(sz + i); for (int j = 1; i + j < W && j <= K; ++j) { add_and({sz + i, sz + i + j}); cur++; lol[j].push_back(cur); } } add_xor(ask); cur++; lol[0].push_back(cur); for (int i = 0; i <= K; ++i) { if (kek[i].empty()) add_xor({0, 0}); else add_or(kek[i]); cur++; is[i] = cur; } for (int i = 0; i <= K; ++i) { if (lol[i].empty()) add_xor({0, 0}); else add_or(lol[i]); cur++; si[i] = cur; } ask.clear(); for (int i = 0; i <= K; ++i) { add_and({is[i], si[K - i]}); cur++; ask.push_back(cur); } add_or(ask); 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...