if you add this line above your code then while taking input you dont have to take input using scanf() you can just initialize variable say t and for taking input you can just code
read(t); and this will work as scanf("%d",&t);
Or, assume this one
# define ll long long int
If you add this link at the top of your code, then you don’t have to initialize any long long int variable in code as
long long int a,b,...,x;
instead you may write,
ll a,b,....,x;
Here ll can be used in replacement of long long int…
In cases such as #define a(x) 2x
Therefore whenever you call a(x)
it behaves as a function and returns the value of 2x therefore if you write a(5) then it will return 10
Similiary just treat the above given define instructions as function declaration.
this program demostrates segmented sieve , fast and memory efficient version of sieve ,
if we store whole array position to store one flag , it is inefficient ,
we are storing each 32 bit to store 1 flag which reduces memory complexity by a factor of 1/32 .
now you have used 2 macros
ifc will check if the bitflag is 1 OR 0 …
isc will set specific bit position 1
any nth value is located at (n/32)th position
and (n%32)th bit from LSB
but since we are neglecting odd nth value flag changes to (n/64)th position .
and bit position is (n/2)%32 which is same as (n>>1)&31
mode with a power of 2 is same as ANDing with (same power of 2)-1
It just makes your code more readable and understandable. What’s the role a function, instead of writing the same code again and again just pass a value to the function and get the desired result similarly define can be sought to be a small function
#define it is used to declaration like global variables in program.variables are declared one time but we used it many times and it reduce the line of code and simple we used it. And it called macros.