Submission #316450

#TimeUsernameProblemLanguageResultExecution timeMemory
316450kylych03Vision Program (IOI19_vision)C++14
66 / 100
11 ms1152 KiB
#include "vision.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; void construct_network(int H, int W, int K) { vector<int> vec; if( (H < 31 && W < 31) || (H==1 || W==1) ){ for(int i = 0 ; i < H; i++ ){ for(int j = 0 ; j < W; j++){ vector <int> v,v1; for(int t = i; t< H; t++) for(int p = 0 ; p < W; p++) if(abs (t - i) + abs(p - j) == K){ int p2 = t*W + p; v.push_back(p2); } int p1 = i*W + j; v1.push_back(p1); if(v.size()== 0) continue; v1.push_back( add_or(v)); vec.push_back( add_and(v1) ); } } add_or(vec); return ; } if(K==1 ){ vector <int> h,w; for(int i = 0 ; i < H; i++ ){ vector <int> v; for(int j = 0 ; j < W; j++){ v.push_back(i * W + j); } h.push_back(add_or(v)); } for(int i = 0 ; i < W; i++ ){ vector <int> v; for(int j = 0 ; j < H; j++){ v.push_back(j * W + i); } w.push_back(add_or(v)); } int th = add_xor(h); int tw = add_xor(w); for(int i =0 ; i < H-1 ; i++) vec.push_back(add_and( {tw, h[i], h[i+1]})); for(int i =0 ; i < W-1 ; i++) vec.push_back(add_and( {th, w[i], w[i+1]})); add_or(vec); return ; } vector <int> v; for(int i = 0 ; i < H; i++ ) for(int j = 0 ; j < W; j++) if(j + i == K){ v.push_back(i*W + j); } add_or(v); //add_not(c); }
#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...