# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480787 | minhcool | cmp (balkan11_cmp) | C++17 | 820 ms | 92372 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"
#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 |
---|---|---|---|---|
Fetching results... |