Submission #1210605

#TimeUsernameProblemLanguageResultExecution timeMemory
1210605candi_ositosMemory (IOI10_memory)C++20
0 / 100
0 ms320 KiB
#include "grader.h"
#include "memory.h"
#include <bits/stdc++.h>
using namespace std;/*
void play();
static char card[51];
static int up[2], is_up[51], candy[25], candies, moves;
char faceup(int C){
   int c0, c1;
   if (C < 1 || C > 50 || is_up[C]) {
      exit(92);
   }
   is_up[C] = 1;
   up[moves%2] = C;
   moves++;
   if (moves%2 == 0) {
      c0 = card[ up[0] ] - 'A';
      c1 = card[ up[1] ] - 'A';
      if (c0==c1 && !candy[c0]) {
         candy[c0] = 1;
         ++candies;
      }
      is_up[ up[0] ] = is_up[ up[1] ] = 0;
   }
   return card[C];
}
void playgame(){
   int i;
   for (i=1;i<=50;i++)
   {
      cin>>card[i];
   }
   moves = candies = 0;
   play();
   if (candies != 25) {
      exit(91);
   }
}
int main(){
   playgame();
   cout<<"OK "<<moves<<"\n";
   return 0;
}*/
void play()
{
    vector <int> a, b;
    a.assign(25, -1);
    b.assign(25, -1);
    char c, d;
    cin>>c;
    int e, f;
    for(int i=1; i<=25; ++i)
    {
        c=faceup(2*i-1);
        if(a[c-'A']==-1)
        {
            a[c-'A']=2*i-1;
        }
        else
        {
            b[c-'A']=2*i-1;
        }
        d=faceup(2*i);
        if(a[d-'A']==-1)
        {
            a[d-'A']=2*i;
        }
        else
        {
            b[d-'A']=2*i;
        }
        e=c-'A';
        f=d-'A';
    }
    for(int i=0; i<25; ++i)
    {
        if(i!=e && i!=f)
        {
            faceup(a[i]);
            faceup(b[i]);
        }
    }
    faceup(a[e]);
    faceup(b[e]);
    faceup(a[f]);
    faceup(b[f]);
    return;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...