Submission #367966

#TimeUsernameProblemLanguageResultExecution timeMemory
367966Limay123Memory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h"
#include "memory.h"

/* -1   -> no ecnontrado pareja
   0    -> dulce
   >0    -> preguntar*/

void play(){

vector<int>abc(25,-1);
vector<bool>preguntar (25, true);
int i = 1, dulces = 0;

    while(true){
        if(dulces == 25){
            return;
        }
        if(preguntar[i] == true){
            int carta = faceup(i)-'A';

            if(abc[carta] == -1){
                abc[carta] = i;
            }
            else if(abc[carta] > 0){
                carta = faceup(abc[carta]);
                dulces++;
            }
            preguntar[i] = false;
        }
        i++;

    }
}

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:10:1: error: 'vector' was not declared in this scope
   10 | vector<int>abc(25,-1);
      | ^~~~~~
memory.cpp:10:8: error: expected primary-expression before 'int'
   10 | vector<int>abc(25,-1);
      |        ^~~
memory.cpp:11:8: error: expected primary-expression before 'bool'
   11 | vector<bool>preguntar (25, true);
      |        ^~~~
memory.cpp:18:12: error: 'preguntar' was not declared in this scope
   18 |         if(preguntar[i] == true){
      |            ^~~~~~~~~
memory.cpp:21:16: error: 'abc' was not declared in this scope
   21 |             if(abc[carta] == -1){
      |                ^~~