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 <bits/stdc++.h>
#include "vision.h"
using namespace std;
typedef long long ll;
int ok[205][205];
void construct_network(int H, int W, int K) {
int cur = H * W;
for(int i = 0; i < H; i ++){
for(int j = 0; j < W; j ++){
vector<int> ask;
for(int z = -K; z <= K; z ++){
int y = K - abs(z);
if(i + z >= 0 && i + z < H && j + y >= 0 && j + y < W)
ask.push_back((i + z) * W + j + y);
if(i + z >= 0 && i + z < H && j - y >= 0 && j - y < W)
ask.push_back((i + z) * W + (j - y));
}
if(ask.empty()){
ok[i][j] = -1;
continue;
}
add_or(ask);
add_and({cur, i * W + j});
cur ++;
ok[i][j] = cur;
cur ++;
}
}
vector<int> ask;
for(int i = 0; i < H; i ++)
for(int j = 0; j < W; j ++)
if(ok[i][j] != -1)
ask.push_back(ok[i][j]);
add_or(ask);
}
# | 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... |