Submission #1207780

#TimeUsernameProblemLanguageResultExecution timeMemory
1207780tamzidConnecting Supertrees (IOI20_supertrees)C++20
Compilation error
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-1][i] = 1;
		a[i][i-1] = 1;
	}

	build(a);

	return 1;
}
#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=1;i<n;++i)
	{
		a[0][i] = 1;
		a[i][0] = 1;
	}

	build(a);

	return 1;
}

Compilation message (stderr)

supertrees.cpp:31:5: error: redefinition of 'int construct(std::vector<std::vector<int> >)'
   31 | int construct(std::vector<std::vector<int>> p) {
      |     ^~~~~~~~~
supertrees.cpp:5:5: note: 'int construct(std::vector<std::vector<int> >)' previously defined here
    5 | int construct(std::vector<std::vector<int>> p) {
      |     ^~~~~~~~~