UWCOI21C - Organisation - Editorial

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