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>
using namespace std;
#include"vision.h"
#define N 205
int a[N][N];
vector<int> l[2*N],r[2*N],tl,tr,qsl,qsr;
bool sol(int k,int h,int w){
int i;
vector<int> t;
for(i=0;i+k<h+w-1;i++){
t.push_back(add_and({qsl[i],tl[i+k]}));
t.push_back(add_and({qsr[i],tr[i+k]}));
}
return add_or(t);
}
void construct_network(int h, int w, int k){
int i,j,sz=0;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
a[i][j]=sz++;
}
}
for(i=0;i<h;i++){
for(j=0;j<w;j++){
l[i+j].push_back(a[i][j]);
r[h-i-1+j].push_back(a[i][j]);
}
}
for(i=0;i<h+w-1;i++){
tl.push_back(add_or(l[i]));
qsl.push_back(add_or(tl));
tr.push_back(add_or(r[i]));
qsr.push_back(add_or(tr));
}
if(k==h+w-2)sol(k,h,w);
else add_and({sol(k,h,w),add_not(sol(k+1,h,w))});
}
# | 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... |