# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
376812 | 8e7 | Mergers (JOI19_mergers) | C++14 | 1128 ms | 119492 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.
//Challenge: Accepted
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#define ll long long
#define maxn 500005
#define pii pair<int, int>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
vector<int> adj[maxn], tree[maxn];
int tot;
int col[2 * maxn], prv[maxn], cnt[maxn], par[maxn], ind[maxn];
//cnt: number of nodes colored i, ind: dsu parent
int num[maxn], ord[2 * maxn], arr[2 * maxn];
//ord: euler tour array, num: ans to query, arr:previous item
bool poss[maxn];
struct BIT {
int bit[2 * maxn];
void modify(int ind, int val) {
if (ind == 0) return;
for (;ind < 2 * maxn;ind += ind & (-ind)) bit[ind] += val;
}
int query(int ind) {
int ret = 0;
for (;ind > 0;ind -= ind & (-ind)) ret += bit[ind];
return ret;
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... |