Submission #419024

#TimeUsernameProblemLanguageResultExecution timeMemory
419024mosiashvililukaVision Program (IOI19_vision)C++14
52 / 100
8 ms588 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; int a,b,c,d,e,i,j,ii,jj,zx,xc,k,p[1000009],pi; vector <int> vv; int F(int q, int w){ return q*b+w; } void construct_network(int H, int W, int K) { a=H;b=W;k=K; if(a<=30&&b<=30){ for(i=0; i<a; i++){ for(j=0; j<b; j++){ vv.clear(); for(ii=0; ii<a; ii++){ for(jj=0; jj<b; jj++){ if(abs(i-ii)+abs(j-jj)!=k) continue; vv.push_back(F(ii,jj)); } } if(vv.size()==0) continue; c=add_or(vv); pi++; vv.clear();vv.push_back(c);vv.push_back(F(i,j)); p[pi]=add_and(vv); } } vv.clear(); for(i=1; i<=pi; i++){ vv.push_back(p[i]); } add_or(vv); return; } if(a==1){ vv.clear();pi=0; for(j=0; j<b; j++){ if(j>=k){ vv.clear();vv.push_back(F(0,j-k));vv.push_back(F(0,j)); pi++; p[pi]=add_and(vv); } } vv.clear(); for(i=1; i<=pi; i++){ vv.push_back(p[i]); } add_or(vv); return; } if(b==1){ vv.clear();pi=0; for(j=0; j<a; j++){ if(j>=k){ vv.clear();vv.push_back(F(j-k,0));vv.push_back(F(j,0)); pi++; p[pi]=add_and(vv); } } vv.clear(); for(i=1; i<=pi; i++){ vv.push_back(p[i]); } add_or(vv); return; } vv.clear();pi=0; for(i=0; i<a; i++){ for(j=0; j<b; j++){ if(i+j==k){ vv.push_back(F(i,j)); } } } pi++; p[pi]=add_or(vv); }
#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...