# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
730736 | danikoynov | Split the Attractions (IOI19_split) | C++14 | 80 ms | 14452 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "split.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int deg[maxn], m, n;
vector < int > graph[maxn];
int used[maxn];
vector < int > order;
void stick(int v)
{
used[v] = 1;
order.push_back(v);
for (int u : graph[v])
{
if (!used[u])
stick(u);
}
}
vector<int> find_split(int N, int a, int b, int c, vector<int> p, vector<int> q)
{
n = N;
m = p.size();
for (int i = 0; i < p.size(); i ++)
{
graph[p[i]].push_back(q[i]);
graph[q[i]].push_back(p[i]);
}
bool deg2 = true;
for (int i = 0; i < m; i ++)
{
if (graph[i].size() > 2)
{
deg2 = false;
break;
}
}
int leaf = 0;
while(leaf < n && graph[leaf].size() != 1)
leaf ++;
if (leaf == n)
leaf = 0;
stick(leaf);
if (deg2)
{
vector < int > res(n);
for (int i = 0; i < n; i ++)
{
int v = order[i];
if (i < a)
res[v] = 1;
else
if (i < a + b)
res[v] = 2;
else
res[v] = 3;
}
return res;
}
else
{
vector < int > tmp;
return tmp;
}
}
컴파일 시 표준 에러 (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... |