제출 #1205644

#제출 시각아이디문제언어결과실행 시간메모리
1205644bongoboltoHack (APIO25_hack)C++20
컴파일 에러
0 ms0 KiB
#include "hack.h" #include <vector> #include <map> using ll = long long; int hack() { vector<int> vec = {1,2,3,4}; cout<<collisions(vec)<<endl; }

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

hack.cpp: In function 'int hack()':
hack.cpp:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> vec = {1,2,3,4};
      |     ^~~~~~
hack.cpp:8:5: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:67,
                 from hack.h:1,
                 from hack.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 hack.h:1,
                 from hack.cpp:1:
/usr/include/c++/11/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
hack.cpp:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> vec = {1,2,3,4};
      |            ^~~
hack.cpp:9:5: error: 'cout' was not declared in this scope
    9 |     cout<<collisions(vec)<<endl;
      |     ^~~~
hack.cpp:9:22: error: 'vec' was not declared in this scope
    9 |     cout<<collisions(vec)<<endl;
      |                      ^~~
hack.cpp:9:28: error: 'endl' was not declared in this scope
    9 |     cout<<collisions(vec)<<endl;
      |                            ^~~~
hack.cpp:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^