Submission #341792

#TimeUsernameProblemLanguageResultExecution timeMemory
341792marvenleeMemory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <map> void play() { int i; char a, b; map<char,int> mp; for (i=1; i<=50; i++){ a = faceup(i); if(mp.find(a)!=mp.end()){ b = faceup(mp.find(a)); } else { mp[a]=i; i+=1; b= faceup(i); mp[b]=i; } } }

Compilation message (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> mp;
      |    ^~~
      |    std::map
In file included from /usr/include/c++/9/map:61,
                 from memory.cpp:3:
/usr/include/c++/9/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> mp;
      |        ^~~~
memory.cpp:12:12: error: 'mp' was not declared in this scope
   12 |         if(mp.find(a)!=mp.end()){
      |            ^~