MSTICK - Editorial

I implemented a Python solution for this problem and it is as fast as the few Python AC ones but I got TLE. Can someone spot the issue ? http://www.codechef.com/viewsolution/2188068

i answered in the other topic. your solutionā€™s worst case is when the input sequence of sticks is sorted.

Showing invalid Solution IDā€¦

Hey , I followed the first approach (finds range min query in time O(rootN)) . Upon submitting the code , I am getting Runtime Error. http://www.codechef.com/viewsolution/2185571

Total Memory Limit for this 50000 bytes.I declared two arrays of size 10000 each. So , it takes 80000 bytes [2*40000 bytes]. Is this the reason for the error ?

But, I have seen solutions using two arrays getting accepted.

The above formula is correct. Analyze.

Got the reason for runtime error. But still I have doubt about how the solutions using two arrays of size 10000 are getting accepted.

Finally accepted.! But still have the above doubt.

I have implemented the segment tree and correct approach , it is working for basic test cases but giving WA can somebody see http://www.codechef.com/viewsolution/2276619

i m getting WA for the question http://www.codechef.com/problems/MSTICK but not able to figure out whyā€¦ kindly helpā€¦ my solution is

I think it returns wrong answer for

6
3 4 5 1 2 3
3
0 0
1 2
0 2

last test is 6, not 7 as your code returns.

1 Like

Thanks a lot @betlistaā€¦ got my mistake and finally got ACā€¦:slight_smile:

The approach is ingenious in a IOI style contest where partial marks are given.But I think it will get TLE in most judges.

I get WA,can anyone tell me what am I doing wrong?
My submission- http://www.codechef.com/viewsolution/3339304

Hey Though I have test a lot of test cases and have considered the double part still the WAā€¦:frowning:
heres my sol: http://www.codechef.com/viewsolution/3655905 .plz helpā€¦:frowning:

Can anyone please find the error.The code is working on all test cases I could find,but could not locate the error,getting WA.
Plz Helpā€¦

It seems you found the error, right?

Hey I have used 2 segment trees for implementation. But still, I am getting wrong answer. Canā€™t figure out why. Could anyone please help me out? Solution : http://www.codechef.com/viewsolution/3792862

http://www.codechef.com/viewsolution/3902702 Can view my sol here. Not getting where is the prob,getting correct answer for all test cases

unable to figure out whats wrong with this?
http://www.codechef.com/viewsolution/3963394

What would the fault be in my solution?
http://www.codechef.com/viewsolution/4069045