He gave old code by mistake . I will update it.
There were no test cases before.
Hey can you see now if its readable 
CodeChef: Practical coding for everyone
can someone please check my code why getting WA in substask 3
1
5 6
0 0 4 6 9 11
It fails on this test case.
Your output-
0 0 5 6
1 0 5 5
2 4 4 2
3 6 4 0
3 0 4 6
@akshitm16 bro,Thanks
for pointing out the error but what about the other subtasks. I mean is there something wrong with the logic. Did you find some testcase!
1
2 5
1 1 8
Has anyone have any easy solution in c++.
Can anyone please point out why am I getting TLE for subtask 2. I really don’t think it will exceed the time limit.
Solution Link: CodeChef: Practical coding for everyone
Can anyone please provide a test case for CodeChef: Practical coding for everyone and/or https://www.codechef.com/viewsolution/40537938? The testcases already given are all working I think.
If anyone have a Python Solution, please share it. I’m getting TLE for subtask 3. I used the approach mentioned above.
Nvm, got the error. I’ve used int.
https://www.codechef.com/viewsolution/40562274
I am failing only 1 testcase… IDK why…
My approach:
- Use a ordered Set and take the first and last pair (smallest and largest)…
- if the first one fills completely, put back the second then print
first.index+" "+ k+" "+first.index+" 0"and take care if first.val>k
else printfirst.index+" "+first.val+" "+second.index+" "+(k-first.val);and reduce the second.val and put it back
thanks bro finally got AC
Can anybody tell me why I was getting TLE on third subtask.I tried using long long
int but it did not work.
https://www.codechef.com/viewsolution/40568488
Refer the setter’s solution. Its quite easy
i was trying to solve my problem …but when i sort in increasing order (CodeChef: Practical coding for everyone)
i was getting subtask 1 correct and subtask 2 is wrong and when i was sorting decreasing order(CodeChef: Practical coding for everyone) my subtask 2 is getting correct and subtask 1 is wrong…can anyone tell me why order of sorting effecting my solution?
Try This Test Case U will understand
1
2 5
1 1 8