Submission #737247

#TimeUsernameProblemLanguageResultExecution timeMemory
737247bobthebuilderVision Program (IOI19_vision)C++17
26 / 100
9 ms1876 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; #define sz(x) (int)x.size() #define REP(i,n) for(int i=0;i<n;i++) #define REP1(i,n) for(int i=1;i<=n;i++) #define pb push_back #define lowb(x) (x&(-x)) #define ALL(_x) _x.begin(),_x.end() #define pii pair<int,int> #define f first #define s second #define SORT_UNIQUE(x) sort(ALL(x)),x.erase(unique(ALL(x)),x.end()) const int maxn=1e3+5; #define ll long long vector<int> a[maxn],b[maxn]; int n,m; int aa[maxn],bb[maxn]; int pa[maxn],pb[maxn]; int leq(int x){ vector<int> az,bz; REP1(i,n+m-2){ if(i>=x+1) az.pb(add_and({aa[i],add_not(pa[i-x-1]),pa[i-1]})),bz.pb(add_and({bb[i],add_not(pb[i-x-1]),pb[i-1]})); else az.pb(add_and({aa[i],pa[i-1]})),bz.pb(add_and({bb[i],pb[i-1]})); } return add_and({add_or(az),add_or(bz)}); } void construct_network(int H, int W, int K) { n=H,m=W; REP(i,n){ REP(j,m){ a[i+j].pb(i*m+j); b[i-j+m-1].pb(i*m+j); } } REP(i,n+m-1){ aa[i]=add_or(a[i]); bb[i]=add_or(b[i]); } pa[0]=aa[0],pb[0]=bb[0]; REP1(i,n+m-2){ pa[i]=add_or({pa[i-1],aa[i]}); pb[i]=add_or({pb[i-1],bb[i]}); } if(K==1){ leq(K); return; } int a=leq(K),b=leq(K-1); add_and({a,add_not(b)}); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...