#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
int ok;
void dfs( int v, int t ) {
if ( v > 1000 ) {
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 |
1 |
Incorrect |
591 ms |
400 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
494 ms |
400 KB |
Output is correct |
2 |
Correct |
565 ms |
468 KB |
Output is correct |
3 |
Correct |
1123 ms |
400 KB |
Output is correct |
4 |
Correct |
739 ms |
488 KB |
Output is correct |
5 |
Correct |
696 ms |
400 KB |
Output is correct |
6 |
Correct |
538 ms |
480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
639 ms |
400 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1238 ms |
400 KB |
Output is correct |
2 |
Incorrect |
744 ms |
420 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
559 ms |
476 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |