답안 #166106

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
166106 2019-11-30T18:25:41 Z keta_tsimakuridze Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
int ans(int H, int W, int K)
{
vector<int>V;
	vector<int> Dr[405],Dl[405],cur,p,b,a,x;
	int diag[405],dia[450],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);	
		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_and({add_or(cur),add_or(p)});
	
		if(i+K<=W+H-1){
			 p.clear();
		 p.push_back(diag[i+K]);
			a.push_back(add_and({diag[i+k],add_or(cur)}));
			
			
		}
		if(i+K<=W+H-2){
		 p.clear();
		 p.push_back(diag[i+K+1]);
		 x.clear();
		 x.push_back(add_and(cur));
		 
		b.push_back(add_and({p,x}));
	}
		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(dia[i+1]);
		dia[i]=add_and({add_or(cur),add_or(p)});
	
		if(i-K>=0){
			 p.clear();
		 p.push_back(dia[i-K]);
			a.push_back(add_and({diag[i-K],add_or(cur)}));
			
			
		}
		if(i-K>=1){
		 p.clear();
		 p.push_back(diag[i-K-1]);
		b.push_back(add_and({p,add_and(cur)}));
	}
		V.push_back(add_xor({b,a}));
		
	}
	return add_or(V);
}
void construct_network(int H, int W, int K){
	ans(H,W,k);
}
	
	

Compilation message

vision.cpp: In function 'int ans(int, int, int)':
vision.cpp:36:28: error: could not convert '{p, x}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   b.push_back(add_and({p,x}));
                            ^
vision.cpp:38:28: error: could not convert '{b, a}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   V.push_back(add_xor({b,a}));
                            ^
vision.cpp:59:39: error: could not convert '{p, add_and(std::vector<int>(cur))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   b.push_back(add_and({p,add_and(cur)}));
                                       ^
vision.cpp:61:28: error: could not convert '{b, a}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   V.push_back(add_xor({b,a}));
                            ^
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:67:10: error: 'k' was not declared in this scope
  ans(H,W,k);
          ^