# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
143785 | jwvg0425 | Split the Attractions (IOI19_split) | C++17 | 130 ms | 10156 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 <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <bitset>
#include <map>
#include <set>
#include <tuple>
#include <string.h>
#include <math.h>
#include <random>
#include <functional>
#include <assert.h>
#include <math.h>
#define all(x) (x).begin(), (x).end()
#define xx first
#define yy second
using namespace std;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
vector<int> edge[100005];
vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) {
for (int i = 0; i < p.size(); i++)
{
edge[p[i]].push_back(q[i]);
edge[q[i]].push_back(p[i]);
}
vector<int> num(n, -1);
queue<int> que;
que.push(1);
b--;
num[1] = 2;
while (!que.empty() && b > 0)
{
auto now = que.front();
que.pop();
for (auto& e : edge[now])
{
if (num[e] != -1)
continue;
if (b == 0)
break;
num[e] = 2;
que.push(e);
b--;
}
}
for (int i = 0; i < n; i++)
{
if (num[i] == -1)
{
num[i] = 1;
break;
}
}
for (int i = 0; i < n; i++)
{
if (num[i] == -1)
num[i] = 3;
}
return num;
}
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... |