Bug in CHEFCSC

I think there is something wrong with the challenge problem of FEB long contest 2015 http://www.codechef.com/FEB15/problems/CHEFCSC.
One bug that i detected is that answer to sample test case is not validated according to problem statement.

Explanation:-

Statement:

Chef can place some frame at position i if i + lengthj ≤ N - 1 where lengthj is the length of this frame.

Sample case:

Input:

zzabcndedzzabd

3 11

3 2 2

8 5 5

Output:

-1 0 9

Bug:

if the frame with length 2(lengthj) is used at position 9(i) and N is 3.
Then statement (9+2)<=(3-1) is false, but in sample test case this is not validated.
Please guys explain the problem statement.

3 Likes

Here N is not 3 but refers to the length of the string.

Input format:

Firs line contains string S.

Next line contains two integers N - number of frames, D - amount of money.

Next line contains N integers denoting the lengths of appropriate frames.

Next line contains N integers denoting the prices of appropriate frames.

Input:

zzabcndedzzabd

3 11

3 2 2

8 5 5

Here, clearly mentioned in the problem that N is 3 which is not the length of string S. Length of string S should be denoted by |s| according to problem statement.
Why should I assume the thing that is not mentioned in the problem.

2 Likes

perhaps the problem will be updated, i contacted codechef for that

problem got updated now.

Again, the bug persists and they are updating it.

They removed the problem at last.

2 Likes