제출 #1246558

#제출 시각아이디문제언어결과실행 시간메모리
12465583lektraMemory (IOI10_memory)C++20
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "memory.h" #include<bits/stdc++.h> using namespace std; void play() { pair<int,int> pos[25]; char a; memset(pos, -1, sizeof(pos)); for(int i = 0; i < 50; ++i){ a = faceup(i); if(pos[a-'A'].first == -1) pos[a-'A'].first = i; else pos[a-'A'.second] = i; } for(int i = 0; i < 25; ++i){ faceup(pos[i].first); faceup(pos[i].second); } }

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

memory.cpp: In function 'void play()':
memory.cpp:15:24: error: request for member 'second' in ''A'', which is of non-class type 'char'
   15 |         else pos[a-'A'.second] = i;
      |                        ^~~~~~