# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
336977 | Register | 기지국 (IOI20_stations) | C++14 | 1178 ms | 1248 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define y e[x][i]
using namespace std;
typedef vector<int> vec;
void dfs(int x,int fa,bool d,int&sum,const vector<vec> &e,vec&res){
if(d) res[x]=sum++;
for(int i=0;i<e[x].size();i++)
if(y!=fa) dfs(y,x,d^1,sum,e,res);
if(!d) res[x]=sum++;
}
vec label(int n,int k,vec u,vec v){
vec res(n);vector<vec> e(n,vec());
for(int i=0;i<n-1;i++) {e[u[i]].push_back(v[i]);e[v[i]].push_back(u[i]);}
int sum=0;dfs(0,-1,1,sum,e,res);return res;
}
int find_next_station(int s,int t,vec c){
if(c[0]>s){
if(t<s||c.back()<t) return c.back();
return *lower_bound(c.begin(),c.end(),t);
}
if(t<c[0]||s<t) return c[0];
return *(upper_bound(c.begin(),c.end(),t)-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... |