Submission #1207769

#TimeUsernameProblemLanguageResultExecution timeMemory
1207769tamzidConnecting 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][0] = 1; a[0][i] = 1; } build(a); return 1; }

Compilation message (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});
      |                 ~~~~~^~~~~