제출 #1005622

#제출 시각아이디문제언어결과실행 시간메모리
1005622spensa게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h" #include <iostream> #include <vector> int N; void initialize(int n) { N = n; } const int MXN = 1500 + 20; int par[MXN] = {0}; vector<int> notpar[MXN]; int hasEdge(int u, int v) { if(u>v) swap(u, v); if(notpar[v].size==(v-2)){ par[v] = u; return 1; } notpar[v].push_back(u); return 0; }

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

game.cpp:12:1: error: 'vector' does not name a type
   12 | vector<int> notpar[MXN];
      | ^~~~~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:15:13: error: 'swap' was not declared in this scope
   15 |     if(u>v) swap(u, v);
      |             ^~~~
game.cpp:15:13: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:68,
                 from game.cpp:3:
/usr/include/c++/10/bits/stl_bvector.h:134:3: note:   'std::swap'
  134 |   swap(bool& __x, _Bit_reference __y) noexcept
      |   ^~~~
In file included from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from game.cpp:2:
/usr/include/c++/10/bits/exception_ptr.h:169:5: note:   'std::__exception_ptr::swap'
  169 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
In file included from /usr/include/c++/10/bits/nested_exception.h:40,
                 from /usr/include/c++/10/exception:148,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from game.cpp:2:
/usr/include/c++/10/bits/move.h:189:5: note:   'std::swap'
  189 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
game.cpp:16:8: error: 'notpar' was not declared in this scope
   16 |     if(notpar[v].size==(v-2)){
      |        ^~~~~~
game.cpp:20:5: error: 'notpar' was not declared in this scope
   20 |     notpar[v].push_back(u);
      |     ^~~~~~