Submission #732751

#TimeUsernameProblemLanguageResultExecution timeMemory
732751raul2008487Connecting Supertrees (IOI20_supertrees)C++17
Compilation error
0 ms0 KiB
#include "supertrees.h" #include <vector> std::vector<std::vector<int>> ans; std::vector<bool> vis; void dfs(ll i, ll j){ vis[j]=1; for(ll k1=0;k1<n;k1++){ if(p[j][k1] && !vis[k1]){ ans[j][k1]=ans[k1][j]=1; dfs(j,k1); } } } int construct(std::vector<std::vector<int>> p) { int n = p.size(); vis.resize(n,false); for(int i=0;i<n;i++){ std::vector<int> row; row.resize(n,0); ans.push_back(row); } for (int i = 0; i < n; i++) { if(!vis[i]){ vis[i]=1; for(int j=i+1;j<n;j++){ if(p[i][j] && !vis[j]){ ans[i][j]=ans[j][i]=1; dfs(i,j); } } } } build(ans); return 1; }

Compilation message (stderr)

supertrees.cpp:5:6: error: variable or field 'dfs' declared void
    5 | void dfs(ll i, ll j){
      |      ^~~
supertrees.cpp:5:10: error: 'll' was not declared in this scope
    5 | void dfs(ll i, ll j){
      |          ^~
supertrees.cpp:5:16: error: 'll' was not declared in this scope
    5 | void dfs(ll i, ll j){
      |                ^~
supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:28:15: error: 'dfs' was not declared in this scope
   28 |               dfs(i,j);
      |               ^~~