Submission #282758

#TimeUsernameProblemLanguageResultExecution timeMemory
282758medmdgVision Program (IOI19_vision)C++14
Compilation error
0 ms0 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K){ int l=0; int r=W*H-1; int m=l+r; m/=2; while(l<=r){ int a[m]; for(int i=0;i<=m;i++){ a[i]=i; } bool d=add_or(a); if(d){ if(add_not(m)==0){ break; } r=m-1; m=l+r; m/=2; continue; } l=m+1; m=l+r; m/=2; } int x=m%W; int y=m/W; for(int i=0;i<H*W;i++){ int xx=i%W; int yy=i/W; if(abs(xx-x)+abs(yy-y)==K){ if(add_not(i)==0){ int k[1]={i}; add_or(k); return; } } } add_not(m); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:14:23: error: could not convert '(int*)(& a)' from 'int*' to 'std::vector<int>'
   14 |         bool d=add_or(a);
      |                       ^
      |                       |
      |                       int*
vision.cpp:36:24: error: could not convert '(int*)(& k)' from 'int*' to 'std::vector<int>'
   36 |                 add_or(k);
      |                        ^
      |                        |
      |                        int*