# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
226164 | Minnakhmetov | Making Friends on Joitter is Fun (JOI20_joitter2) | C++14 | 5 ms | 384 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 <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()
const int N = 2005;
vector<int> outgoing_edges[N], ingoing_edges[N];
int gr[N][N], w[N];
ll ans = 0;
int n, m;
int find_set(int x) {
return w[x] < 0 ? x : w[x] = find_set(w[x]);
}
void mrg(int x, int y) {
x = find_set(x);
y = find_set(y);
if (x == y)
return;
if (w[x] > w[y]) {
swap(x, y);
}
w[x] += w[y];
w[y] = x;
for (int i = 0; i < n; i++) {
if (gr[y][i])
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |