# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
480787 |
2021-10-18T04:14:45 Z |
minhcool |
cmp (balkan11_cmp) |
C++17 |
|
820 ms |
92372 KB |
#include "cmp.h"
#define set_bit bit_set
#define get_bit bit_get
void remember(int n) {
//edit this
set_bit(1 + (n & 7));
set_bit(9 + ((n >> 3) & 7) * 8);
set_bit(81 + ((n >> 6) & 7) * 64);
set_bit(729 + ((n >> 9) & 7) * 512);
}
int compare(int b) {
//edit this
if(!get_bit(1 + (b & 7))){
if((b & 7) >= 4){
for(int i = (b & 7) + 1; i < 8; i++){
if(get_bit(1 + i)){
return -1;
}
}
return 1;
}
else{
for(int i = 0; i < (b & 7); i++){
if(get_bit(1 + i)){
return 1;
}
}
return -1;
}
}
b >>= 3;
if(!get_bit(9 + (b & 7) * 8)){
if((b & 7) >= 4){
for(int i = (b & 7) + 1; i < 8; i++){
if(get_bit(9 + i * 8)){
return -1;
}
}
return 1;
}
else{
for(int i = 0; i < (b & 7); i++){
if(get_bit(9 + i * 8)){
return 1;
}
}
return -1;
}
}
b >>= 3;
if(!get_bit(81 + (b & 7) * 64)){
if((b & 7) >= 4){
for(int i = (b & 7) + 1; i < 8; i++){
if(get_bit(81 + i * 64)){
return -1;
}
}
return 1;
}
else{
for(int i = 0; i < (b & 7); i++){
if(get_bit(81 + i * 64)){
return 1;
}
}
return -1;
}
}
b >>= 3;
if(!get_bit(729 + (b & 7) * 512)){
if((b & 7) >= 4){
for(int i = (b & 7) + 1; i < 8; i++){
if(get_bit(729 + i * 512)){
return -1;
}
}
return 1;
}
else{
for(int i = 0; i < (b & 7); i++){
if(get_bit(729 + i * 512)){
return 1;
}
}
return -1;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
820 ms |
92372 KB |
ZERO POINTS: For a=479 and b=1004, correct answer is 1, got -1 |