Important optimizations and Notes - pawan-nirpal-031/Competitive_programming GitHub Wiki

Valuable details :

  1. never use (l+r)/2 for binary serach this is prone to overflow instead use l+(r-l)/2

  2. % operator is a costly operator specifically n^3 and other arithmetic operators aren't better they're n^2 but bitwise operators are n time so be careful with those. ex checking even or odd can be done by say (n&1) ie if lsb of n is on then it's a odd number.