답안 #245358

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
245358 2020-07-06T06:22:00 Z crossing0ver Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define local
#ifndef local
#include "vision.h"
#endif
using namespace std;
int k,H,W;
int get_id(int i,int j) {
	return i*W+j;
}
void smallCase() {
	vector<pii> s;
	for (int i = 0; i < H; i++)
	for (int j = 0; j < W; j++)
	for (int a = i; a < H; a++)
	for (int b = 0; b < W; b++) {
			if (abs(i-a)+abs(j-b) == k) s.pb({get_id(i,j),get_id(a,b)});
		}
	int a = 0;
	for (auto i : s) {
		vector<int> v = {i.first,i.second};
		a|=add_and(v);
	}
	int x = s.size();
	vi v;
	for (int i = H*W; i < H*W + x;i++)
		v.pb(i);
	if (v.size() == 0) {
		add_not(1);
		return;
	}
	add_or(v);
	
	
}
void construct_network(int H1, int W1, int k1) {
	k = k1;
	H = H1, W = W1;
	vector<pii> s;
	if (H1*W1*4 < 10000) {
		smallCase();
		return;
	}
	vector<int> v;
	int cnt = 0;
	for (int i = 0; i < H;i++)
	for (int j = 0;j < W; j++) 
		if (i + j == k) {
			add_and({0,get_id(i,j)});
			cnt++;
		}
	for (int i = H*W; i < H*W + cnt; i++)
		v.pb(i);
	add_or(v);
	
}

Compilation message

vision.cpp: In function 'void smallCase()':
vision.cpp:25:6: error: 'add_and' was not declared in this scope
   a|=add_and(v);
      ^~~~~~~
vision.cpp:32:3: error: 'add_not' was not declared in this scope
   add_not(1);
   ^~~~~~~
vision.cpp:35:2: error: 'add_or' was not declared in this scope
  add_or(v);
  ^~~~~~
vision.cpp:35:2: note: suggested alternative: 'rand_r'
  add_or(v);
  ^~~~~~
  rand_r
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:52:4: error: 'add_and' was not declared in this scope
    add_and({0,get_id(i,j)});
    ^~~~~~~
vision.cpp:57:2: error: 'add_or' was not declared in this scope
  add_or(v);
  ^~~~~~
vision.cpp:57:2: note: suggested alternative: 'rand_r'
  add_or(v);
  ^~~~~~
  rand_r