제출 #1055674

#제출 시각아이디문제언어결과실행 시간메모리
1055674hotboy2703Meetings (JOI19_meetings)C++17
0 / 100
1229 ms736 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...