제출 #1032551

#제출 시각아이디문제언어결과실행 시간메모리
1032551ezzzayMemory (IOI10_memory)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "memory.h" #include<bits/stdc++.h> void play() { std::map<char,vector<int>>mp; for(int i=1;i<=50;i++){ char a=faceup(i); mp[a].push_back(i); } for(char a='A';a<'Z';a++){ faceup(mp[a][0]); faceup(mp[a][1]); } }

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

memory.cpp: In function 'void play()':
memory.cpp:5:18: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    5 |    std::map<char,vector<int>>mp;
      |                  ^~~~~~
      |                  std::vector
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from memory.cpp:3:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
memory.cpp:5:28: error: template argument 2 is invalid
    5 |    std::map<char,vector<int>>mp;
      |                            ^~
memory.cpp:5:28: error: template argument 4 is invalid
memory.cpp:8:9: error: invalid types 'int[char]' for array subscript
    8 |       mp[a].push_back(i);
      |         ^
memory.cpp:11:16: error: invalid types 'int[char]' for array subscript
   11 |       faceup(mp[a][0]);
      |                ^
memory.cpp:12:16: error: invalid types 'int[char]' for array subscript
   12 |       faceup(mp[a][1]);
      |                ^