제출 #1207769

#제출 시각아이디문제언어결과실행 시간메모리
1207769tamzid슈퍼트리 잇기 (IOI20_supertrees)C++20
컴파일 에러
0 ms0 KiB
#include "supertrees.h"
#include <vector>
using namespace std;

int construct(std::vector<std::vector<int>> p) {
	
	int n = p.size();

	if(n == 1)
	{
		build({0});
		return 1;
	}

	vector<vector<int>> a(n,vector<int>(n,0));

	for(int i=0;i<n;++i)
	{
		a[i][0] = 1;
		a[0][i] = 1;
	}

	build(a);

	return 1;
}

컴파일 시 표준 에러 (stderr) 메시지

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:11:22: error: converting to 'std::vector<std::vector<int> >' from initializer list would use explicit constructor 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::vector<int> >]'
   11 |                 build({0});
      |                 ~~~~~^~~~~