Submission #316436

#TimeUsernameProblemLanguageResultExecution timeMemory
316436juggernautVision Program (IOI19_vision)C++14
58 / 100
11 ms1152 KiB
#include"vision.h" #include<bits/stdc++.h> #ifdef EVAL #else #include"grader.cpp" #endif using namespace std; void construct_network(int H,int W,int K){ if(min(H,W)==1||(H<31&&W<31)){ vector<int>total; for(int i1=0;i1<H;i1++) for(int j1=0;j1<W;j1++){ vector<int>v,vv; for(int i2=0;i2<H;i2++) for(int j2=0;j2<W;j2++) if(abs(i1-i2)+abs(j1-j2)==K)vv.push_back(i2*W+j2); if(vv.empty())continue; total.push_back(add_and({i1*W+j1,add_or(vv)})); } add_or(total); return; } vector<int>cas,row(H),col(W); int xor_row,xor_col; for(int i=0;i<H;i++){ vector<int>v; for(int j=0;j<W;j++)v.push_back(i*W+j); row[i]=add_or(v); } xor_row=add_xor(row); for(int j=0;j<W;j++){ vector<int>v; for(int i=0;i<H;i++)v.push_back(i*W+j); col[j]=add_or(v); } xor_col=add_xor(col); vector<int>v; for(int j=1;j<W;j++) v.push_back(add_and({col[j-1],col[j]})); cas.push_back(add_and({xor_row,add_or(v)})); v.clear(); for(int i=1;i<H;i++) v.push_back(add_and({row[i-1],row[i]})); cas.push_back(add_and({xor_col,add_or(v)})); add_or(cas); }
#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...