| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 456252 | BT21tata | Connecting Supertrees (IOI20_supertrees) | C++17 | 1 ms | 204 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;
int construct(vector<vector<int>> p)
{
int n = p.size(), mx=0;
bool f=1;
vector<vector<int>> ans;
ans.resize(n);
for (int i = 0; i < n; i++)
{
ans[i].resize(n);
}
vector<int>v;
for(int i=0; i<n; i++)
{
v.clear(); v.push_back(i);
for(int j=0; j<n; j++)
{
if(p[i][j]==2) v.push_back(j);
}
for(int j=0; j<(int)v.size()-1; j++)
ans[v[j]][v[j+1]]=ans[v[j+1]][v[j]]=1;
ans[v[0]][v[v.size()-1]]=ans[v[v.size()-1]][v[0]]=1;
}
for(int i=0; i<n; i++)
for(int j=0; j<n; j++)
if(i!=j and p[i][j]==1) ans[i][j]=ans[j][i]=1;
build(ans);
return 1;
}
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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
