# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1062597 | jamjanek | 기지국 (IOI20_stations) | C++14 | 614 ms | 1164 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
vector<int>graf[1010];
int pre[1010], it=-1, post[1010];
void dfs(int x, int o){
pre[x] = ++it;
for(auto j: graf[x])
if(j!=o)
dfs(j, x);
post[x] = it;
}
vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
int i;
for(i=0;i<n;i++)graf[i].clear();
for(i=0;i<n-1;i++){
graf[u[i]].push_back(v[i]);
graf[v[i]].push_back(u[i]);
}
it= -1;
dfs(0, 0);
std::vector<int> labels(n);
for (int i = 0; i < n; i++) {
labels[i] = 1000*pre[i]+post[i];
}
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
int pre1, post1, pre2, post2;
pre1 = s/1000;post1 = s%1000;
pre2 = t/1000;post2 = t%1000;
int ojciec;
for(auto j: c){
int pre3 = j/1000, post3 = j%1000;
if(pre3<pre1){
ojciec = j;
continue;
}
if(pre3<=pre2 && pre2<=post3)
return j;
}
return ojciec;
}
컴파일 시 표준 에러 (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... |