# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
738865 | josanneo22 | Swapping Cities (APIO20_swap) | C++17 | 2061 ms | 18188 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;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
vector<int> par,sz,swappable,deg,has;
int total_groups;
void init(int n){
par.resize(n); sz.resize(n); swappable.resize(n); deg.resize(n);has.resize(n);
for(int i=0;i<n;i++){
par[i]=i;
sz[i]=1;
swappable[i]=0;
deg[i]=0;
has[i]=0;
}
}
int find(int x){
if(par[x]==x) return x;
else return par[x]=find(par[x]);
}
void sw(int x,int y){
swappable[x]=(swappable[x]&swappable[y]);
swappable[y]=(swappable[x]&swappable[y]);
has[x]|=has[y];
if(has[x]){
swappable[y]=1;
# | 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... |