FEB CHALLENGE RANKLIST

CAN ANYONE GIVEN FEW POSSIBLE TEST CASES TO THIS PROBLEM FOR ME TO CHECK MY PROGRAM

You cannot ask for test cases or help regarding solution of a problem during contest…

If you want to test your code write another code to generate random test cases…

Best of Luck :slight_smile:

Given test cases are sufficient… Check for the similar kind of test case patterns for higher integers. Hope this helps you and this comment is not against the codechef’s code of conduct.

Well dont you think the question is only fairly detailed.
I think i should have more test cases or a higher one.
3 6 is just too predictable

okay @ak_sky, for higher test cases, follow as stated by rishabhprsd7 above.

Would it be possible that s gets smaller than n?

I did’nt understand problm stmt clearly, my solution passes all the test case given in prob but when I submit my code it shows Wrong Answer. So plz help me understanding problm stmt and plz tell the answer for test case n=9, s=25 and n=6, s=16 just to understand problm clearly…

i have the same problem as @rakesh88 …i didnt understand the problem statement…i think i hav misinterpreted the question…pls help

Yes bro @coolsduy , in case of test case n=6 s=16 possible ranklist is 1 1 2 3 4 5, in this list only 1 is at its right position and all other is at wrong. So in final ideal list whether I have to change element at 2nd position to 6 or we have to change all element except 1st, i.e. 1, 1->2, 2->3, 3->4, 4->5, 5->6 ??? by this type we need 5 operation.
very confused in problem stmt whether this test case needed 1 operation or 5 operation.
Anyone plz Help…

“A rank list is an array of numbers when sorted will have the starting element as 1 and difference between any two consecutive elements less than or equal to 1.”

“A rank list is said to be an ideal rank list if no two persons gets equal rank in it.” These line from the problem statement should help. :slight_smile:

@ajinkya1p3… I have already read prob stmt lines that’s why i m confused. just tell me whether test case I mentioned needed 1 operation or 5 operation as I explained in above comment…

@nastra s will never get smaller than n. As one can figure out from the problem statement.

@rakesh88 you can easily figure out the rank list in case of 9 25 and 6 16. If not, you can ask this to the author of the question, in comments of the question page.

1 Like

@rakesh88 I think the best rank list will be 1 2 2 3 4 4 or 1 2 2 3 3 5, in this case you need only 4 positions to change and the sum is still same. But this logic is not working for me. :frowning: If anyone can spot what I made mistake then please let me know.

Someone plz help me in understanding problem statement, I still didn’t get what they want in qwn? I make my assumption to guess problem stmt and tried 3 times all my solution passes the given test case but shows Wrong Answer in submission.
so plz help me in test case n=9 s=25 so that I can understand problem, in this two considerable ranklis are:
(1) 1 2 3 3 3 3 3 3 4 acording to this ans will be 5.
and (2) 1 1 1 2 2 3 4 5 6 according to this ans will 3
Plz help me what will be correct ans for this sample test case…

No one can do it :slight_smile: Guessing test cases is one of the parts of programming… Moreover start taking it easy when a program does not gives an AC :slight_smile:

i have a statement assert((n*(n+1)/2)>=s) …according to problem statement i think it should be satisfied but i am getting sigarbt error …why…?

Also note that a rank list need not to be sorted e.g. {2, 2, 1} and {3, 3, 2, 1} are valid rank lists.

yes ans should be 3 you have to take the minimum of the all possible operations needed to convert it to a ideal rank list

rightly said @anh1l1ator

i too have the same question