# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
721476 | nguyentunglam | Vision Program (IOI19_vision) | C++17 | 199 ms | 2312 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 200 + 10;
int row[N], col[N];
void construct_network(int h, int w, int K) {
vector<int> lst;
if (K == 1) {
for(int i = 0; i < h; i++) {
vector<int> ask;
for(int j = 0; j < w; j++) ask.push_back(i * w + j);
row[i] = add_or(ask);
}
for(int j = 0; j < w; j++) {
vector<int> ask;
for(int i = 0; i < h; i++) ask.push_back(i * w + j);
col[j] = add_or(ask);
}
vector<int> R, C;
for(int i = 0; i < h; i++) R.push_back(row[i]);
for(int j = 1; j < w; j++) C.push_back(add_and({col[j], col[j - 1]}));
if (!R.empty() && !C.empty()) {
int ret = add_and({add_xor(R), add_or(C)});
lst.push_back(ret);
}
R.clear(); C.clear();
for(int j = 0; j < w; j++) C.push_back(col[j]);
for(int i = 1; i < h; i++) R.push_back(add_and({row[i - 1], row[i]}));
if (!R.empty() && !C.empty()) {
int ret = add_and({add_xor(C), add_or(R)});
lst.push_back(ret);
}
int ok = add_or(lst);
}
for(int i = 0; i < h; i++) for(int j = 0; j < w; j++) {
vector<int> ask;
for(int k = i; k < h; k++) for(int l = 0; l < w; l++) {
if (i == k && j > l) continue;
if (abs(i - k) + abs(j - l) == K) ask.push_back(k * w + l);
}
if (ask.empty()) continue;
lst.push_back(add_and({i * w + j, add_or(ask)}));
}
if (lst.empty()) return;
add_or(lst);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |