| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 592267 | Soumya1 | 기지국 (IOI20_stations) | C++17 | 932 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
const int mxN = 1005;
vector<int> ad[mxN];
int in[mxN], out[mxN];
int timer;
void dfs(int u, int p) {
in[u] = timer++;
for (int v : ad[u]) {
if (v == p) continue;
dfs(v, u);
}
out[u] = timer;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
timer = 0;
for (int i = 0; i < n; i++) {
ad[i].clear();
}
for (int i = 0; i < n - 1; i++) {
ad[u[i]].push_back(v[i]);
ad[v[i]].push_back(u[i]);
}
dfs(0, -1);
vector<int> ret(n);
for (int i = 0; i < n; i++) {
ret[i] = in[i] * 1000 + out[i];
}
return ret;
}
int find_in(int x) {
return x / 1000;
}
int find_out(int x) {
return x % 1000;
}
bool parent(int p, int u) {
return find_in(p) <= find_in(u) && find_out(u) <= find_out(p);
}
int find_next_station(int s, int t, vector<int> c) {
if (parent(s, t)) {
for (int x : c) {
if (parent(x, t) && parent(s, x)) return x;
}
} else {
for (int x : c) {
if (parent(x, s)) return x;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
