# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
467313 | phathnv | Paint (COI20_paint) | C++11 | 2041 ms | 36612 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 = 200000;
const int BLOCKSIZE = 444;
int m, n, q, curInd;
vector<vector<int>> ind;
vector<int> adj[N];
map<int, vector<int>> s[N];
int root[N], sz[N], col[N];
void MergeMap(int u, int v) {
for (auto &p : s[v]) {
for (int x : p.second)
s[u][p.first].push_back(x);
}
s[v].clear();
}
int FindRoot(int u) {
if (u == root[u])
return u;
return root[u] = FindRoot(root[u]);
}
void Merge(int u, int v) {
u = FindRoot(u);
v = FindRoot(v);
if (u == v)
# | 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... |