Chef and stones problem gives me only 30 pts

The Chef and stones problem results with two result status one with WA and one with AC and gives me only 30 pts .why?

Link to my solution :
https://www.codechef.com/viewsolution/5877000

This is because your program is passing all test cases of the first subtask,but it is not able to pass one (or more) test cases of the second subtask.

Subtask N ≤ 5, T ≤ 2 Points: 30

Subtask N ≤ 105, T ≤ 5 Points: 70

As the first subtask has 30 points, you are getting that 30 points. But not the 70 points form the second subtask as your program is showing WA for those cases.

Read the constraints and subtasks carefully.

1 Like

The second sub-task doesn’t pass because as per the constraints N is of range 10^9 and sum of this range no can’t be stored in int datatype of C/C++ , so use long long int

and then try it… surely will result in AC for all sub-tasks.