# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
477108 | glome | Memory (IOI10_memory) | C++17 | 1 ms | 200 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"
#include<bits/stdc++.h>
using namespace std;
void play() {
map<char, vector<int>> m;
int last = 1;
vector<char> chars(51);
vector<bool> vis(51, 0);
for (int i = 1; i<=50; i++) {
if(vis[i]) {
continue;
}
bool ok = 0;
for (int k = i + 1; k<=50; k++) {
if(chars[k] == chars[i]) {
ok = 1;
char a = faceup(k), b = faceup(i);
vis[k] = 1;
vis[i] = 1;
break;
}
}
if(ok) {
continue;
}
for (int j = last+1; j<=50; j++) {
char a = faceup(i);
char b = faceup(j);
chars[i] = a;
chars[j] = b;
if(a == b) {
last = j;
vis[i] = 1;
vis[j] = 1;
break;
}
}
}
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |