제출 #301976

#제출 시각아이디문제언어결과실행 시간메모리
301976NicolaAbusaad2014Split the Attractions (IOI19_split)C++14
7 / 100
120 ms13944 KiB
#include "split.h" #include <bits/stdc++.h> using namespace std; vector<vector<long> >edges; long z=1,x=0; vector<int>ans; vector<bool>vis; long arr[3]; void solve(long n) { vis[n]=true; if(arr[x]==0){ x++; } arr[x]--; ans[n]=x+1; for(long i=0;i<(long)edges[n].size();i++){ if(!vis[edges[n][i]]){ solve(edges[n][i]); } } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { edges.resize(n); ans.resize(n); vis.resize(n); for(long i=0;i<(long)p.size();i++){ edges[p[i]].push_back(q[i]); edges[q[i]].push_back(p[i]); } arr[0]=a; arr[1]=b; arr[2]=c; solve(0); 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...