Submission #1041669

#TimeUsernameProblemLanguageResultExecution timeMemory
1041669kheiraMemory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" using namespace std; void solve(){ map<char,int> Cards; for (int C = 1; C <= 50; ++c){ char letterCard = facecup(C); if (Cards.find(letterCard) != Cards.end()) { int matchedCard = Cards[letterCard]; facecup(letterCard); facecup(C); return; } else { Cards[letterCard] = C; } } }

Compilation message (stderr)

memory.cpp: In function 'void solve()':
memory.cpp:5:5: error: 'map' was not declared in this scope
    5 |     map<char,int> Cards;
      |     ^~~
memory.cpp:3:1: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
    2 | #include "memory.h"
  +++ |+#include <map>
    3 | using namespace std;
memory.cpp:5:9: error: expected primary-expression before 'char'
    5 |     map<char,int> Cards;
      |         ^~~~
memory.cpp:7:36: error: 'c' was not declared in this scope
    7 |         for (int C = 1; C <= 50; ++c){
      |                                    ^
memory.cpp:8:27: error: 'facecup' was not declared in this scope; did you mean 'faceup'?
    8 |         char letterCard = facecup(C);
      |                           ^~~~~~~
      |                           faceup
memory.cpp:9:13: error: 'Cards' was not declared in this scope
    9 |         if (Cards.find(letterCard) != Cards.end())
      |             ^~~~~
memory.cpp:11:17: warning: unused variable 'matchedCard' [-Wunused-variable]
   11 |             int matchedCard = Cards[letterCard];
      |                 ^~~~~~~~~~~