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;
int h, w, k;
void solve()
{
vector<int> allops;
for (int i = 0; i < h; i++)
{
for (int j = 0; j < w; j++)
{
vector<int> kDis;
for (int x = 0; x < h; x++)
{
for (int y = 0; y < w; y++)
{
if (abs(x - i) + abs(y - i) == k)
kDis.push_back(x * w + y);
}
}
allops.push_back(add_and({i * w + j, add_or(kDis)}));
}
}
add_or(allops);
}
void solve6()
{
vector<int> kDis;
for (int x = 0; x < h; x++)
{
for (int y = 0; y < w; y++)
{
if (abs(x - 0) + abs(y - 0) == k)
kDis.push_back(x * w + y);
}
}
add_and({0, add_or(kDis)});
}
void construct_network(int H, int W, int K)
{
h = H, w = W, k = K;
if(!add_not(0))
solve6();
solve();
}
# | 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... |