Submission #1135303

#TimeUsernameProblemLanguageResultExecution timeMemory
1135303vibeduckSplit the Attractions (IOI19_split)C++20
Compilation error
0 ms0 KiB
#include "split.h" #include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef pair<ll,ll> pll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<bool> vb; typedef vector<vector<int>> vvi; typedef vector<vector<bool>> vvb; typedef vector<vector<ll>> vvll; typedef vector<string> vs; typedef vector<vector<string>> vvs; typedef vector<char> vc; typedef vector<vector<char>> vvc; typedef map<int, int> mii; typedef unordered_map<int, int> umii; const int mxn = 1e5 + 5; vi adj[mxn]; int vis[mxn]; int deg[mxn]; vi ans; int cur = 0; int a1, b1, c1; void dfs(int node) { if (cur == b1) return; ans[node] = 2; cur++; vis[node] = 1; for (auto neighbour : adj[node]) { if (vis[neighbour]) continue; dfs(neighbour, node); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { a1 = a; b1 = b; c1 = c; int m = p.size(); ans.resize(n); for (int i = 0; i < m; i++) { adj[p[i]].push_back(q[i]); adj[q[i]].push_back(p[i]); deg[p[i]]++; deg[q[i]]++; } dfs(0, -1); for (int i = 0; i < n; i++) { if (!ans[i]) { ans[i] = 1; break; } } for (int i = 0; i < n; i++) { if (!ans[i]) { ans[i] = 3; } } return ans; }

Compilation message (stderr)

split.cpp: In function 'void dfs(int)':
split.cpp:32:12: error: too many arguments to function 'void dfs(int)'
   32 |         dfs(neighbour, node);
      |         ~~~^~~~~~~~~~~~~~~~~
split.cpp:26:6: note: declared here
   26 | void dfs(int node) {
      |      ^~~
split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:45:8: error: too many arguments to function 'void dfs(int)'
   45 |     dfs(0, -1);
      |     ~~~^~~~~~~
split.cpp:26:6: note: declared here
   26 | void dfs(int node) {
      |      ^~~