# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
24165 |
2017-06-01T04:00:15 Z |
ms990606 |
cmp (balkan11_cmp) |
C |
|
937 ms |
82564 KB |
#include "cmp.h"
void remember(int n) {
int N=n;
int a=N/(10*8*6);
N%=(10*8*6);
int b=N/(8*6);
N%=(8*6);
int c=N/8;
N%=8;
int d=N;
a+=1;
b+=1+12;
c+=1+12+10;
d+=1+12+10+8;
bit_set(a);
bit_set(b);
bit_set(c);
bit_set(d);
}
int compare(int e)
{
int N=e;
int a=N/(10*8*6);
N%=(10*8*6);
int b=N/(8*6);
N%=(8*6);
int c=N/8;
N%=8;
int d=N;
int A=bit_get(a+1);
if(A==1)
{
int B=bit_get(b+1+12);
if(B==1)
{
int C=bit_get(c+1+12+10);
if(C==1)
{
int D=bit_get(d+1+12+10+8);
if(D==1) return 0;
else if(d<=2)
{
for(int i=0;i<d;i++)
{
int bi=bit_get(i+1+12+10+8);
if(bi==1) return 1;
}
return -1;
}
else if(d>=3)
{
for(int i=d+1;i<6;i++)
{
int bi=bit_get(i+1+12+10+8);
if(bi==1) return -1;
}
return 1;
}
}
else if(c<=3)
{
for(int i=0;i<c;i++)
{
int bi=bit_get(i+1+12+10);
if(bi==1) return 1;
}
return -1;
}
else if(c>=4)
{
for(int i=c+1;i<8;i++)
{
int bi=bit_get(i+1+12+10);
if(bi==1) return -1;
}
return 1;
}
}
else if(b<=4)
{
for(int i=0;i<b;i++)
{
int bi=bit_get(i+1+12);
if(bi==1) return 1;
}
return -1;
}
else if(b>=5)
{
for(int i=b+1;i<10;i++)
{
int bi=bit_get(i+1+12);
if(bi==1) return -1;
}
return 1;
}
}
else if(a<=5)
{
for(int i=0;i<a;i++)
{
int bi=bit_get(i+1);
if(bi==1) return 1;
}
return -1;
}
else if(a>=6)
{
for(int i=a+1;i<12;i++)
{
int bi=bit_get(i+1);
if(bi==1) return -1;
}
return 1;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
937 ms |
82564 KB |
ZERO POINTS: For a=2926 and b=2925, correct answer is -1, got 1 |