# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
137283 | abacaba | cmp (balkan11_cmp) | C++14 | 2256 ms | 84016 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 "cmp.h"
#include <bits/stdc++.h>
using namespace std;
const int num[4] = {12, 10, 8, 6};
const int st[4] = {480, 48, 6, 1};
const int ind[4] = {100, 200, 300, 400};
vector <int> uniq[4096];
bool flag;
void remember(int n) {
if(!flag) {
flag = true;
for(int i = 0; i < 4096; ++i) {
int now = i, base = 1;
for(int j = 0; j < 4; ++j) {
int x = now / st[j];
uniq[i].push_back(ind[j] + x);
now %= st[j];
}
}
}
for(int i = 0; i < uniq[n].size(); ++i)
bit_set(uniq[n][i]);
}
int compare(int b) {
for(int i = 0; i < uniq[b].size(); ++i) {
int ost = uniq[b][i] - ind[i];
if(bit_get(ost + ind[i]))
continue;
if(ost + ost < num[i]) {
--ost;
for(; ost >= 0; --ost)
if(bit_get(ost + ind[i]))
return 1;
return -1;
}
else {
++ost;
for(; ost < num[i]; ++ost)
if(bit_get(ost + ind[i]))
return -1;
return 1;
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |