# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
404387 | ntabc05101 | Making Friends on Joitter is Fun (JOI20_joitter2) | C++14 | 1232 ms | 69000 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 f first
#define s second
using ll = long long;
const int mxN = 100000;
int par[mxN + 5];
ll sz[mxN + 5];
ll result = 0;
set<int> ccs[mxN + 5], ou[mxN + 5], in[mxN + 5];
queue< pair<int, int> > to_merge;
void weak_connection(int x, int y) {
ou[x].insert(y); in[y].insert(x);
if (ou[y].count(x)) to_merge.emplace(x, y);
}
int tot_sz(int x) {
return ccs[x].size() + in[x].size() + ou[x].size();
}
int find(int x) {
return (x == par[x] ? x: par[x] = find(par[x]));
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |