# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
343410 | BlancaHM | Memory (IOI10_memory) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "memory.h"
#include "grader.h"
void play() {
int pos[25]; // pos[i] contiene una de las posiciones de esa letra
int sumPos[25] = {0}; // sumPos[i] contiene la suma de las 2 posiciones de esa letra
int curChar;
for (int i = 1; i <= 50; i++) {
// levantamos todas las cartas y guardamos el resultado
curChar = faceup(i) - 'a';
pos[curChar] = i;
sumPos[curChar] += i;
}
for (int i = 0; i < 25; i++) {
// levantamos las parejas de cartas que contienen la misma letra
faceUp(pos[i]);
faceUp(sumPos[i] - pos[i]);
}
}