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;
void construct_network(int H, int W, int K) {
map<int,vector<int>> left,right;
for (int j=-H+1;j<W;j++){
//vector<int> n;
int x=j,y=0;
while (y<H){
if (x>=0&&x<W) right[-j].push_back(y*W+x);
y++;
x++;
}
//int a = add_or(n);
//int b = add_xor(n);
//right[-j] = n;
}
for (int j=0;j<W+H-1;j++){
//vector<int> n;
int x=j,y=0;
while (y<H){
if (x>=0&&x<W) left[j].push_back(y*W+x);
y++;
x--;
}
//int a = add_or(n);
//int b = add_xor(n);
//left[j] = n;
}
vector<int> temp,temp2;
for (int i=H-1;i>-W-K;i--){
vector<int> n;
for (int j=i+K;j>=i;j--){
for (auto item:right[j]) n.push_back(item);
}
int a = add_or(n);
int b = add_xor(n);
int c = add_not(b);
int d = add_and({a,c});
temp.push_back(d);
}
for (int i=0;i<W+H+K-1;i++){
vector<int> n;
for (int j=i;j>=i-K;j--){
for (auto item:left[j]) n.push_back(item);
}
int a = add_or(n);
int b = add_xor(n);
int c = add_not(b);
int d = add_and({a,c});
temp2.push_back(d);
}
int a = add_or(temp);
int b = add_or(temp2);
int e = add_and({a,b});
temp.clear();
temp2.clear();
for (int i=H-1;i>-W-K+1;i--){
vector<int> n;
for (int j=i+K-1;j>=i;j--){
for (auto item:right[j]) n.push_back(item);
}
int a = add_or(n);
int b = add_xor(n);
int c = add_not(b);
int d = add_and({a,c});
temp.push_back(d);
}
for (int i=0;i<W+H+K-2;i++){
vector<int> n;
for (int j=i;j>i-K;j--){
for (auto item:left[j]) n.push_back(item);
}
int a = add_or(n);
int b = add_xor(n);
int c = add_not(b);
int d = add_and({a,c});
temp2.push_back(d);
}
a = add_or(temp);
b = add_or(temp2);
int e2 = add_and({a,b});
int e3 = add_not(e2);
int aa = add_and({e,e3});
}
Compilation message (stderr)
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:85:6: warning: unused variable 'aa' [-Wunused-variable]
85 | int aa = add_and({e,e3});
| ^~
# | 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... |