답안 #165786

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
165786 2019-11-28T19:09:38 Z nikatamliani Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
# include "vision.h";
# include <bits/stdc++.h>
using namespace std;
int get(int H, int W, int K){
	vector < int > x[500], y[500], x1, y1, x2, y2, res;
	for(int i = 0; i < H; i ++){
		for(int j = 0; j < W; j ++){
			x[i + j].push_back(i * W + j);
			y[i - j + W - 1].push_back(i * W + j);
		}
	}
	for(int i = 0; i <= H + W - 2; i ++){
		x1.push_back(add_or(x[i]));
		y1.push_back(add_or(y[i]));
		x2.push_back(add_or(x1));
		y2.push_back(add_or(y1));
		if(i >= K){
			res.push_back(add_and(x1[i], x2[i - K]));
			res.push_back(add_and(y1[i], y2[i - K])); 
		}
	}
	return add_or(res);
}
void construct_network(int H, int W, int K){
	if(H + W - 2 > K){
		add_xor(get(H, W, K), get(H, W, K + 1)); 
	} else{
		get(H, W, K);
	}
}

Compilation message

vision.cpp:1:21: warning: extra tokens at end of #include directive
 # include "vision.h";
                     ^
vision.cpp: In function 'int get(int, int, int)':
vision.cpp:18:42: error: could not convert 'x1.std::vector<int>::operator[](((std::vector<int>::size_type)i))' from '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' to 'std::vector<int>'
    res.push_back(add_and(x1[i], x2[i - K]));
                                          ^
vision.cpp:19:42: error: could not convert 'y1.std::vector<int>::operator[](((std::vector<int>::size_type)i))' from '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' to 'std::vector<int>'
    res.push_back(add_and(y1[i], y2[i - K])); 
                                          ^
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:26:14: error: could not convert 'get(H, W, K)' from 'int' to 'std::vector<int>'
   add_xor(get(H, W, K), get(H, W, K + 1)); 
           ~~~^~~~~~~~~