Submission #1195648

#TimeUsernameProblemLanguageResultExecution timeMemory
1195648mannshah1211Soccer Stadium (IOI23_soccer)C++20
Compilation error
0 ms0 KiB
#include "soccer.h" #include <bits/stdc++.h> int biggest_stadium(int n, vector<vector<int>> f) { int tree_i = -1, tree_j = -1; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (f[i][j] == 1) { tree_i = i; tree_j = j; } } } if (tree_i == -1 && tree_j == -1) { return n * n; } auto edging = [&](int x) { if (x == 0) { return true; } if (x == n - 1) { return true; } return false; }; if (edging(tree_i) && edging(tree_j)) { return n * n - 1; } if (edging(tree_i)) { return n * n - n; } if (edging(tree_j)) { return n * n - n; } return n * max({tree_i, tree_j, n - 1 - tree_i, n - 1 - tree_j}); }

Compilation message (stderr)

soccer.cpp:4:35: error: 'vector' was not declared in this scope
    4 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:4:35: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:67,
                 from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
soccer.cpp:4:35: error: 'vector' was not declared in this scope
    4 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:4:35: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:67,
                 from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
soccer.cpp:4:35: error: 'vector' was not declared in this scope
    4 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:4:35: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:67,
                 from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
soccer.cpp:4:35: error: 'vector' was not declared in this scope
    4 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:4:35: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:67,
                 from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
soccer.cpp:4:28: error: 'vector' has not been declared
    4 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                            ^~~~~~
soccer.cpp:4:34: error: expected ',' or '...' before '<' token
    4 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                  ^
soccer.cpp: In function 'int biggest_stadium(int, int)':
soccer.cpp:8:11: error: 'f' was not declared in this scope
    8 |       if (f[i][j] == 1) {
      |           ^
soccer.cpp:34:14: error: 'max' was not declared in this scope
   34 |   return n * max({tree_i, tree_j, n - 1 - tree_i, n - 1 - tree_j});
      |              ^~~
soccer.cpp:34:14: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:62,
                 from soccer.h:1,
                 from soccer.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note:   'std::max'
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
In file included from /usr/include/c++/11/algorithm:64,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from soccer.cpp:2:
/usr/include/c++/11/bits/ranges_algo.h:3011:29: note:   'std::ranges::max'
 3011 |   inline constexpr __max_fn max{};
      |                             ^~~