Submission #586032

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5860322022-06-29 18:32:33almothana05Connecting Supertrees (IOI20_supertrees)C++14
Compilation error
0 ms0 KiB
#include "supertrees.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
vector<vector<int> >erg;
vector<int>cmp[2000];
int vis[2000];
int construct(vector<vector<int>> p) {
int menge = p.size() , pl = 1;
for(int i = 0 ; i < n ; i++){
erg.push_back(vector<int>() );
for(int j = 0 ; j < n ; j++){
erg[i].push_back(0);
}
}
for(int i = 0 ; i < n ; i++){
p[i][i] = 1;
}
for(int i = 0 ; i < menge ; i++){
if(vis[i] == 0){
vis[i] = pl;
for(int j = 0 ; j < menge ; j++){
if(p[i][j] == 1){
cmp[pl].push_back(j);
vis[j] = pl;
}
}
int fl = 1;
for(int j = 0 ; j < menge ; j++){
for(int k = 0 ; k < cmp[pl].size() ; k++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:10:22: error: 'n' was not declared in this scope
   10 |  for(int i = 0 ; i < n ; i++){
      |                      ^
supertrees.cpp:16:22: error: 'n' was not declared in this scope
   16 |  for(int i = 0 ; i < n  ; i++){
      |                      ^
supertrees.cpp:30:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |     for(int k = 0 ; k < cmp[pl].size() ; k++){
      |                     ~~^~~~~~~~~~~~~~~~
supertrees.cpp:37:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |    for(int j = 0 ; j < cmp[pl].size() - 1 ; j++){
      |                    ~~^~~~~~~~~~~~~~~~~~~~