Submission #126836

#TimeUsernameProblemLanguageResultExecution timeMemory
126836zoooma13Meetings (JOI19_meetings)C++14
0 / 100
3045 ms10288 KiB
#include "bits/stdc++.h" #include "meetings.h" //#include "grader.cpp" using namespace std; #define MAX_N 2003 int comm_anc[MAX_N][MAX_N]; set <int> anc[MAX_N] ,sbtree[MAX_N]; void Solve(int N) { for(int u=1; u<N; u++) for(int v=u+1; v<N; v++){ int o = comm_anc[v][u] = comm_anc[u][v] = Query(0 ,u ,v); sbtree[o].insert(u) ,sbtree[o].insert(v); anc[v].insert(o) ,anc[u].insert(o); } for(int i=1; i<N; i++){ pair <int ,int> mi = {1e9 ,-1}; for(auto&u : anc[i]) if(u != i) mi = min(mi ,make_pair((int)sbtree[u].size() ,u)); Bridge(min(i ,mi.second) ,max(i ,mi.second)); //cout << i << ' ' << mi.second << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...