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;
#define pb push_back
int n, m, k;
bool exist(int i, int j){
return (0 <= i && i < n && 0 <= j && j < m);
}
int match(int i, int j){
return i*m + j;
}
void construct_network(int H, int W, int K) {
n = H, m = W, k = K;
int st = n*m, en = n*m;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++){
for (int x = i, y = j+k; y > j; x++, y--)
if (exist(x, y))
add_and({match(i, j), match(x, y)}), en++;
for (int x = i+k, y = j; x > i; x--, y--)
if (exist(x, y))
add_and({match(i, j), match(x, y)}), en++;
}
vector<int> temp;
for (int i = st; i < en; i++)
temp.pb(i);
add_or(temp);
}
# | 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... |