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;
map<pair<int,int> , bool> visited;
void construct_network(int H, int W, int K) {
std::vector<int> Ns;
for (int i = 0 ; i < W*H ; i++){
int row = i/W;
int cal = i%W;
vector<int> good;
for (int j = 0 ; j <= K ; j++){
bool down, up, leftt, rightt;
int res = K - j;
down = up = leftt = rightt = false;
if (row + j < H)down = true;
if (row - j >= 0)up = true;
if (cal + res < W)rightt = true;
if (cal - res >= 0)leftt = true;
if (down){
int idx = (row + j)*W;
if (leftt){
idx+= (cal - res);
if (visited[{i,idx}] == true)continue;
good.push_back(idx);
visited[{i, idx}] = visited[{idx, i}] = true;
}
if (rightt){
idx = (row + j)*W;
idx+= cal + res;
if (visited[{i,idx}] == true)continue;
good.push_back(idx);
visited[{i, idx}] = visited[{idx, i}] = true;
}
}
if (up){
if (leftt){
int idx = (row - j)*W;
idx+= (cal - res);
if (visited[{i,idx}] == true)continue;
good.push_back(idx);
visited[{i, idx}] = visited[{idx, i}] = true;
}
if (rightt){
int idx = (row - j)*W;
idx+= (cal + res);
if (visited[{i,idx}] == true)continue;
good.push_back(idx);
visited[{i, idx}] = visited[{idx, i}] = true;
}
}
}
for (int x : good){
vector<int> test;
test.push_back(i);
test.push_back(x);
Ns.push_back(add_and(test));
}
}
add_xor(Ns);
}
# | 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... |