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
Hello all
If someone need setter’s solution here is the link…
Can someone help me with the 2 test cases where my code fails to give the correct answer?
My solution: CodeChef: Practical coding for everyone
It would be really helpful.Thank You.
This link is for different problem, is it a mistake?
Please tell me what am I doing wrong - your code return 2 for input from problem statement - yepUD3 - Online C++ Compiler & Debugging Tool - Ideone.com
yeah !! I am also inspired with that cool problem authored by lalit kundu 
It prints 2 as an output for problem statement example - see here APdHId - Online C++ Compiler & Debugging Tool - Ideone.com
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…
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…
I tried using this method, but WA!
can anyone fix this?
http://www.codechef.com/viewsolution/5423114
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
your output ends with
1
2
1
2
ans should end with
1
2
2
1
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?
Thanks for your effort.
Thanks for the help.
It returns 1 for input
1
Qr 12 28
It prints 11 and 10 for
2
Qb 999999999 1000000000
Qr 999999999 1000000000
and it should be 10 and 11…
It prints 22 and 23 for
2
Qb 999999999 1000000000
Qr 999999999 1000000000
first subtask has x and y less than 1000
I missed from your comment, that you are interested only in subtask 1, sorry…
I know it’s easier to ask, but please read the forum before asking. It’s not working for hH1YKh - Online C++ Compiler & Debugging Tool - Ideone.com , and it mentioned already…