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 solve(int H, int W, int K){
vector<int> X[405], Y[405];
for(int i = 0; i < H; i ++){
for(int j = 0; j < W; j ++){
X[i + j].push_back(i * W + j);
Y[i + W - 1 - j].push_back(i * W + j);
}
}
vector<int> allX, allY, prefX, prefY, result;
for(int i = 0; i <= H + W - 2; i ++){
allX.push_back(add_or(X[i]));
allY.push_back(add_or(Y[i]));
prefX.push_back(add_or(allX));
prefY.push_back(add_or(allY));
if(i >= K){
result.push_back(add_and({allX[i], prefX[i - K]}));
result.push_back(add_and({allY[i], prefY[i - K]}));
}
}
return add_or(result);
}
void construct_network(int H, int W, int K) {
if(H + W - 2 == K)
solve(H, W, K);
else
add_xor({solve(H, W, K), solve(H, W, K + 1)});
}
# | 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... |