# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
295730 | jhnah917 | Swapping Cities (APIO20_swap) | C++14 | 614 ms | 54624 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 "swap.h"
#include <bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
struct Edge{
int s, e, x;
bool operator < (const Edge &t) const { return tie(x, s, e) < tie(t.x, t.s, t.e); }
};
int par[101010];
int find(int v){ return v == par[v] ? v : par[v] = find(par[v]); }
int merge(int u, int v){ u = find(u); v = find(v); return u == v ? 0 : (par[u] = v, 1); }
const int sz = 1 << 17;
struct Seg{
int tree[1 << 18];
void update(int x, int v){
x |= sz; tree[x] = v;
while(x >>= 1) tree[x] = max(tree[x << 1], tree[x << 1 | 1]);
}
int query(int l, int r){
l |= sz; r |= sz; int ret = 0;
while(l <= r){
# | 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... |