| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 307065 | junseo | 기지국 (IOI20_stations) | C++17 | 901 ms | 1024 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "stations.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rmin(r, x) r = min(r, x)
#define rmax(r, x) r = max(r, x)
#define ends ' '
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 1e3 + 10;
int T;
vector<int> l, adj[maxn];
void dfs(int u, int p, bool f) {
if(f) l[u] = T++;
for(auto& v : adj[u]) if(v != p) dfs(v, u, f ^ true);
if(!f) l[u] = T++;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
T = 0;
l.resize(n);
for(int i = 0; i < n; ++i) adj[i].clear();
for(int i = 0; i < u.size(); ++i) {
adj[u[i]].eb(v[i]);
adj[v[i]].eb(u[i]);
}
dfs(0, -1, true);
return l;
}
int find_next_station(int s, int t, vector<int> c) {
int n = c.size();
if(n == 1) return c[0];
if(s < c[0]) {
if(!s && (t < s || c[n - 2] < t)) return c[n - 1];
for(int i = 0; i < n; ++i) if(t <= c[i]) return c[i];
}
else {
if(t < c[1] || s < t) return c[0];
for(int i = n - 1; i >= 0; --i) if(c[i] <= t) return c[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... | ||||
