Out of curiosity, I want to ask what difference does it make to use int , long int or long long int on the time taken by the code to execute successfully. I already know that it can cause Wrong Answer but how does it affect on time? asked 20 Mar '17, 13:59

This question has been asked several times. I will include the relevant links soon (give me ~1015 min). EDIT Here is the link Why long long int causes TLE The basic concept is that, a long long int will take two operations instead of 1 on it. Visualisation A 32 bit system, which has 32bit cells to store stuff, would store 64bit long long int by "splitting" it into two 32 bit ones and storing each in a cell and working on both of them. So number of operations double. Basic idea is that long long int take twice the operation than int. Eg, if (int) 5+3 is 1 operation, but (long long int ) 5+3 is 2 operation answered 20 Mar '17, 14:27
That sound's more convincing that how using long long int instead of long int can cause tle. Thanks!
(20 Mar '17, 19:47)

Check it for yourself. Run these codes on the Code, Compile and Run and check the time taken below: int i,j; for(i=0;i<1e+9;i++) j=sqrt(i); long long i,j; for(i=0;i<1e+9;i++) j=sqrt(i); I hope you will understand the difference ! . answered 20 Mar '17, 14:32
