Possible reason for SIGSEGV

This code ran sucessfully on ideone.com and http://www.compileonline.com ( http://ideone.com/Lb4YIl )but for some reason giving SIGSEGV error please suggest any modification that i should do .Thanks in advance. :slight_smile:

Use long long int instead of int and you get AC :slight_smile:


The input begins with two positive integers n k (n, k<=10^7). The next n lines of input contain one positive integer ti, not greater than 10^9, each, that’s why you require long long int.


Your AC code after replacing int with long long int–>AC code

2 Likes

You didn’t used nextInt() to get Fast input.
Then what was the use of writing that class FastRead??

1 Like