ACCBIP - Editorial

Hey, my code failed for only one test case, could you please identify the problem, thanks.
https://p.ip.fi/TxpH

1 Like

@rishup_nitdgp the solutions of the setter, tester and editorialist are not visible. Please update the editorial with the solutions.

3 Likes

Faced the same problem bro.

My solution

@rishup_nitdgp can you please check my code and tell which test case my code failing i used dp…but for 15 its failing for 1 test case and for 25 its failing one test case i have to merge my 15 points code with this to get those points but why this code failing link of solution CodeChef: Practical coding for everyone

That’s odd.
Your code (as well as @pict_tourist) gets exactly 1 test case wrong, printing 9277379 instead of 9277373).
I haven’t looked at your code tho, so I’m not sure of the cause.

2 Likes

Can you please share your code?

1 Like

Same Issue
https://www.codechef.com/viewsolution/36807761

CodeChef: Practical coding for everyone weirdly AC solution

8 Likes

One way of story-telling :stuck_out_tongue:

1 Like

https://www.codechef.com/viewsolution/36859863
Can anyone please explain why this code is getting TLE in case 4 and 6.
As the complexity is O(N*K) it shouldn’t get TLE.

Isn’t that irritating to debug.

1 Like

@infinitepro can you look at my doubt

Well, I see that sorting isn’t the problem. Your complexity is O(N×K×T). If you put the maximum values, it is around 9×107 which is close to 1 second time limit. If the constant factors are large then it might be the cause of TLE.

Even my code was failing at the same case, Please try to inform us of the mistake

Beautiful Problem !!

1 Like

Probably he did it with some script.

Hah Very Smart of you

You are not alone, tried both tabular and recursive and failed in same test case, still trying to figure out.
Tabular Approach : CodeChef: Practical coding for everyone
Recursive with memoization : CodeChef: Practical coding for everyone.

Edit:
Memoization solution with proper comments:
CodeChef: Practical coding for everyone
@infinitepro please look into this why many have got wrong answer for just one test case.

1 Like

Hey Risabh this is not related to editorial . But can you please tell me how is nit dgp for MTech CSE ?

Here’s my solution - CodeChef: Practical coding for everyone.

I don’t see how the time limit was tight. Knapsack DP is fairly straightforward.