제출 #1187694

#제출 시각아이디문제언어결과실행 시간메모리
1187694MatteoArcari축구 경기장 (IOI23_soccer)C++20
컴파일 에러
0 ms0 KiB
#include "soccer.h" int biggest_stadium(int n, vector<vector<int>> f) { int x = -1, y = -1; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (f[i][j]) { x = i; y = j; } } } int ans = 0; if (x != -1) { ans = max(ans, n * n - (x + 1) * (y + 1)); ans = max(ans, n * n - (x + 1) * (n - y)); ans = max(ans, n * n - (n - x) * (y + 1)); ans = max(ans, n * n - (n - x) * (n - y)); } else { ans = n * n; } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

soccer.cpp:3:35: error: 'vector' was not declared in this scope
    3 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:3: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:3:35: error: 'vector' was not declared in this scope
    3 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:3: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:3:35: error: 'vector' was not declared in this scope
    3 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:3: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:3:35: error: 'vector' was not declared in this scope
    3 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                   ^~~~~~
soccer.cpp:3: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:3:28: error: 'vector' has not been declared
    3 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                            ^~~~~~
soccer.cpp:3:34: error: expected ',' or '...' before '<' token
    3 | int biggest_stadium(int n, vector<vector<int>> f) {
      |                                  ^
soccer.cpp: In function 'int biggest_stadium(int, int)':
soccer.cpp:7:17: error: 'f' was not declared in this scope
    7 |             if (f[i][j]) {
      |                 ^
soccer.cpp:14:15: error: 'max' was not declared in this scope; did you mean 'std::max'?
   14 |         ans = max(ans, n * n - (x + 1) * (y + 1));
      |               ^~~
      |               std::max
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' declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~