# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145421 | JovanK26 | Split the Attractions (IOI19_split) | C++14 | 91 ms | 10604 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 "split.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q)
{
vector<int> rez(n);
vector<int> v[n];
for(int i=0;i<p.size();i++)
{
v[p[i]].push_back(q[i]);
v[q[i]].push_back(p[i]);
}
if(a==1)
{
int ind=-1;
for(int i=0;i<n;i++)
{
rez[i]=0;
if(v[i].size()>=b)
{
ind=i;
}
}
if(ind!=-1)
{
rez[ind]=1;
for(int i=0;i<v[ind].size();i++)
{
if(i==b)break;
rez[v[ind][i]]=2;
}
for(int i=0;i<n;i++)
{
if(rez[i]==0)rez[i]=3;
}
}
else
{
for(int i=0;i<n;i++)
{
rez[i]=0;
}
}
return rez;
}
return rez;
}
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... |