답안 #165931

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
165931 2019-11-29T17:13:50 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],cur,p;
	int 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]));
		 p.clear();
		 p.push_back(diag[i+1]);
		diag[i]=add_or(cur,p);
		b=0;
		if(i+k<=w+h-1){
			 p.clear();
		 p.push_back(diag[i+k]);
			a=add_and(diag[i+k],cur);
			
			
		}
		if(i+k<=w+h-2){
		 p.clear();
		 p.push_back(diag[i+k+1]);
		b=add_and(p,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]));
		 p.clear();
		 p.push_back(d[max(0,i-1)]);
		d[i]=add_or(cur,p);
		b=0;
		if(i-k>=0){
			
			 p.clear();
		 p.push_back(d[i-k]);
			a=add_and(p,cur);
			
			
		}
		if(i-k-1>=0){
		p.clear();
		 p.push_back(d[i-k-1]);
		b=add_and(p,cur);
	}
		V.push_back(add_xor(b,a));
		
		
	}
	
	ans();
	
	
	
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:31:23: error: too many arguments to function 'int add_or(std::vector<int>)'
   diag[i]=add_or(cur,p);
                       ^
In file included from vision.cpp:4:0:
vision.h:12:5: note: declared here
 int add_or(std::vector<int> Ns);
     ^~~~~~
vision.cpp:36:22: error: could not convert 'diag[(i + k)]' from 'int' to 'std::vector<int>'
    a=add_and(diag[i+k],cur);
              ~~~~~~~~^
vision.cpp:43:18: error: too many arguments to function 'int add_and(std::vector<int>)'
   b=add_and(p,cur);
                  ^
In file included from vision.cpp:4:0:
vision.h:10:5: note: declared here
 int add_and(std::vector<int> Ns);
     ^~~~~~~
vision.cpp:45:26: error: could not convert 'b' from 'int' to 'std::vector<int>'
   V.push_back(add_xor(b,a));
                          ^
vision.cpp:59:20: error: too many arguments to function 'int add_or(std::vector<int>)'
   d[i]=add_or(cur,p);
                    ^
In file included from vision.cpp:4:0:
vision.h:12:5: note: declared here
 int add_or(std::vector<int> Ns);
     ^~~~~~
vision.cpp:65:19: error: too many arguments to function 'int add_and(std::vector<int>)'
    a=add_and(p,cur);
                   ^
In file included from vision.cpp:4:0:
vision.h:10:5: note: declared here
 int add_and(std::vector<int> Ns);
     ^~~~~~~
vision.cpp:72:18: error: too many arguments to function 'int add_and(std::vector<int>)'
   b=add_and(p,cur);
                  ^
In file included from vision.cpp:4:0:
vision.h:10:5: note: declared here
 int add_and(std::vector<int> Ns);
     ^~~~~~~
vision.cpp:74:26: error: could not convert 'b' from 'int' to 'std::vector<int>'
   V.push_back(add_xor(b,a));
                          ^