#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
#define SIZE(x) (int)x.size()
#define ll long long
vector <vector <int>> adj;
map <pair <int, int>, int> m;
vector <int> h;
int DFS(ll dist, int u = 0, int p = -1) {
for (int v:adj[u]) {
if (v == p) {
continue;
}
h[m[{u,v}]] = 1;
bool b = ask(h) > dist;
h[m[{u,v}]] = 0;
if (b) {
return DFS(dist, v, u);
}
}
return u;
}
void find_pair(int N, vector<int> U, vector<int> V, int A, int B) {
if (A > B) {
return;
}
adj.resize(N);
int M = SIZE(U);
h.assign(M, 0);
for (int i=0; i<M; i++) {
adj[V[i]].push_back(U[i]);
adj[U[i]].push_back(V[i]);
m[{V[i], U[i]}] = i;
m[{U[i], V[i]}] = i;
}
answer(0, DFS(ask(h)));
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
288 KB |
Output is correct |
3 |
Correct |
0 ms |
208 KB |
Output is correct |
4 |
Correct |
0 ms |
208 KB |
Output is correct |
5 |
Correct |
0 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
0 ms |
208 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
0 ms |
208 KB |
Output is correct |
10 |
Correct |
0 ms |
208 KB |
Output is correct |
11 |
Correct |
1 ms |
208 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
464 KB |
Output is correct |
2 |
Correct |
14 ms |
2308 KB |
Output is correct |
3 |
Incorrect |
188 ms |
18264 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
2288 KB |
Output is incorrect: {s, t} is wrong. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
464 KB |
Output is incorrect: {s, t} is wrong. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
14 ms |
2404 KB |
Output is incorrect: {s, t} is wrong. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
11 ms |
2420 KB |
Output is incorrect: {s, t} is wrong. |
2 |
Halted |
0 ms |
0 KB |
- |