제출 #1304440

#제출 시각아이디문제언어결과실행 시간메모리
1304440lunarechoMemory (IOI10_memory)C++20
컴파일 에러
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]); } } }

컴파일 시 표준 에러 (stderr) 메시지

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