# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
998344 | SonicML | 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 "grader.h"
#include "memory.h"
void play() {
char ch;
int flip[25];
bool firstCard = true;
for(int pos = 1;pos <= 50;pos++) {
ch = faceup(pos);
if(firstCard == true) {
if(flip[ch-'a'] != 0) {
faceup(flip[ch-'a']);
}else{
firstCard = false;
}
}else {
if(flip[ch-'a'] != 0) {
faceup(flip[ch-'a']);
faceup(pos);
firstCard = true;
}else {
firstCard = true;
}
}
flip[ch-'a'] = pos;
}
return 0;
}