Submission #302264

#TimeUsernameProblemLanguageResultExecution timeMemory
302264EJOI2019AndrewConnecting Supertrees (IOI20_supertrees)C++14
Compilation error
0 ms0 KiB
#include "supertrees.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
int construct(std::vector<std::vector<int>> p) {
	vector<vector<int>> answer;
	answer.assign(p.size()+1,vector<int>());
	for(int i=0; i<p.size(); ++i)
    {
    for(int j=0; j<p.size(); ++j)
    answer[i][j]=0;
    }
    for(int i=0; i<n-1; ++i)
    answer[i][i+1]=1;
	build(answer);
	return 1;
}

Compilation message (stderr)

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:8:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  for(int i=0; i<p.size(); ++i)
      |               ~^~~~~~~~~
supertrees.cpp:10:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(int j=0; j<p.size(); ++j)
      |                  ~^~~~~~~~~
supertrees.cpp:13:20: error: 'n' was not declared in this scope
   13 |     for(int i=0; i<n-1; ++i)
      |                    ^