Submission #1135373

#TimeUsernameProblemLanguageResultExecution timeMemory
1135373NonbangkokConnecting Supertrees (IOI20_supertrees)C++20
0 / 100
1176 ms1776384 KiB
#include <bits/stdc++.h> #include "supertrees.h" #define forr(i, a, n) for (int i = a; i < n; i++) #define endll "\n" #define sp " " using namespace std; typedef long long ll; void dfs(vector<vector<int>> p,vector<vector<int>> b,vector<bool> visited,int n,int u){ if(visited[u])return; forr(i,0,n){ if(u==i)continue; if(p[u][i]){ b[u][i] = b[i][u] = 1; dfs(p,b,visited,n,i); } } } int construct(vector<vector<int>> p) { int n = p.size(); vector<vector<int>> b; vector<bool> visited(n,false); for (int i = 0; i < n; i++) { vector<int> row; row.resize(n); b.push_back(row); } forr(i,0,n){ if(visited[i])continue; dfs(p,b,visited,n,i); } build(b); return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...