#include "icc.h"
#include<bits/stdc++.h>
using namespace std;
const int mxN = 105;
bool G[mxN][mxN];
// int query(int sza, int szb, int a[], int b[]);
// {
// for(int i = 0;i < sza;++i){
// cout << a[i] << ' ';
// }
// cout << ": ";
// for(int i = 0;i < szb;++i){
// cout << b[i] << ' ';
// }
// int ans;
// cin >> ans;
// return ans;
// }
int Query(int sza, int szb, vector<int>a, vector<int>b){
int A[sza], B[szb];
for(int i = 0;i < sza;++i){
A[i] = a[i];
}
for(int i = 0;i < szb;++i){
B[i] = b[i];
}
return query(sza, szb, A, B);
}
void setRoad(int a, int b);
// {
// cout << "Found: " << a << " " << b << '\n';
// }
void run(int n){
srand(time(0));
for(int k = 0;k < n - 1;++k){
int node = -1, node2 = -1;
bool f = true;
for(int i = 1;i <= n && f;++i){
for(int j = 1;j <= n && f;++j){
if(i == j || G[i][j])continue;
vector<int>a = {i}, b = {j};
if(Query(1, 1, a, b)){
f = false;
node = i;
node2 = j;
// cout << node << ": " << node2 << '\n';
break;
}
}
}
setRoad(node, node2);
G[node][node2] = G[node2][node] = 1;
}
}
// int main(){
// // ios_base::sync_with_stdio(0);
// // cin.tie(0);
// int n;
// cin >> n;
// run(n);
// }
# | 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... |