Submission #1304440

#TimeUsernameProblemLanguageResultExecution timeMemory
1304440lunarechoMemory (IOI10_memory)C++20
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <bits/stdc++.h> using namespace std; void play() { map<char, int> pos1, pos2; map<char, bool> did; for(int i=0;i<25;++i) { char a = faceup(2 * i), b = faceup(2 * i + 1); if(a == b) { did[a] = true; } else { if(pos1.find(a) == pos1.end()) { pos1[a] = 2 * i; } else { pos2[a] = 2 * i; } if(pos1.find(b) == pos1.end()) { pos1[b] = 2 * i + 1; } else { pos2[b] = 2 * i + 1; } } } for(char ch='A';ch<='Y';++ch) { if(!did[i]) { faceup(pos1[ch]); faceup(pos2[ch]); } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:27:15: error: 'i' was not declared in this scope
   27 |       if(!did[i]) {
      |               ^