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