Submission #1252654

#TimeUsernameProblemLanguageResultExecution timeMemory
1252654dreamnguyenWorld Map (IOI25_worldmap)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "worldmap.h" using namespace std; using ll = long long; void giai(int v, vector<int> &used, vector<vector<int>> &g, vector<int> &o) { o.push_back(v); used[v] = 1; for (auto i : g[v]) { if (used[i] == 0) { giai(i, used, g, o); o.push_back(v); } } } std::vector<std::vector<int>> create_map(int N, int M, std::vector<int> A, std::vector<int> B) { int SIZE = 41; vector<int> used(SIZE, 0); vector<vector<int>> g(SIZE); for (int i = 0; i < M; i++) { g[A[i]].push_back(B[i]); g[B[i]].push_back(A[i]); } vector<int> o; dfs(1, used, g, o); int n = (int)o.size(); vector<vector<int>> ans(n, vector<int> (n, 0)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { ans[i][j] = o[i]; } } return ans; }

Compilation message (stderr)

worldmap.cpp: In function 'std::vector<std::vector<int> > create_map(int, int, std::vector<int>, std::vector<int>)':
worldmap.cpp:26:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   26 |         dfs(1, used, g, o);
      |         ^~~
      |         ffs