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"
#include <bits/stdc++.h>
using namespace std;
void play()
{
vector<int> pos(26, -1);
queue<pair<int, int>> done;
int i = 0;
while (i < 50)
{
if (!done.empty())
{
faceup(done.front().first);
faceup(done.front().second);
done.pop();
continue;
}
int p = faceup(++i) - 'A';
if (pos[p] != -1)
{
faceup(pos[p]);
pos[p] = -1;
continue;
}
else
{
pos[p] = i;
p = faceup(++i) - 'A';
if (pos[p] != -1)
{
done.push({i, pos[p]});
pos[p] = -1;
}
else
pos[p] = i;
}
}
while (!done.empty())
{
faceup(done.front().first);
faceup(done.front().second);
done.pop();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |