What is the meaning of these #defines?

I went through the best solution to the MAXCOUNT problem and found some lines that I did not understand.

Code Problem and Best Solution Submitted

While I was reading the code to observe this approach, I came across these lines at the top of the code:

#define isSet(n) flags[n>>5]&(1<<(n&31))
#define unset(n) flags[n>>5] &= ~(1<<(n&31))
#define set(n) flags[n>>5]|=(1<<(n&31))

I do not know what is the point of using these lines.
Can someone explain these lines and why are they used?

0
source share
1 answer

, , . n → 5 32, 32 int, . ( 31 0b11111, , , - 32), , (1 < n n, , ).

Unset uses ~, - , . set , .

, .

+3

Source: https://habr.com/ru/post/1568543/


All Articles