Submission #1059663

#TimeUsernameProblemLanguageResultExecution timeMemory
1059663tolbiSoccer Stadium (IOI23_soccer)C++17
Compilation error
0 ms0 KiB
#include "soccer.h" int biggest_stadium(int N, std::vector<std::vector<int>> F) { int x=-1,y=-1; for (int i =0 ; i < F.size(); i++){ for (int j = 0; j < F[i].size(); j++){ if (F[i][j]==1){ x=i,y=j; } } } if (x==-1){ return N*N; } else { return N*N-min(x+1,N-x)*min(y+1,N-y); } }

Compilation message (stderr)

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:6:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     for (int i =0 ; i < F.size(); i++){
      |                     ~~^~~~~~~~~~
soccer.cpp:7:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |         for (int j = 0; j < F[i].size(); j++){
      |                         ~~^~~~~~~~~~~~~
soccer.cpp:17:20: error: 'min' was not declared in this scope; did you mean 'std::min'?
   17 |         return N*N-min(x+1,N-x)*min(y+1,N-y);
      |                    ^~~
      |                    std::min
In file included from /usr/include/c++/10/vector:60,
                 from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: 'std::min' declared here
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~