# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789668 | FEDIKUS | Connecting Supertrees (IOI20_supertrees) | C++17 | 206 ms | 24096 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 "supertrees.h"
#include <vector>
#include<map>
#include<algorithm>
using namespace std;
const int maxn=1010;
int dsu[maxn];
int dsu2[maxn];
int cale(int a,int *dsu){
return dsu[a]==a ? a:cale(dsu[a],dsu);
}
void join(int a,int b,int *dsu){
dsu[cale(a,dsu)]=cale(b,dsu);
}
int construct(vector<vector<int>> p) {
int n = p.size();
vector<vector<int>> answer;
for (int i = 0; i < n; i++) {
vector<int> row;
row.resize(n);
answer.push_back(row);
}
for(int i=0;i<n;i++) dsu[i]=i;
for(int i=0;i<n;i++) dsu2[i]=i;
# | 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... |