답안 #211849

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
211849 2020-03-21T14:17:29 Z MarcoMeijer Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

//macros
typedef long long ll;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#define RE1(a,c) REP(a,1,c+1)
#define REI(a,b,c) REP(a,b,c+1)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define INF 1e9
#define pb push_back
#define fi first
#define se second
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MX=500;

vi diagonal[2];
int dist[2][MX];
int h, w, k;
vi ans;

int getPos(int i, int j) {
	return j+i*w;
}
void construct_network(int H, int W, int K) {
	h=H, w=W, k=K;
	RE(i,w+h-1) {
		int x=i, y=0;
		if(x>=h) {
			y=x-h+1;
			x=h-1;
		}
		vi f;
		while(x>=0 && y<w) {
			f.pb(getPos(x,y));
			x--;
			y++;
		}
		diagonal[0].pb(add_and(f));
	}
	RE(i,w+h-1) {
		int x=0, y=w-i-1;
		if(y<0) {
			x=-y;
			y=0;
		}
		vi f;
		while(x>=0 && y>=0) {
			f.pb(getPos(x,y));
			x++;
			y++;
		}
		diagonal[1].pb(add_and(f));
	}
	RE(i,2) REP(j,1,k+1) {
		vi f;
		RE(l,diagonal[i].size()-j) {
			vi g;
			g.pb(diagonal[i][l]);
			g.pb(diagonal[i][l+j]);
			f.pb(add_and(g));
		}
		dist[i][j] = add_or(f);
	}
	RE(i,2) {
		vi f;
		RE(j,k) f.pb(dist[!i][j]);
		ans.pb(add_and(add_or(f), dist[i][k]));
	}
	add_or(ans[0], ans[1]);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:47:18: error: 'add_and' was not declared in this scope
   diagonal[0].pb(add_and(f));
                  ^~~~~~~
vision.cpp:61:18: error: 'add_and' was not declared in this scope
   diagonal[1].pb(add_and(f));
                  ^~~~~~~
vision.cpp:69:9: error: 'add_and' was not declared in this scope
    f.pb(add_and(g));
         ^~~~~~~
vision.cpp:71:16: error: 'add_or' was not declared in this scope
   dist[i][j] = add_or(f);
                ^~~~~~
vision.cpp:71:16: note: suggested alternative: 'rand_r'
   dist[i][j] = add_or(f);
                ^~~~~~
                rand_r
vision.cpp:76:18: error: 'add_or' was not declared in this scope
   ans.pb(add_and(add_or(f), dist[i][k]));
                  ^~~~~~
vision.cpp:76:18: note: suggested alternative: 'rand_r'
   ans.pb(add_and(add_or(f), dist[i][k]));
                  ^~~~~~
                  rand_r
vision.cpp:76:10: error: 'add_and' was not declared in this scope
   ans.pb(add_and(add_or(f), dist[i][k]));
          ^~~~~~~
vision.cpp:78:2: error: 'add_or' was not declared in this scope
  add_or(ans[0], ans[1]);
  ^~~~~~
vision.cpp:78:2: note: suggested alternative: 'rand_r'
  add_or(ans[0], ans[1]);
  ^~~~~~
  rand_r