Submission #1317632

#TimeUsernameProblemLanguageResultExecution timeMemory
1317632matrix081Memory (IOI10_memory)C++20
Compilation error
0 ms0 KiB
#include "grader.h"
#include "memory.h"
#include <vector>
#include <iostream>
using namespace std;

void play() {
   int i,j,candies=0;
   char a, b,c,d;
   vector <int> guessed(25, -1);
   // when we meet a letter we have not seen before store it in the guessed array
   // if we have seen it before a dn we are at a, call b on the index in the array
   // if we are at b and have seen it before continue
   for (i=0; i<50&&candies<25; i++) {
      a = faceup(i);
      if(guessed[int(a)-65]==-1){ // have not seen it before
        guessed[int(a)-65] = i;
        b = faceup(i+1);
        if(guessed[int(b)-65]==-1 &&i<49){
          guessed[int(b)-65] = i+1; // if I havent met b before I save it;
        }
      }
      else{ // my case where we have met it before ;
        if(guessed[int(a)-65]!=-2 && guessed[int(a)-65]!=-1 && guessed[int(a)-65]!=i){
          b = faceup(guessed[int(a)-65]);
          if(a==b){
            guessed[int(a)-65] = -2;
            candies+=1;
            i+=1;
            }
          }
        else{
          b = faceup(i+1);
        }
        }
        
        
      }
        
         
         
      }
   
  // for (i=0; i<50 && candies<=25; i++){
  //     c = faceup(i);
  //     if(int(c)-65 == i){
  //       faceup(i+1);
  //       continue;
  //     }
  //     d = faceup(guessed[int(c)-65]);

  //     if(c==d){
  //       candies+=1;
  //     }
  // }
      
      
   
}

Compilation message (stderr)

memory.cpp:59:1: error: expected declaration before '}' token
   59 | }
      | ^