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;
int test(int H, int W, int K)
{
// 두 점의 거리 d가 K 이상인지 확인
vector <int> P[400], Q[400];
for (int i=0;i<H;i++) for (int j=0;j<W;j++){
P[i+j].push_back(i*W+j);
Q[i-j+W-1].push_back(i*W+j);
}
int VP[400], VQ[400];
int SP[400], SQ[400];
vector <int> or_arr;
for (int i=0;i<=H+W-2;i++){
VP[i] = add_or(P[i]);
SP[i] = i > 0 ? add_or({SP[i-1], VP[i]}) : VP[i];
VQ[i] = add_or(Q[i]);
SQ[i] = i > 0 ? add_or({SQ[i-1], VQ[i]}) : VQ[i];
if (i >= K){
or_arr.push_back(add_and({VP[i], SP[i-K]}));
or_arr.push_back(add_and({VQ[i], SQ[i-K]}));
}
}
return add_or(or_arr);
}
void construct_network(int H, int W, int K)
{
if (K == H+W-2) test(H, W, K);
else add_xor({test(H, W, K+1), test(H, W, K)});
}
# | 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... |