UASEQ - Editorial

My Intention was not to send the wrong solution , But I was just submitted my code to check what distribution of K in this problem, I was also expecting WA but I got AC this is also not my fault. If I have done this intentionally I never mention that I got AC with wrong solution. I was just a bit Lucky that I got AC with some AD-HOC solution.

With
Love

3 Likes

this problem is really buggy, @lakshman1988 exploited it. Surprised to see that solution doesnā€™t depend on the value of K.
ā€œa solution which can not pass the sample test case, gets AC?ā€ cant stop laughing :smiley:

3 Likes

Since we cannot change more than ā€˜kā€™ elements the last element(read maximum) has to be one of the last ā€˜kā€™ (read maximum ā€˜kā€™ elements of the list). Same holds true for first element.

Greatā€¦so u want 9-10k solutions(maybe more) to be read and challenged by a few testersā€¦now that is a practical solutionā€¦:\

which problem has 9-10k accepted solutions??
Moreover only some random solutions need to be seen.
Further if you see the example above by @dcod, you should realise that the test cases were useless! This was a trivial thing that deserved a few test cases. I wont accept the point that testers could not think of this.

nisargshah95: This has been fixed. Regret the issue.

Yes, we agree that this should be fixed.

Can anyone tell me plzz, what will be the output of:-
4 2
1 2 5 6
If it is not:- -1 2 5 8 then why?

Setterā€™s Solution :Main idea: From first k + 2 elementh we can choose two numbers that will not change. Use brute force for first K + 2 numbers. Final solution is O(K ^ 2 * N).
Why are v choosing from first k+2 only?