# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153724 | reda | Split the Attractions (IOI19_split) | C++14 | 129 ms | 12904 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std ;
vector<int> s;
vector<int> g[100001];
bool visited[100001];
void topo (int a)
{
if(visited[a])return ;
visited[a]=1;
for(int i=0;i<g[a].size();i++)
{
topo(g[a][i]);
}
s.push_back(a);
}
vector<int> find_split(int n , int a , int b ,int c ,vector<int>p , vector<int>q)
{
int m = p.size();
for(int i = 0 ;i < m ;i++ )
{
g[p[i]].push_back(q[i]);
g[q[i]].push_back(p[i]);
}
topo(0);
vector<int> ans(n,0);
for(int i = 0 ;i<a;i++)
{
ans[s[i]]=1;
}
for(int i = a;i<a+b;i++)
{
ans[s[i]]=2;
}
for(int i = a+b;i<n;i++)
{
ans[s[i]]=3;
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |