답안 #291577

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
291577 2020-09-05T13:45:00 Z medmdg Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
 
void construct_network(int H, int W, int K){
    vector<int> b;
    for(int i=0;i<H*W;i+=20){
        vector<int> h;
        for(int j=i;j<min(i+20,H*W);j++){
            h.push_back(j);
        }
        if(h.size())
        if(!add_and(h)){
            for(int j=i;j<min(H*W,i+20);j++){
                if(add_not(j)){
                    b.push_back(j);
                }
            }
        }
    }
        int x1=b[0]%W;
        int x2=b[1]%W;
        int y1=b[0]/W;
        int y2=b[1]/W;
        bool tr=false;
        if(abs(x1-x2)+abs(y1-y2)==K){
            tr=true;
        }
        if(tr){
            int f=add_or(b);
        }else{
            int f=add_(b[0]);
        }
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:30:17: warning: unused variable 'f' [-Wunused-variable]
   30 |             int f=add_or(b);
      |                 ^
vision.cpp:32:19: error: 'add_' was not declared in this scope; did you mean 'add_or'?
   32 |             int f=add_(b[0]);
      |                   ^~~~
      |                   add_or
vision.cpp:32:17: warning: unused variable 'f' [-Wunused-variable]
   32 |             int f=add_(b[0]);
      |                 ^