#include "highway.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
vector<int> edge[100005];
bool visited[100005];
int last;
void dfs(int node) {
visited[node] = 1;
last = node;
for(auto x: edge[node]) {
if(visited[x] == 0) dfs(x);
}
}
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
//
int M = U.size();
vector<int> w;
for(int i = 0; i < M; i ++) w.pb(0);
ll mx = ask(w);
for(int i = 0; i < M; i ++) {
for(int j = 0; j < M; j ++) {
w[j] = 0;
}
w[i] = 1;
if(ask(w) != mx) {
edge[U[i]].pb(V[i]);
edge[V[i]].pb(U[i]);
}
}
dfs(0);
//
answer(0, last);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2640 KB |
Output is correct |
2 |
Correct |
3 ms |
2640 KB |
Output is correct |
3 |
Correct |
2 ms |
2640 KB |
Output is correct |
4 |
Correct |
2 ms |
2640 KB |
Output is correct |
5 |
Correct |
2 ms |
2640 KB |
Output is correct |
6 |
Correct |
3 ms |
2636 KB |
Output is correct |
7 |
Correct |
3 ms |
2640 KB |
Output is correct |
8 |
Correct |
2 ms |
2688 KB |
Output is correct |
9 |
Correct |
2 ms |
2640 KB |
Output is correct |
10 |
Correct |
2 ms |
2640 KB |
Output is correct |
11 |
Correct |
3 ms |
2640 KB |
Output is correct |
12 |
Correct |
3 ms |
2640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
2640 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
12 ms |
2904 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
2684 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
21 ms |
2916 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
15 ms |
2904 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |