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 <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include "vision.h"
using namespace std;
void construct_network(int h, int w, int k){
vector<int> left[500], right[500];
for (int i = 0; i < h; i++){
for (int j = 0; j < w; j++){
left[i + j].push_back(i*w + j);
right[j - i + h - 1].push_back(i*w + j);
}
}
int l1[500], l2[500], r1[500], r2[500];
for (int i = 0; i < h + w - 1; i++){
l1[i] = add_or(left[i]);
r1[i] = add_or(right[i]);
l2[i] = add_xor({add_xor(left[i]), add_or(left[i])});
r2[i] = add_xor({add_xor(right[i]), add_or(right[i])});
}
vector<int> l, r;
for (int i = 0; i + k < h + w - 1; i++){
vector<int> twos, ones;
for (int j = i; j <= i + k; j++){
twos.push_back(l2[j]);
ones.push_back(l1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
l.push_back(add_or(twos));
}
for (int i = 0; i + k < h + w; i++){
vector<int> twos, ones;
for (int j = i; j <= i + k; j++){
twos.push_back(r2[j]);
ones.push_back(r1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
r.push_back(add_or(twos));
}
k--;
int moze_kplusjedan = add_and({add_or(l), add_or(r)});
l.clear(); r.clear();
for (int i = 0; i + k < h + w - 1; i++){
vector<int> twos, ones;
for (int j = i; j <= i + k; j++){
twos.push_back(l2[j]);
ones.push_back(l1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
l.push_back(add_or(twos));
}
for (int i = 0; i + k < h + w - 1; i++){
vector<int> twos, ones;
for (int j = i; j <= i + k; j++){
twos.push_back(r2[j]);
ones.push_back(r1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
r.push_back(add_or(twos));
}
int moze_k = add_and({add_or(l), add_or(r)});
int rj = add_and({moze_kplusjedan, add_not(moze_k)});
return;
}
Compilation message (stderr)
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:71:9: warning: unused variable 'rj' [-Wunused-variable]
71 | int rj = add_and({moze_kplusjedan, add_not(moze_k)});
| ^~
# | 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... |