Submission #1071159

#TimeUsernameProblemLanguageResultExecution timeMemory
1071159Gromp15Vision Program (IOI19_vision)C++17
40 / 100
4 ms604 KiB
#include "vision.h" #include <bits/stdc++.h> #define ll long long #define ar array #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() using namespace std; template<typename T> bool ckmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; } template<typename T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; } void construct_network(int H, int W, int K) { vector<int> res; if (H <= 30 && W <= 30) { for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { vector<int> cur; for (int k = 0; k < H; k++) { for (int l = 0; l < W; l++) { if (abs(k - i) + abs(j - l) == K) { cur.emplace_back(k*W+l); } } } if (cur.size()) { int idx = add_or(cur); res.emplace_back(add_and({i*W+j, idx})); } } } } else { vector<int> cur; for (int k = 0; k < H; k++) { for (int l = 0; l < W; l++) { if (k + l == K) { cur.emplace_back(k*W+l); } } } if (cur.size()) { int idx = add_or(cur); res.emplace_back(add_and({0, idx})); } } add_or(res); }
#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...