제출 #717650

#제출 시각아이디문제언어결과실행 시간메모리
717650AndrijaMMemory (IOI10_memory)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h"
#include "memory.h"
#include <bits/stdc++.h>

void play() {
   char a, b;
   bool vis[55]={0};
   map<char,int>m;
   for(int i=1;i<=50;i++)
   {
       a=faceup(i);
       vis[i]=true;
       if(m[a]!=0)
       {
           faceup(m[a]);
       }
   }
}

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

memory.cpp: In function 'void play()':
memory.cpp:8:4: error: 'map' was not declared in this scope; did you mean 'std::map'?
    8 |    map<char,int>m;
      |    ^~~
      |    std::map
In file included from /usr/include/c++/10/map:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from memory.cpp:3:
/usr/include/c++/10/bits/stl_map.h:100:11: note: 'std::map' declared here
  100 |     class map
      |           ^~~
memory.cpp:8:8: error: expected primary-expression before 'char'
    8 |    map<char,int>m;
      |        ^~~~
memory.cpp:13:11: error: 'm' was not declared in this scope
   13 |        if(m[a]!=0)
      |           ^
memory.cpp:6:12: warning: unused variable 'b' [-Wunused-variable]
    6 |    char a, b;
      |            ^