Submission #253717

#TimeUsernameProblemLanguageResultExecution timeMemory
253717ErkhemkhuuSplit the Attractions (IOI19_split)C++17
0 / 100
3 ms2688 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define F first #define S second const ll N = 100005; vector <int> path; bool vis[N]; vector <vector <int> > adj(N); void dfs(ll v) { vis[v] = true; path.pb(v); for(auto &u: adj[v]) { if(vis[u]) continue; dfs(u); } return; } vector <int> find_split(int n, int a, int b, int c, vector <int> p, vector <int> q) { int m = p.size(), i; for(i = 0; i < m; i++) { adj[p[i]].pb(q[i]); adj[q[i]].pb(p[i]); } dfs(0); vector <int> ans(n, 0); for(i = 0; i < a; i++) path[i] = 1; for(i = a; i < a + b; i++) path[i] = 2; for(i = a + b; i < n; i++) path[i] = 3; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...