| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 432856 | Enkognit | 기지국 (IOI20_stations) | C++14 | 3057 ms | 2097156 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "stations.h"
#include <vector>
#define ll long long
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
vector<ll> c[1005];
ll T;
ll in[1005], out[1005], pp[1005];
void dfs(int h,int p=-1)
{
pp[h]=p;
in[h]=++T;
for (int i = 0; i < c[h].size(); i++)
if (c[h][i]!=p)
{
dfs(c[h][i], h);
}
out[h]=++T;
}
bool is_ancestor(int x,int y)
{
return in[x]<=in[y] && out[x]>=out[y];
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
std::vector<int> labels(n);
for (int i = 0; i < n; i++) {
labels[i] = i;
}
for (int i = 0; i < n-1; i++)
{
c[u[i]].pb(v[i]);
c[v[i]].pb(u[i]);
}
dfs(0);
return labels;
}
int find_next_station(int s, int t, std::vector<int> cc)
{
if (!is_ancestor(s, t)) return pp[s];
for (int i = 0; i < c[s].size(); i++)
if (is_ancestor(c[s][i], t) && pp[s]!=c[s][i]) return c[s][i];
}
컴파일 시 표준 에러 (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... | ||||
