Submission #1041672

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

Compilation message (stderr)

memory.cpp: In function 'void solve()':
memory.cpp:8:36: error: 'c' was not declared in this scope
    8 |         for (int C = 1; C <= 50; ++c){
      |                                    ^
memory.cpp:12:17: warning: unused variable 'matchedCard' [-Wunused-variable]
   12 |             int matchedCard = Cards[letterCard];
      |                 ^~~~~~~~~~~
memory.cpp:7:13: warning: unused variable 'C' [-Wunused-variable]
    7 |         int C;
      |             ^