# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
296022 | Alexa2001 | Swapping Cities (APIO20_swap) | C++17 | 187 ms | 16728 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>
using namespace std;
const int inf = 1e9 + 5;
const int Nmax = 1e5 + 5;
int rang[Nmax], t[Nmax], A[Nmax], B[Nmax], up[Nmax], good[Nmax], level[Nmax];
bool chain[Nmax];
int n, m;
vector<int> v[Nmax];
int boss(int x)
{
if(x == t[x]) return x;
return t[x] = boss(t[x]);
}
bool endpoints(int x, int y, int a, int b)
{
//assert(boss(a) == x && boss(b) == y);
return (A[x] == a || B[x] == a) && (A[y] == b || B[y] == b);
}
void combine_chains(int x, int y, int a, int b)
{
B[y] = (A[y] == b ? B[y] : A[y]);
# | 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... |