#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
void find_pair(int N, vector<int> U, vector<int> V, int A, int B) {
int M = U.size(), d = B - A;
vector<int> w(M, 0), adj[N];
for(int i = 0; i < M; ++i){
adj[U[i]].pb(i);
adj[V[i]].pb(i);
}
int S = -1, T = -1;
long long toll = ask(w);
for(int i = 0; i < N - 1; ++i){
for(auto id:adj[i]){
w[id] = 1;
}
long long cur = ask(w);
if(cur - toll == d && S == -1){
S = i;
}else if(cur - toll == d) T = i;
for(auto id:adj[i]){
w[id] = 0;
}
}
if(T == -1) T = N - 1;
answer(S, T);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
2 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
208 KB |
Output is correct |
5 |
Correct |
1 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
1 ms |
208 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
2 ms |
208 KB |
Output is correct |
10 |
Correct |
3 ms |
208 KB |
Output is correct |
11 |
Correct |
2 ms |
208 KB |
Output is correct |
12 |
Correct |
3 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
372 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
11 ms |
1008 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
336 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
16 ms |
1056 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
17 ms |
1056 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |