Please tell me what's going wrong in my code

i guess i m placing %1000000007 wrongly but i don’t know where to place it. Kindly assist me in my code. ThankYou
Problem name: Alpha Score
Link to the code : https://ide.codingblocks.com/s/182942

Kindly ignore function name, i just made some modifications to count inversion problem that’s why function name is still count inversion

Please provide the link of your code in coding blocks IDE

Well your code is passing all the required test cases except test case 0. And when I run your code separately on test case 0, it is giving the correct output. There must be some issue with the online compiler. But your code and logic is correct.

But here when I m running the code, it’s showing tle for 2 cases and wrong answer in remaining

May I know where r u running it?? Or is there some specific ide for TA’s to check codes?

https://hack.codingblocks.com/app/contests/668/p/299
I am running your code here

Bro I also ran my code in the link u provided, I see no correct answer there as well :frowning:

You don’t have to take input for the number of test cases.
Modified Code : https://ide.codingblocks.com/s/183768
Quesion : https://hack.codingblocks.com/app/contests/668/p/299?_ga=2.206975067.935751344.1582201118-964098688.1564745825&_gac=1.27885902.1581421571.CjwKCAiAvonyBRB7EiwAadauqZoegPrBNhk51kSapJxMYlQHC1Eo3rdNrfURNDxwrOkVk0rWT204TxoC170QAvD_BwE
When I am running your code on the link above, it is passing all the test cases except test case 0.
Test Case 0 is the sample test case given in the question.
But when I run your code on the test case 0 using custom inputs, it is giving the correct answer.
So I guess there is some issue with the compiler.

@S19APP-PP0108
Testcase Input :
10000
10000 9999 9998 9997 9996 9995 … 5 4 3 2 1
( Back Counting from 10000 till 1 )

Expected Output :
2874300

Your Output :
2874600

Okay, thankyou sarthak

1 Like