This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |