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() {
// letters 'A' to 'Y' are converted to integers 0 to 24
int index[50][2]; // locations of cards; 0 = unknown
int lt, k; // traverses index
int i; // traverses cards
char r; // result of faceup
// initialize index
for (lt = 0; lt < 25; ++lt) {
for (k = 0; k < 2; ++k) {
index[lt][k] = 0;
}
}
// first round
for (i = 1; i <= 50; ++i) {
r = faceup(i);
lt = (int)(r) - (int)('A'); // int corresponding to char r
k = (index[lt][0]) ? 1 : 0;
index[lt][k] = i;
}
// second round
for (lt = 0; lt < 25; ++lt) {
faceup( index[lt][0] ); // result ignored
faceup( index[lt][1] ); // result ignored
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |