# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223122 | AQT | Meetings (JOI19_meetings) | C++14 | 112 ms | 608 KiB |
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 namespace std;
void rec(vector<int> v){
if(v.size() == 1){
return;
}
int c = v[0];
vector<vector<int>> st;
for(int i = 1; i<v.size(); i++){
int n = v[i];
bool b = 0;
for(int j = 0; j<st.size(); j++){
if(Query(n, st[j][0], c) != c){
b = 1;
st[j].push_back(n);
break;
}
}
if(!b){
st.push_back({n});
}
}
for(auto k : st){
int lca = k[0];
for(int j = 1; j<k.size(); j++){
lca = Query(lca, k[j], c);
}
//cout << min(lca, c) << " " << max(lca, c) << "\n";
Bridge(min(lca, c), max(lca, c));
rec(k);
}
}
void Solve(int N) {
vector<int> v;
for(int i = 0; i<N; i++){
v.push_back(i);
}
rec(v);
}
Compilation message (stderr)
# | 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... |