# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
424493 | MrFrancho | Connecting Supertrees (IOI20_supertrees) | C++14 | 0 ms | 0 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;
const int MAXN = 1000;
vector<vector<int>> connectedGroups;
bool vis[MAXN]{};
int N;
void DFS(int node, int cur, vector<vector<int>> &p) {
connectedGroups[cur].push_back(node);
vis[node] = true;
for(int i = 0; i < N; i++) {
if(i != node && p[node][i] == 1 && !vis[i])
DFS(i,cur,p);
}
}
int construct(vector<vector<int>> p) {
N = p.size();
vector<vector<int>> answer(N);
cout << '.' << endl;
for(int i = 0; i < N; i++) {
for(int j = 0; j < N; j++) {
answer[i].push_back(0);
for(int k = 0; k < N; k++) {
if (i != j && j != k && k != i &&
p[i][k] == 1 && p[j][k] == 1 && p[i][j] != 1)