# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
585990 | serize | Connecting Supertrees (IOI20_supertrees) | C++17 | 218 ms | 26004 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<bits/stdc++.h>
using namespace std;
const int MAX = 1002;
int link[MAX];
inline int seek(int x){
if(x == link[x]) return x;
return link[x] = seek(link[x]);
}
int construct(std::vector<std::vector<int>> p) {
int n = p.size();
std::vector<std::vector<int>> answer;
for(int i = 0; i < n; i++) link[i] = i;
int f = 0;
for(auto i: p){
int a = seek(f);
for(int j = 0; j < n; j++){
if(i[j] == 1){
int b = seek(j);
link[b] = a;
}
}
f++;
}
# | 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... |