# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
243604 | osaaateiasavtnl | Meetings (JOI19_meetings) | C++14 | 3085 ms | 4652 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;
bool par[N][N]; //is j parent of i
int sub[N];
int fath[N];
void Solve(int n) {
for (int i = 1; i < n; ++i)
for (int j = i + 1; j < n; ++j) {
int x = Query(0, i, j);
if (x == i)
++par[j][i];
else if (x == j)
++par[i][j];
}
sub[0] = n;
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
sub[i] += par[j][i];
for (int i = 1; i < n; ++i) {
fath[i] = 0;
for (int j = 0; j < n; ++j) {
if (par[i][j] && sub[j] < sub[fath[i]]) {
fath[i] = j;
}
}
int u = i, v = fath[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... |