# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
682051 | Kahou | Making Friends on Joitter is Fun (JOI20_joitter2) | C++14 | 814 ms | 64716 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.
/* In the name of God, aka Allah */
// let this be mytemp.cpp
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define endl '\n'
#define mk make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int N = 1e5 + 50;
int n, m, id[N];
vector<int> vc[N];
set<int> adj[2][N], st[N];
queue<pii> q;
ll ans;
void uniset(int u, int v) {
u = id[u], v= id[v];
if (u == v) return;
if (vc[u].size() < vc[v].size()) swap(u, v);
ans -= 1ll*st[u].size()*vc[u].size();
ans -= 1ll*st[v].size()*vc[v].size();
ans += 2ll*vc[u].size()*vc[v].size();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |