Submission #1246558

#TimeUsernameProblemLanguageResultExecution timeMemory
12465583lektraMemory (IOI10_memory)C++20
Compilation error
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);
   }

}

Compilation message (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;
      |                        ^~~~~~