In second problem of bronze division (Cow Baseball), solutions with O(n^3) have passed all the test, but limit of n is 1000. I checked it in ideone and it gives 0.94 sec. How is this possible? Here is link to my ideone attempt http://ideone.com/l7rezw