Weak Test Case/Accepting Incorrect Solutions for Codechef Starters 59 Maximum Subarray

The solution I submitted was accepted successfully but it showed wrong answers for my custom input. However, the solution which showed right answers was rejected in 4/7 Test-cases.
The solution shows
Output: 0 (which should be 3)
For Test Case:
3
-2 -1 -2
4
-4 -5 -2 3
but it was accepted somehow the solution which showed correct output (3) was rejected.
This wasted almost 1 hour of my time.

2 Likes

same here.
This is really disgusting we are doing real hardwork to get it for all possible test cases but the test cases designed are literally weird.
Codechef should rejudge all the solutions with updated test cases.

I checked some of the submissions after the contest was over and found out that many submissions are accepted but they were actually wrong for the test case mentioned above.

Most likely the rejected solution is also incorrect and failed a different testcase. Which of your submissions are you talking about?

The question Maximum Subarray was having incomplete test cases.
After completing the contests I saw some of the submissions and found out that their code was incomplete.
The test case where problem occured.

1
3
-1 5 -1
2
-1 -1

The answer according to me is 5.
But the judge accepted it with answer as 4.

Please @codechef look into it and update it.

2 Likes
for i in range(int(input())):

  n = int(input())

  a = list(map(int,input().split()))

  m = int(input())

  b = list(map(int,input().split()))

  temp = 0

  j = 0

  for i in range(n):

    j+=a[i]

    temp = max(temp,j) 

  j = 0

  for i in range(n-1,-1,-1):

    j+=a[i]

    temp = max(temp,j)

  for i in range(m):

    if b[i]>=0:

      temp+=b[i]

  print(temp)

Submitted by many accounts(Plagarized)… The following code is will give incorrect anwer for the following test cases…
INPUT:

1
6
-1000 -2000 10 20 -1000 -2000
2
1 2

EXPECTED OUTPUT:

30

OUTPUT BY MANY PLAGARIZED CODE:

3

@codechef Please look into this matter… Pls do remove the plagarized people…

1 Like