# RBTREE - Editorial

#7

One of the test case is accepted and the others are not. Can any one tell why ?

http://www.codechef.com/viewsolution/5406843

#8

Getting all cases I could think of right. Submitted 11 times… still couldn’t get any points.
Any help would be appreciated. Also no issues as reported in earlier comments.
My solution:
http://www.codechef.com/viewsolution/5419500

#9

Can you inspect this solution also. Only one subtask was giving WA and rest all were accepted. Can’t figure out the problem in this.
http://www.codechef.com/viewsolution/5345645

#10

Cannot figure out the problem.Please inspect the solution.
Solution

#11

Here it is!!

Fully commented solution:

#12

Getting all cases I could think of right. Submitted 3 times… still couldn’t get any points. I checked against all test cases in above editorial but working for all and giving right answer but on submission getting WA. Any help would be appreciated.
http://www.codechef.com/viewsolution/5403607

#13

Hello all

If someone need setter’s solution here is the link…

#14

Can someone help me with the 2 test cases where my code fails to give the correct answer?
My solution: http://www.codechef.com/viewsolution/5648945

It would be really helpful.Thank You.

#15

This link is for different problem, is it a mistake?

#16

Please tell me what am I doing wrong - your code return 2 for input from problem statement - http://ideone.com/yepUD3

#17

yeah !! I am also inspired with that cool problem authored by lalit kundu

#18

I am so sorry for that. Here is the correct link.
http://www.codechef.com/viewsolution/5336214

#19

It prints `2` as an output for problem statement example - see here http://ideone.com/APdHId

#20

I didn’t test it, but why `in` is of length 2? try to make it 5… Ok, and I tested it and this is first problem (same link), it also seems, that you print additional empty lines between the outputs…

#21

Same as @thegreatheisenberg above - use `a[5]` instead of `a[2]`, in C, string is ended with `'\0'` and it’s a good habbit to alocate a little more memory than you need in contest programming…

#22

I tried using this method, but WA!
can anyone fix this?
http://www.codechef.com/viewsolution/5423114

#23

For input:

``````14
Qb 1 2
Qr 1 2
Qb 1 4
Qr 1 4
Qi
Qb 1 2
Qr 1 2
Qb 1 4
Qr 1 4
Qb 4 5
Qr 4 5
Qi
Qb 4 5
Qr 4 5
``````

``````1
2
1
2
``````

ans should end with

``````1
2
2
1``````

#24

Okay, so I printed an extra line after each output because earlier in the sample output it seemed to me that they wanted me to print an extra line due to their formatting, now they corrected it (and it seems the online judge ignores extra line between outputs).
Secondly, it worked after changing in[2] to in[3] (no need for 5), but I don’t understand the logic behind this. Is it because ‘in’ needs to take a null character at the end so I need to provide extra space for that? If that’s true then why did the program run correctly on my pc before?
``````1