# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
770943 | PurpleCrayon | Making Friends on Joitter is Fun (JOI20_joitter2) | C++17 | 1402 ms | 88044 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 sz(v) int(v.size())
#define ar array
typedef long long ll;
const int N = 1e5+10, MOD = 1e9+7;
int n, m, par[N];
vector<int> st[N];
set<ar<int, 2>> ed;
set<int> in[N];
vector<ar<int, 2>> use[N];
ll ans = 0;
ll f(int x) {
assert(x == par[x]);
return (long long) sz(st[x]) * sz(in[x]);
};
ll g(int x) {
assert(x == par[x]);
return (long long) sz(st[x]) * (sz(st[x]) - 1);
}
void merge(int a, int b) {
a = par[a], b = par[b];
if (a == b) return;
if (sz(st[a]) < sz(st[b])) swap(a, b);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |