CHEFSHIP - Editorial

I didn’t submit it because tym complexity for brute force solution was O(n^2) and it would have exceeded the limit. But after contest I saw even brute force solution were accepted. Setter should keep this in mind and do not set weak test cases .

35 Likes

same thing happen to me aslo bro

This post was flagged by the community and is temporarily hidden.

4 Likes

@admin @akashbhalotia if possible please judge it with better testcases brutforce passed for some cases
see here

4 Likes

it must be get hacked if this were submitted on CODEFORCES

14 Likes

Hi all,

Apologies for the weak test cases in the problem CHEFSHIP. Here’s what actually happened. After preparing and testing the problem, we observed that there’s a need to reduce the load on the servers. So, while making modifications for that, we missed out on including sufficient testcases to break the brute solution. Sorry for the inconvenience caused.

25 Likes

I like your problems. Please make sure it doesn’t happen again.

Its okay, shit happens.
But question was good.

Atleast I am not aware with hashing approach, so would learn something new.
Thank you :slight_smile:

10 Likes

I don’t know why i am getting TLE in CHEFSHIP.
Problem Link- CodeChef: Practical coding for everyone
My Submission - https://www.codechef.com/viewsolution/33308621

i know that complexity of substr is O(n)

Can anybody tell any alternative way to extract substring from a string in an efficient way except substr
or
Can anybody point out a mistake so that i can change something in my code and get AC?

Thanks in Advance!

Pls rejudge the submissions as it can hamper ratings of individuals

15 Likes

This mistake also teach everyone something new.

1 Like

Can you please include the KMP solution? I am not getting it.

8 Likes

If we reduce the time limit for python, usko nani yaad ayegi :laughing:

2 Likes

I am just a noob so please don’t take it seriously…:slightly_smiling_face:

I tried with kmp just like setter’s solution .Not getting how to remove overlapping length of lps .can you please elaborate a liitle about if(2*len > i+1) @rishup_nitdgp please.
{len = lps1[key][len - 1];}

Chill dude. The only problem is that bruteforce works in python (which shouldn’t happen).

2 Likes

Hi all,

Test cases are updated. We can’t rejudge the contest solutions but in practice, you will have new test cases.

14 Likes

I dont know how brute force n^2 soln get passed in the contest .
i have seen many people code passed in n^2.
#weak test case

1 Like

what will happen now

I used substr() and it passed. Check my submission.

2 Likes