Submission #424493

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4244932021-06-12 03:19:07MrFranchoConnecting Supertrees (IOI20_supertrees)C++14
Compilation error
0 ms0 KiB
#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)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:48:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |     for(int i = 0; i < connectedGroups.size(); i++) {
      |                    ~~^~~~~~~~~~~~~~~~~~~~~~~~
supertrees.cpp:61:5: error: 'build' was not declared in this scope
   61 |     build(answer);
      |     ^~~~~