#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
bool can_contract(int x, int y)
{
for (int i=0;i<13;++i)
{
if (x==y)
return 1;
y/=2;
}
return 0;
}
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) {
if (can_contract(2*(s+1),t+1))
return 2*(s+1)-1;
if (can_contract(2*(s+1)+1,t+1))
return 2*(s+1);
return (s-1)/2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
649 ms |
768 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
444 ms |
672 KB |
Output is correct |
2 |
Correct |
657 ms |
776 KB |
Output is correct |
3 |
Correct |
1055 ms |
640 KB |
Output is correct |
4 |
Correct |
839 ms |
784 KB |
Output is correct |
5 |
Correct |
779 ms |
776 KB |
Output is correct |
6 |
Correct |
586 ms |
888 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
586 ms |
880 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
941 ms |
640 KB |
Output is correct |
2 |
Incorrect |
877 ms |
752 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
728 ms |
896 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |