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