Submission #113920

# Submission time Handle Problem Language Result Execution time Memory
113920 2019-05-29T08:36:20 Z Kastanda cmp (balkan11_cmp) C++11
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
void remember(int a)
{
    for (int i = 0; i < 4; i++)
        bit_set(i * 8 + a % 8), 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))
        {
            if (b % 8 <= 4)
            {
                for (int j = 0; j < b % 8; j++)
                    if (bit_get(i * 8 + j))
                        return -1;
                return 1;
            }
            else
            {
                for (int j = b % 8 + 1; j < 8; j++)
                    if (bit_get(i * 8 + j))
                        return 1;
                return -1;
            }
        }
    return 0;
}

Compilation message

cmp.cpp: In function 'void remember(int)':
cmp.cpp:6:9: error: 'bit_set' was not declared in this scope
         bit_set(i * 8 + a % 8), a /= 8;
         ^~~~~~~
cmp.cpp:6:9: note: suggested alternative: 'tzset'
         bit_set(i * 8 + a % 8), a /= 8;
         ^~~~~~~
         tzset
cmp.cpp: In function 'int compare(int)':
cmp.cpp:15:14: error: 'bit_get' was not declared in this scope
         if (!bit_get(i * 8 + b % 8))
              ^~~~~~~