# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57718 | SpeedOfMagic | cmp (balkan11_cmp) | C++17 | 3169 ms | 82500 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;
void remember(int a) {
int oneAmount = 0;
for (int i = 0; i < 12; i++)
if (a & (1 << i))
oneAmount++;
if (oneAmount > 6) {
bit_set(13);
a = -a;
}
for (int i = 0; i < 12; i++)
if ((1 << i) & a)
bit_set(i + 1);
}
int compare(int b) {
int d = bit_get(13);
int a = 0;
int mul = 1;
if (d) {
a = 1 << 12;
mul = -1;
}
for (int i = 0; i < 12; i++) {
int p = bit_get(i + 1);
a += (1 << i) * p * mul;
}
if (a > b)
return -1;
else if (a < b)
return 1;
else
return 0;
if ((a < b && !d) || (a > b && d))
return 1;
else
return -1;
}
//111101000010
//110101011111
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |