UWCOI21C - Organisation - Editorial

He gave old code by mistake . I will update it.
There were no test cases before.

1 Like

Hey can you see now if its readable :sweat_smile:

First you’re messing with order of output (c and m). Fixing that passes first subatsk.

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 :innocent: 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
1 Like

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.

1 Like

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.

1 Like

Please tell me what I am doing wrong - CodeChef: Practical coding for everyone

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

I am failing only 1 testcase… IDK why…

My approach:

  1. Use a ordered Set and take the first and last pair (smallest and largest)…
  2. 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 print first.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

https://www.codechef.com/viewsolution/40584139
What am i doing wrong?

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