이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
int ok;
void dfs( int v, int t ) {
if ( v >= 10 ) {
return;
}
if ( v == t ) {
ok = 1;
return;
}
dfs( v * 2 + 1, t );
dfs( v * 2 + 2, t );
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
std::vector<int> labels(n);
for (int i = 0; i < n; i++) {
labels[i] = i;
}
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
ok = 0;
int pr = -1;
for ( auto v: c ) {
if ( v < s ) {
pr = v;
continue;
}
ok = 0;
dfs( v, t );
if ( ok ) {
return v;
}
}
return pr;
}
# | 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... |