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;
void construct_network(int H, int W, int K) {
bool special_case = min(H,W)>1 and max(H,W)>30;
vector<int> cultprits;
int lig = H*W;
for(int i=0;i<(special_case?1:H);i++) {
for(int j=0;j<(special_case?1:W);j++) {
vector<int> subcurprits;
for(int k=i;k<H;k++) {
for(int l=(k==i?j:0);l<W;l++) {
if(abs(i-k)+abs(j-l)!=K)continue;
subcurprits.emplace_back(k*W+l);
}
}
if(subcurprits.empty())continue;
add_or(subcurprits);
add_and({i*W+j,lig++});
cultprits.emplace_back(lig++);
}
}
add_or(cultprits);
}
# | 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... |