# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
113926 |
2019-05-29T08:40:12 Z |
Kastanda |
cmp (balkan11_cmp) |
C++11 |
|
1029 ms |
82680 KB |
#include<bits/stdc++.h>
#include "cmp.h"
using namespace std;
void remember(int a)
{
for (int i = 0; i < 4; i++)
bit_set(i * 8 + a % 8 + 1), a /= 8;
}
int compare(int _b)
{
int b = 0;
for (int i = 0; i < 12; i++)
if ((_b >> i) & 1)
b |= 1 << (12 - i - 1);
for (int i = 3; ~ i; i--, b /= 8)
if (!bit_get(i * 8 + b % 8 + 1))
{
if (b % 8 <= 4)
{
for (int j = 0; j < b % 8; j++)
if (bit_get(i * 8 + j + 1))
return -1;
return 1;
}
else
{
for (int j = b % 8 + 1; j < 8; j++)
if (bit_get(i * 8 + j + 1))
return 1;
return -1;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1029 ms |
82680 KB |
ZERO POINTS: For a=3069 and b=1532, correct answer is -1, got 1 |