# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
930544 | Ghulam_Junaid | Joker (BOI20_joker) | C++17 | 101 ms | 38460 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;
const int N = 2e5 + 3;
int n, m, q, vis_nq[N], par[N], col[N];
vector<pair<int, int>> g[N], atl[2005];
pair<int, int> edge[N];
vector<int> S[N];
bool ans[N];
int root(int v){
return (par[v] == -1 ? v : par[v] = root(par[v]));
}
inline bool merge(int u, int v){
int r1 = root(u);
int r2 = root(v);
if (r1 == r2)
return (col[u] != col[v]);
if (S[r2].size() > S[r1].size())
swap(r1, r2);
int take = 0;
if (col[u] == col[v])
take = 3;
for (int x : S[r2]){
col[x] ^= take;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |