Submission #341832

#TimeUsernameProblemLanguageResultExecution timeMemory
341832marvenleeMemory (IOI10_memory)C++14
100 / 100
2 ms384 KiB
#include "grader.h"
#include "memory.h"
#include <map>
using namespace std;

void play() {
   int i;
   char a, b;
   map<char,int> mp;
   int j=1;
   for (i=1; i<=50 && j<=50; i++){

        a = faceup(j);
        if(mp.find(a)!=mp.end()){
            //printf("%d %d\n",j,mp.find(a)->second);
            b = faceup(mp.find(a)->second);
        }
        else {
            mp[a]=j;
            j+=1;
            b= faceup(j);
            if( mp.find(b)==mp.end() || a==b) mp[b]=j;
            else j--;
        }
        j+=1;

   }

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...