(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #367969

#TimeUsernameProblemLanguageResultExecution timeMemory
367969Limay123Memory (IOI10_memory)C++14
100 / 100
3 ms512 KiB
#include "grader.h" #include "memory.h" #include<vector> using namespace std; /* -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, encontre = 0, parejas = 2; while(true){ if(dulces == 25){ //lo logre return; } if(preguntar[i] == true){ if(encontre != 0){ i = encontre; encontre = 0; } char carta = faceup(i); //pido caracter int valor = carta-'A'; //indice caracter parejas--; //ya pedi una if(abc[valor] == -1){ //sin pareja abc[valor] = i; } else if(abc[valor] > 0){ //con pareja if(parejas == 1){ carta = faceup(abc[valor]); //solicito pareja parejas--; dulces++; } else if(parejas == 0){ encontre = i; } } preguntar[i] = false; } if(parejas == 0){ parejas = 2; } i++; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...