# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
749928 | Trunkty | Matching (COCI20_matching) | C++14 | 5 ms | 7384 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;
typedef long long ll;
#define int ll
int n;
vector<int> row[100005],col[100005];
int root[100005];
vector<int> vals[100005];
vector<vector<int>> ans;
int findroot(int x){
if(root[x]!=x){
root[x] = findroot(root[x]);
}
return root[x];
}
void domerge(int a, int b){
int x = findroot(a), y = findroot(b);
if(x==y){
return;
}
else{
if(vals[x].size()<vals[y].size()){
swap(x,y);
swap(a,b);
}
if(vals[x][0]==a){
reverse(vals[x].begin(),vals[x].end());
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... |