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 "meetings.h"
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
#define pll pair <ll,ll>
#define fi first
#define se second
#define MP make_pair
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1)
#define MASK(i) (1LL << (i))
const ll MAXN = 2010;
vector <ll> sub[MAXN];
ll lose[MAXN];
void dfs(ll u){
sort(sub[u].begin(),sub[u].end(),[](ll x,ll y){return lose[x]<lose[y];});
for (auto v:sub[u]){
if (lose[v] == lose[sub[u][0]]){
// cout<<"BR "<<u<<' '<<v<<endl;
Bridge(u,v);
dfs(v);
}
else break;
}
}
void Solve(int n) {
for (ll i = 1;i < n; i++)sub[0].push_back(i);
for (ll i = 1;i < n;i ++){
for (ll j = i + 1;j < n;j ++){
ll tmp = Query(0,i,j);
if (tmp==i){
sub[i].push_back(j);
lose[j]++;
}
else if (tmp==j){
sub[j].push_back(i);
lose[i]++;
}
}
}
dfs(0);
}
# | 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... |