Can someone suggest any good resources to learn about how various integer data types are manipulated in C++ from a competitive programming perspective ? I'm having problems with understanding them, for example
When you do something like
long int x = y*z
, wherey
andz
arelong long int
, but the value ofy
andz
are small (say 100), would it cause overflow ? When you do something likeint x = (a*b) % prime
whena, b, prime
are of the order 109 (but still stored in int, would it cause overflow ? — What is the difference between double/point/long double etc ? How they're manipulated (like the above) ?Does using longer (for example, using
long long int
instead ofint
) causes the programme to run slower ? If yes, then how much (like a factor of 2 ? a factor of 4 ?)Why almost nobody uses long double in competitive programming ?
When manipulating digits of HUGE orders (like 10500), how that's done in CP ?
Why the strange result in running the following code ?