# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
232718 | UserIsUndefined | Split the Attractions (IOI19_split) | C++14 | 195 ms | 18680 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "split.h"
using namespace std;
vector<int> adj[100005];
int ok;
map<int,int> visited;
map<int,int> good;
int sz;
int now;
void dfs(int v){
visited[v] = true;
sz--;
good[v] = now;
if (sz <= 0){
if (sz < 0){visited[v] = false; good[v] = 0;}
return ;
}
for (int i : adj[v]){
if (visited[i] == false){
dfs(i);
}
}
}
vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) {
vector<int> res(n, 0);
for (int i = 0 ; i < p.size() ; i++){
int x = p[i];
int y = q[i];
adj[x].push_back(y);
adj[y].push_back(x);
}
sz = b;
now = 2;
dfs(0);
bool ok = false;
for (int i = 0 ; i < n ; i++){
if ((good[i] == 0)&&(ok == false)){res[i] = 1; ok = true;}
else res[i] = (good[i] == 0 ? 3 : good[i]);
}
// for (int i = 0 ; i < res.size() ; i++){
// cout << res[i] << endl;
// }
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... |