DESTROY - Editorial

When I click on a solution it says “This XML file does not appear to have any style information associated with it. The document tree is shown below.”

@pushkarmishra I did exactly the same thing. Why does this code give WA then? My Submission Link

@rachit_26_08 why is this O(n) solution correct?

Can someone find mistake in my


[1]


  [1]: https://www.codechef.com/viewsolution/9231730
though i manually checked different test cases.
1 Like

Please can someone provide the test case where it fails?
My Submission

1 Like

I want to submit for this problem but the submit button is not available

1 Like

What is wrong with this


[1]??


  [1]: https://www.codechef.com/viewsolution/9230426
1 Like

@shariquemohd you can directly submit to: CodeChef: Practical coding for everyone ,i had just submitted like this.

Can’t see the solution.XML error.

Can someone please provide any test case in which given code gives wrong output.

Implemented using Max Priority Queue. But still getting WA.
Tried all the above test cases and Passed.
Can Anyone tell other test cases where my code might have failed
here is my link to solution CodeChef: Practical coding for everyone

Want to know where this solution fails.

https://www.codechef.com/viewsolution/9236770

1 Like

XML error.! :frowning:

I have implemented using max heap.
I have passed all the test case given above.
But Still getting WA
Can someone tell me any test case where my code might fail.
my solution link
https://www.codechef.com/viewsolution/9240904

Trying to submit but it doesn’t seems to work, submit

What will be the answer of this test case
1
10
1 1 1 3 3 3 2 2 2 2
and how ?
will it be 6 or 5?

@archit910
answer of this test case 1 10 1 1 1 3 3 3 2 2 2 2 will be 5
5 pairs are:
(1,2)(1,2)(2,3)(2,3)(1,3)

I want to know where i am going wrong in my code and which test case my code is failing.
please help!!!

or u can find a pair in which u have the highest frequency and lowest,it is algebraically equivalent to taking pair of highest frequencies when u sum it all up.

how is complexity of editorialist code is (n*logn)…??

suppose there is two number in priority queue

a=1e9

b=1e9-1;

this will goes to approax 1e9 times??