# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1064758 | Osplei | Stations (IOI20_stations) | C++17 | 527 ms | 684 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector <int> bfs (int n, int nodo, vector <int> grafo[1005]){
vector <int> aux(n);
bool visto[1005] = {false};
queue <int> q;
int pos = 0;
q.push(nodo);
while (!q.empty()){
int act = q.front();
q.pop();
if (visto[act] == true) continue;
visto[act] = true;
for (auto i : grafo[act]) q.push(i);
aux[act] = pos;
pos++;
}
return aux;
}
vector <int> label(int n, int k, vector <int> u, vector <int> v) {
vector <int> grafo[1005];
map <int, int> entra;
for (int i = 0; i < n; i++) entra[i] = 0;
for (int i = 0; i < u.size(); i++) {
int a = u[i], b = v[i];
if (b < a) swap(a, b);
entra[b]++;
grafo[a].pb(b);
grafo[b].pb(a);
}
for (auto i : entra) {
if (i.second == 0){
vector <int> labels = bfs(n, i.first, grafo);
return labels;
}
}
return u;
}
int find_next_station(int s, int t, vector <int> c) {
if (c.size() == 1) return c[0];
if (t > s) return max(c[0], c[1]);
else return min(c[0], c[1]);
}
컴파일 시 표준 에러 (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... |