답안 #370350

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
370350 2021-02-23T20:37:39 Z MilosMilutinovic Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
//#include "vision.h"
using namespace std;
#define pb push_back
const int N=205;
int h,w,k,a[N][N];
int Get(int i,int j){return a[i][j];}
void SolveBF(){
	int tmp=0;
	for(int i=0;i<h;i++)for(int j=0;j<w;j++)a[i][j]=tmp++;
	vector<int> ask;
	int cnt=h*w;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			for(int x=0;x<h;x++){
				for(int y=0;y<w;y++){
					if(i>x&&j>y)continue;
					int dist=abs(x-i)+abs(y-j);
					if(dist!=k)continue;
					add_and({Get(i,j),Get(x,y)});
					ask.pb(cnt);
					cnt++;
				}
			}
		}
	}
	if((int)ask.size()==0){
		add_not(1);
		return;
	}
	add_or(ask);
}
void construct_network(int H,int W,int K){
	h=H,w=W,k=K;
	if(max(H,W)<=30){
		SolveBF();
		return;
	}
}

Compilation message

vision.cpp: In function 'void SolveBF()':
vision.cpp:20:6: error: 'add_and' was not declared in this scope
   20 |      add_and({Get(i,j),Get(x,y)});
      |      ^~~~~~~
vision.cpp:28:3: error: 'add_not' was not declared in this scope
   28 |   add_not(1);
      |   ^~~~~~~
vision.cpp:31:2: error: 'add_or' was not declared in this scope
   31 |  add_or(ask);
      |  ^~~~~~