Submission #282756

# Submission time Handle Problem Language Result Execution time Memory
282756 2020-08-24T21:43:43 Z medmdg Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#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(m);
                return;
            }
        }
    }
    add_not(m);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:13:16: error: 'add_or' was not declared in this scope
   13 |         bool d=add_or(a);
      |                ^~~~~~
vision.cpp:15:16: error: 'add_not' was not declared in this scope
   15 |             if(add_not(m)==0){
      |                ^~~~~~~
vision.cpp:33:16: error: 'add_not' was not declared in this scope
   33 |             if(add_not(i)==0){
      |                ^~~~~~~
vision.cpp:35:17: error: 'add_or' was not declared in this scope
   35 |                 add_or(m);
      |                 ^~~~~~
vision.cpp:34:21: warning: unused variable 'k' [-Wunused-variable]
   34 |                 int k[1]={i};
      |                     ^
vision.cpp:40:5: error: 'add_not' was not declared in this scope
   40 |     add_not(m);
      |     ^~~~~~~