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 <vector>
#include "grader.h"
#include "memory.h"
void play() {
std::vector<int> index_of(50, -1);
int next = 1;
for (int correct = 0; correct < 25;) {
int first = faceup(next) - 'A';
if (index_of[first] != -1) {
faceup(index_of[first]);
correct += 1;
next += 1;
} else {
index_of[first] = next;
next += 1;
int second = faceup(next) - 'A';
if (second == first) {
correct += 1;
next += 1;
} else if (index_of[second] != -1) {
faceup(next);
faceup(index_of[second]);
correct += 1;
next += 1;
} else {
index_of[second] = next;
next += 1;
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |