# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
243614 | osaaateiasavtnl | Meetings (JOI19_meetings) | C++14 | 3077 ms | 632 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;
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
#define debug(x) std::cout << #x << ": " << x << '\n';
const int N = 2007;
int par[N];
void Solve(int n) {
for (int i = 1; i < n; ++i)
par[i] = -1;
queue <int> q;
q.push(0);
while (q.size()) {
int u = q.front(); q.pop();
vector <int> cur;
for (int v = 0; v < n; ++v) {
if (par[v] == -1 && (u == 0 || Query(0, u, v) == u)) {
vector <bool> del(cur.size());
bool ban = 0;
for (int i = 0; i < cur.size(); ++i) {
int x = Query(0, v, cur[i]);
if (x == v) {
del[i] = 1;
continue;
}
if (x == cur[i]) {
ban = 1;
break;
}
}
if (!ban) {
vector <int> a = {v};
for (int i = 0; i < cur.size(); ++i)
if (!del[i])
a.app(cur[i]);
cur = a;
}
}
}
for (int v : cur) {
par[v] = u;
q.push(v);
}
}
for (int i = 1; i < n; ++i) {
int u = i;
int v = par[i];
if (v < u)
swap(u, v);
Bridge(u,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... |