# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42272 | ljk0411jg | cmp (balkan11_cmp) | C++14 | 3088 ms | 94784 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"
void remember(int n) {
int num = n, temp = 0;
for (int i = 0; i < 12; i++)
{
if ((num & (1 << i)) != 0)
{
if (i > 5)
{
temp |= (1 << i);
}
bit_set(i + 1);
}
}
temp++;
bit_set(temp + 5000);
}
int compare(int b) {
int temp = 0;
for (int i = 11; i >= 6; i--)
{
if ((b & (1 << i)) != 0)
{
temp |= (1 << i);
}
}
temp++;
if (bit_get(temp + 5000) == 1)
{
for (int i = 6; i >= 1; i--)
{
if (bit_get(i) == 1)
{
if ((b & (1 << (i - 1))) == 0)
{
return -1;
}
}
else
{
if ((b & (1 << (i - 1))) != 0)
{
return 1;
}
}
}
}
else
{
for (int i = 12; i >= 7; i--)
{
if (bit_get(i) == 1)
{
if ((b & (1 << (i - 1))) == 0)
{
return -1;
}
}
else
{
if ((b & (1 << (i - 1))) != 0)
{
return 1;
}
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |