답안 #234766

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
234766 2020-05-25T13:54:49 Z anubhavdhar Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "vision.h"
#define ll long long int
#define pb push_back
#define mp make_pair
#define FOR(i,n) for(i=0;i<(n);++i)
#define FORe(i,n) for(i=1;i<=(n);++i)
#define FORr(i,a,b) for(i=(a);i<(b);++i)
#define FORrev(i,n) for(i=(n);i>=0;--i)
#define F0R(i,n) for(int i=0;i<(n);++i)
#define F0Re(i,n) for(int i=1;i<=(n);++i)
#define F0Rr(i,a,b) for(ll i=(a);i<(b);++i)
#define F0Rrev(i,n) for(int i=(n);i>=0;--i)
#define ii pair<ll,ll>
#define vi vector<ll>
#define vii vector<ii>
#define ff first 
#define ss second
#define cd complex<double>
#define vcd vector<cd>
#define ldd long double
#define dbgLine cout<<"Line : "<<__LINE__<<'\n'
#define all(x) (x).begin(),(x).end()
/*
using namespace std;

const short int __PRECISION = 10;

const ll MOD = 1e9+7;
const ll INF = 1e17 + 1101;
const ll LOGN = 17;
const ll MAXN = 2e5+5;
const ll ROOTN = 320;

const ldd PI = acos(-1);
const ldd EPS = 1e-7;

void add_and(vector<int> A)
{
	cout<<"and : ";
	for(int x : A)
		cout<<x<<' ';
	cout<<'\n';
}

void add_or(vector<int> A)
{
	cout<<"or : ";
	for(int x : A)
		cout<<x<<' ';
	cout<<'\n';
}

void add_xor(vector<int> A)
{
	cout<<"xor : ";
	for(int x : A)
		cout<<x<<' ';
	cout<<'\n';
}

void add_not(int A){cout<<"and : "<<A<<'\n';}
*/

#define inside(a, b) ((a) >= 0 && (a) < H && (b) >= 0 && (b) < W)
void construct_network(int H, int W, int K)
{
	int states = H*W;
	vector<int> V;
	F0R(i, H)
		F0R(j, W)
		{
			V.clear();
			F0Re(k, K)
			{
				if(inside(i+k-K, j+k))
					V.pb((i + k - K) * W + j + k);
				if(inside(i+k, j+K-k))
					V.pb((i + k) * W + j + K - k);
			}
			if(!V.empty())
			{
				add_or(V);
				add_and({states, i*W + j});
				states += 2;
			}
		}
	V.clear();
	for(int i = H*W + 1; i < states; i += 2)
		V.pb(i);
	add_or(V);
}
/*
int main()
{
  
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	int H, W, K;
	cin>>H>>W>>K;
	construct_network(H, W, K);
	return 0;
}*/

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:69:2: error: 'vector' was not declared in this scope
  vector<int> V;
  ^~~~~~
vision.cpp:69:2: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
                 from vision.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
vision.cpp:69:9: error: expected primary-expression before 'int'
  vector<int> V;
         ^~~
vision.cpp:73:4: error: 'V' was not declared in this scope
    V.clear();
    ^
vision.cpp:88:2: error: 'V' was not declared in this scope
  V.clear();
  ^