답안 #165930

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
165930 2019-11-29T17:01:42 Z keta_tsimakuridze Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
#include "vision.h"
vector<int>V;
int ans(){
	return add_or(V);
}
void construct_network(int h, int w, int K){
	vector<int> Dr[405],Dl[405];
	int cur,diag[405],d[450],a,b,k;
	for(int i=0;i<w;i++)
	for(int j=0;j<h;j++){
		Dr[i-j+h-1].push_back(i*w+j);
	}
	
	
	for(int i=0;i<w;i++)
	for(int j=0;j<h;j++){
		Dl[i+j].push_back(i*w+j);
	}
	
	
	
	
	for(int i=w+h-1;i>=0;i--){
		cur.clear();
		cur.push_back(add_or(Dr[i]));
		
		diag[i]=add_or(cur,diag[i+1]);
		b=0;
		if(i+k<=w+h-1){
			
			a=add_and(diag[i+k],cur);
			
			
		}
		if(i+k<=w+h-2)
		b=add_and(diag[i+k+1],cur);
		
		V.push_back(add_xor(b,a));
		
		
	}
	
	
	
		for(int i=0;i<=w+h-1;i++){
		
		cur.clear();
		cur.push_back(add_or(Dl[i]));
		
		d[i]=add_or(cur,d[max(0,i-1)]);
		b=0;
		if(i-k>=0){
			
			a=add_and(d[i-k],cur);
			
			
		}
		if(i-k-1>=0)
		b=add_and(d[i-k-1],cur);
		
		V.push_back(add_xor(b,a));
		
		
	}
	
	ans();
	
	
	
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:26:7: error: request for member 'clear' in 'cur', which is of non-class type 'int'
   cur.clear();
       ^~~~~
vision.cpp:27:7: error: request for member 'push_back' in 'cur', which is of non-class type 'int'
   cur.push_back(add_or(Dr[i]));
       ^~~~~~~~~
vision.cpp:29:31: error: could not convert 'cur' from 'int' to 'std::vector<int>'
   diag[i]=add_or(cur,diag[i+1]);
                               ^
vision.cpp:33:22: error: could not convert 'diag[(i + k)]' from 'int' to 'std::vector<int>'
    a=add_and(diag[i+k],cur);
              ~~~~~~~~^
vision.cpp:38:23: error: could not convert 'diag[((i + k) + 1)]' from 'int' to 'std::vector<int>'
   b=add_and(diag[i+k+1],cur);
             ~~~~~~~~~~^
vision.cpp:40:26: error: could not convert 'b' from 'int' to 'std::vector<int>'
   V.push_back(add_xor(b,a));
                          ^
vision.cpp:49:7: error: request for member 'clear' in 'cur', which is of non-class type 'int'
   cur.clear();
       ^~~~~
vision.cpp:50:7: error: request for member 'push_back' in 'cur', which is of non-class type 'int'
   cur.push_back(add_or(Dl[i]));
       ^~~~~~~~~
vision.cpp:52:32: error: could not convert 'cur' from 'int' to 'std::vector<int>'
   d[i]=add_or(cur,d[max(0,i-1)]);
                                ^
vision.cpp:56:19: error: could not convert 'd[(i - k)]' from 'int' to 'std::vector<int>'
    a=add_and(d[i-k],cur);
              ~~~~~^
vision.cpp:61:20: error: could not convert 'd[((i - k) - 1)]' from 'int' to 'std::vector<int>'
   b=add_and(d[i-k-1],cur);
             ~~~~~~~^
vision.cpp:63:26: error: could not convert 'b' from 'int' to 'std::vector<int>'
   V.push_back(add_xor(b,a));
                          ^