# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230099 | PeppaPig | Meetings (JOI19_meetings) | C++14 | 2343 ms | 1312 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;
const int N = 2e3+5;
void connect(int a, int b) {
if(a > b) swap(a, b);
Bridge(a, b);
}
vector<int> sub[N];
void solve(vector<int> vec) {
if(vec.size() < 2) return;
for(int x : vec) sub[x].clear();
int a = vec[0], b = vec[1];
vector<int> path;
for(int i = 2; i < vec.size(); i++) {
int now = Query(a, b, vec[i]);
sub[now].emplace_back(vec[i]);
if(now == vec[i]) path.emplace_back(now);
}
sub[a].emplace_back(a), sub[b].emplace_back(b);
sort(path.begin(), path.end(), [&](int x, int y) {
return Query(x, y, b) == y;
});
path.insert(path.begin(), a), path.emplace_back(b);
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... |