Submission #297354

#TimeUsernameProblemLanguageResultExecution timeMemory
297354mode149256Vision Program (IOI19_vision)C++14
44 / 100
17 ms2044 KiB
#include<bits/stdc++.h> #include "vision.h" using namespace std; #define x first #define y second using vi = vector<int>; using ll = long long; using vii = vector<vi>; using pi = pair<int, int>; int j = 0; int h, w, k; int con(pi a) { return a.x * w + a.y; } pi con(int a) { return {a / w, a % w}; } int valid(pi a) { return int(0 <= a.x and a.x < h and 0 <= a.y and a.y < w); } int valid(int a) { return valid(con(a)); } void findKit(int i, vi &kit) { pi prad = con(i); pi c = prad; c.y += k; if (valid(c)) kit.emplace_back(con(c)); for (int i = 0; i <= k; ++i) { pi nc = prad; nc.y += i; nc.x += k - i; if (valid(nc)) kit.emplace_back(con(nc)); nc = prad; if (i != k) { nc.y -= i; nc.x += k - i; if (valid(nc)) kit.emplace_back(con(nc)); } } } void construct_network(int H, int W, int K) { h = H; w = W; k = K; vi andai; for (int i = 0; i < H * W; ++i) { vi kit; findKit(i, kit); if (kit.empty()) continue; int n = add_or(kit); int d = add_and({i}); andai.emplace_back(add_and({d, n})); } add_or(andai); // std::vector<int> Ns; // Ns = {0, 1}; // int a = add_and(Ns); // Ns = {0, a}; // int b = add_or(Ns); // Ns = {0, 1, b}; // int c = add_xor(Ns); // add_not(c); }
#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...