Can anybody please tell me why is my code getting WA? Please help

Question Link:
Submission Link:
Please help…Thank you!. :slight_smile:

You are getting the answer as 10 for the case
1 1 1 1 1
As 1 is not smaller than 1, the answer should be 0
Add an equal sign in the 11th line and change the type of inv to long long int as you can have the answer in the order of n-squared

Okay got it!. Thank you :slight_smile: