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 pos1 = -1,pos0 = -1;
int calc(int n,int m,int k,int coef){
vector<int> cands;
map<int,vector<int>> mp;
for(int i = 0;i<n;i++){
for(int j = 0;j<m;j++){
mp[i+coef*j].push_back(i * m + j);
}
}
map<int,int> idx;
for(auto u:mp){
idx[u.first] = add_or(u.second);
}
for(auto u:mp){
vector<int> pos;
for(auto c:mp){
if(u.first + k < c.first){
pos.push_back(idx[c.first]);
}
}
if(pos.empty())continue;
cands.push_back(add_and({idx[u.first],add_or(pos)}));
}
if(cands.empty()){
return pos1;
}
return add_not(add_or(cands));
}
int get(int n,int m,int k){
return add_and({calc(n,m,k,1),calc(n,m,k,-1)});
}
void construct_network(int H, int W, int K) {
pos1 = add_or({0,add_not(0)});
pos0 = add_not(pos1);
add_and({get(H,W,K),add_not(get(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... |