Submission #433560

#TimeUsernameProblemLanguageResultExecution timeMemory
433560SAADConnecting Supertrees (IOI20_supertrees)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include "supertrees.h" using namespace std; int construct( vector<vector<int>> p) { vector<vector<int>> a = p; for (int i = 0; i < a.size(); i++) { for (int j = 0; j < a.size(); j++) { if (abs(i - j) == 1) a[i][j] = 1; else a[i][j] = 0; } } return build(a); }

Compilation message (stderr)

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:9:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i = 0; i < a.size(); i++) {
      |                     ~~^~~~~~~~~~
supertrees.cpp:10:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         for (int j = 0; j < a.size(); j++) {
      |                         ~~^~~~~~~~~~
supertrees.cpp:16:16: error: void value not ignored as it ought to be
   16 |    return build(a);
      |           ~~~~~^~~