Submission #316392

#TimeUsernameProblemLanguageResultExecution timeMemory
316392kylych03Vision Program (IOI19_vision)C++14
44 / 100
5 ms1148 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(K==1){ for(int i = 0 ; i < H; i++ ){ for(int j = 0 ; j < W; j++){ if( i + 1 < H ){ int p1 = i*W + j; int p2 = (i+1)*W + j; vector <int> v; v.push_back(p1); v.push_back(p2); vec.push_back( add_and(v) ); } if( j + 1 < W ){ int p1 = i*W + j; int p2 = i*W + j+1; vector <int> v; v.push_back(p1); v.push_back(p2); vec.push_back( add_and(v) ); } } } add_or(vec); return ; } 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 ; } 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); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:31:15: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   31 |     if(H < 31 && W < 31 || (H==1 || W==1) ){
      |        ~~~~~~~^~~~~~~~~
#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...