Submission #1041743

#TimeUsernameProblemLanguageResultExecution timeMemory
1041743kheiraMemory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <map> #include <vector> using namespace std; void play() { unordered_map<char, vector<int>> Cards; vector<pair<int, int>> matchedCards; for (int C = 1; C <= 50; ++C) { char letterCard = faceup(C); if (Cards.find(letterCard) != Cards.end()) { int previousCard = Cards[letterCard][0]; matchedCards.push_back(make_pair(previousCard, C)); faceup(previousCard); faceup(C); } else { Cards[letterCard].push_back(C); } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:10:5: error: 'unordered_map' was not declared in this scope
   10 |     unordered_map<char, vector<int>> Cards;
      |     ^~~~~~~~~~~~~
memory.cpp:5:1: note: 'std::unordered_map' is defined in header '<unordered_map>'; did you forget to '#include <unordered_map>'?
    4 | #include <vector>
  +++ |+#include <unordered_map>
    5 | 
memory.cpp:10:19: error: expected primary-expression before 'char'
   10 |     unordered_map<char, vector<int>> Cards;
      |                   ^~~~
memory.cpp:16:13: error: 'Cards' was not declared in this scope
   16 |         if (Cards.find(letterCard) != Cards.end()) {
      |             ^~~~~