# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1032112 | amine_aroua | cmp (balkan11_cmp) | C++17 | 0 ms | 344 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;
int pow4(int n , int i )
{
return (n >> (2 * i));
}
void remember(int n) {
for(int i = 0 ; i < 6 ; i++)
{
bit_set(pow4(n , i));
}
}
int compare(int b)
{
int lo = 0 , hi = 6;
while(lo + 1 < hi)
{
int mid = (lo + hi)/2;
if(bit_get(pow4(b , mid - 1)))
hi = mid;
else
lo = mid;
}
hi--;
if(hi == 0)
{
return 0;
}
int nb = 4 * pow4(b , hi);
int bit = pow4(b , hi - 1) - nb;
for(int i = 0 ; i < 4 ; i++)
{
if(i == bit)
continue;
if(bit_get(nb + i))
{
if(i < bit)
{
return 1;
}
else
return -1;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |