# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300162 | model_code | Connecting Supertrees (IOI20_supertrees) | Java | 549 ms | 61620 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.
// yanhao-st5
import java.util.ArrayList;
import java.util.Arrays;
class supertrees {
int n;
int construct(int[][] p) {
n = p.length;
ArrayList<ArrayList<Integer>> components1 = new ArrayList<>();
ArrayList<ArrayList<Integer>> components2 = new ArrayList<>();
for(int i=0; i<n; i++) components1.add(new ArrayList<>());
for(int i=0; i<n; i++) components2.add(new ArrayList<>());
int[] parent1 = new int[n];
int[] parent2 = new int[n];
for(int i=0; i<n; i++) {
parent1[i] = i;
parent2[i] = i;
}
for(int i=0; i<n; i++) {
for(int j=0; j<n; j++) {
if(p[i][j]==1) {
parent1[i] = j;
components1.get(j).add(i);
break;
}
}
}
for(int i=0; i<n; 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... |