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>
#define ll int
#define vll vector<ll>
#define ins insert
#define pb push_back
using namespace std;
void construct_network(int h, int w, int k) {
ll i,j;
auto check = [&](ll k){
auto calc = [&](auto dia){
vll a;
for(auto [i, j] : dia){
a.pb(add_or(j));
}
vll pr(a.size());
ll n=a.size();
for(i=0;i<n;i++){
if(i==0) pr[i] = a[i];
else pr[i] = add_or({pr[i - 1], a[i]});
}
vll res;
for(i=k;i<n;i++){
res.pb(add_and({pr[i - k], a[i]}));
}
return add_or(res);
};
map<ll,vector<ll>> dia,dia2;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
dia[i+j].pb(i * w + j);
dia2[i-j].pb(i * w + j);
}
}
return add_or({calc(dia), calc(dia2)});
};
ll a = check(k), b = check(k + 1);
add_and({a, add_not(b)});
}
# | 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... |