Submission #587775

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5877752022-07-02 11:00:10almothana05Connecting Supertrees (IOI20_supertrees)C++14
21 / 100
230 ms22240 KiB
#include "supertrees.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
vector<vector<int> >erg;
vector<int>cmp[2000] , comp;
int vis[2000] , visi[2000] , f[2000];
set<int> s;
int construct(vector<vector<int>> p) {
int menge = p.size() , pl = 1;
for(int i = 0 ; i < menge ; i++){
erg.push_back(vector<int>() );
for(int j = 0 ; j < menge ; j++){
erg[i].push_back(0);
}
}
for(int i = 0 ; i < menge ; i++){
if(p[i][i] != 1){
return 0;
}
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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:35:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for(int k = 0 ; k < cmp[pl].size() ; k++){
      |                     ~~^~~~~~~~~~~~~~~~
supertrees.cpp:42:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |    for(int j = 0 ; j < cmp[pl].size() - 1 ; j++){
      |                    ~~^~~~~~~~~~~~~~~~~~~~
supertrees.cpp:75:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   75 |             for(int k = 0 ; k < comp.size() ; k++){
      |                             ~~^~~~~~~~~~~~~
supertrees.cpp:95:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   95 |             for(int j = 0 ; j < comp.size() ; j++){
      |                             ~~^~~~~~~~~~~~~
supertrees.cpp:97:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   97 |                 if(j != (j + 1) % comp.size()){
      |                    ~~^~~~~~~~~~~~~~~~~~~~~~~~
#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...