# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
423416 | Belgutei | 기지국 (IOI20_stations) | C++17 | 1097 ms | 648 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "stations.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
vector<int> edge[1005];
bool visited[1005];
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
for(int i=0; i<n; i++) edge[i].clear();
for(int i=0; i<n; i++) visited[i]=0;
for(int i=0; i<u.size(); i++){
edge[u[i]].pb(v[i]);
edge[v[i]].pb(u[i]);
}
int pos=0;
for(int i=0; i<n; i++){
if(edge[i].size()==1){
pos=i;
break;
}
}
std::vector<int> labels(n);
int cnt=0;
while(visited[pos]==0){
labels[pos]=cnt;
visited[pos]=1;
for(int i=0; i<edge[pos].size(); i++){
if(visited[edge[pos][i]]==0){
pos=edge[pos][i];
break;
}
}
cnt++;
}
/*
cout<<"\n";
for(int i=0; i<n; i++){
cout<<labels[i]<<" ";
}
*/
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
if(c.size()==1){
return c[0];
}
int mx=max(c[0],c[1]);
int mn=min(c[0],c[1]);
if(s>t) return mn;
else return mx;
}
컴파일 시 표준 에러 (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... |