| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 800403 | Liudas | 기지국 (IOI20_stations) | C++17 | 1 ms | 296 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
void dfs(int head, int par, vector<vector<int>> &tree, int &col, vector<int> &labels){
for(int i : tree[head]){
if(i != par){
dfs(i, head, tree, col, labels);
}
}
labels[head] = col ++;
}
int find_next_station(int s, int t, vector<int> labels){
sort(labels.begin(), labels.end());
if(t > labels.back()){
return labels.back();
}
for(int i : labels){
if(t <= i){
return i;
}
}
}
vector<int> label(int N, int K, vector<int> U, vector<int> V){
vector<vector<int>> tree(N);
for(int i = 0; i < N-1; i ++){
tree[U[i]].push_back(V[i]);
tree[V[i]].push_back(U[i]);
}
vector<int> labels(N);
int col = 0;
dfs(0, -1, tree, col, labels);
for(int i : labels){
cout << i << endl;
}
return labels;
}컴파일 시 표준 에러 (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... | ||||
