# Rejudge Submissions of BENCHP

**URL:** <https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868>\
**Category:** feedback\
**Tags:** weak-test-case\
**Created:** [May 1, 2021, 3:11pm UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868 "2021-05-01T15:11:23Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 1, 2021, 3:11pm UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/1 "2021-05-01T15:11:23Z")

</div>

Hello @admin ,  
It is kinda necessary to rejudge the submissions (during contest) for the problem [BENCHP](https://www.codechef.com/problems/BENCHP), after updating the test cases for the problem.

[This](https://discuss.codechef.com/t/benchp-editorial/88774/55) comment proves that the test cases are weak. There could be many submissions like [this](https://www.codechef.com/viewsolution/45720222) that could have passed during the contest. Rejudging them can bring changes to the leaderboard - as a result, rating changes can also be updated. This is a serious issue one should look into.

> [@BENCHP - Editorial](https://discuss.codechef.com/t/benchp-editorial/88774/55):
>
> LOL, why is your code failing for this test case: Input 1 3 9 7 1 2 2 Your Output NO Expected Output YES So, can we conclude that the test cases are weak? @cubefreak777 what do you say about this (just an opinion)? @rhythmvarshney time complexity of your code is N\log{N} because you are sorting the Array. I am locking your code now. play_button Your so called O(N) code

---

<div class="post-metadata">

**Author:** ![sebastian](https://discuss.codechef.com/user_avatar/discuss.codechef.com/sebastian/32/219874_2.png) [@sebastian](https://discuss.codechef.com/u/sebastian)\
**Post date:** [May 1, 2021, 3:36pm UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/2 "2021-05-01T15:36:55Z")

</div>

After completion of contest, nothing can be done.

Only some extra TC can be added for practice section

---

<div class="post-metadata">

**Author:** ![anon20889346](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon20889346](https://discuss.codechef.com/u/anon20889346)\
**Post date:** [May 1, 2021, 3:41pm UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/3 "2021-05-01T15:41:06Z")

</div>

the code is incorrect … the testcases are fine

---

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 1, 2021, 4:01pm UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/4 "2021-05-01T16:01:22Z")

</div>

But that’s not fair. There could be many such submissions during the contest. Who knows - there could be major changes in the leaderboard.

---

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 1, 2021, 4:02pm UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/5 "2021-05-01T16:02:55Z")

</div>

What I am trynna say is the test data doesn’t include such type of test cases. Because of which even wrong solutions also passed. So, “ **Test cases are not fine** ”.

---

<div class="post-metadata">

**Author:** ![samarth2017](https://discuss.codechef.com/user_avatar/discuss.codechef.com/samarth2017/32/274045_2.png) [@samarth2017](https://discuss.codechef.com/u/samarth2017)\
**Post date:** [May 1, 2021, 8:19pm UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/6 "2021-05-01T20:19:22Z")

</div>

There have been already many discussions regarding test cases being weak. It is not correct to add test cases and re-judge submissions after the contest. Infact, it is not correct to add test cases between the contest also.  
After getting AC, many people don’t bother to check/prove their logic during the contest. So adding test cases and re-judging won’t be fair.  
You might like [this](https://codeforces.com/blog/entry/89063?#comment-775058) comment.

---

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 2, 2021, 2:21am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/7 "2021-05-02T02:21:36Z")

</div>

Yeah, I can understand. Hope it will not repeat in future contests. 🙂  
The same me thinking fairly 🤔

> [@LUNCHTIM - Editorial](https://discuss.codechef.com/t/lunchtim-editorial/87198/28):
>
> It clearly states that Proper testing was not done on this problem before the contest started. The worst input for an O(N^2) solution is N = 10^5 and a\_i = k\ \forall\ i\isin[1, N], where k is some constant. If they had tested this input against an O(N^2) solution, there would have not been such a huge number of accepted submissions past night. It is not fair to rejudge these submissions because the contest ended. If they (organisers) had realised about it during the contest and made an announc…

---

<div class="post-metadata">

**Author:** ![messi1711](https://discuss.codechef.com/user_avatar/discuss.codechef.com/messi1711/32/91319_2.png) [@messi1711](https://discuss.codechef.com/u/messi1711)\
**Post date:** [May 2, 2021, 6:24am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/8 "2021-05-02T06:24:39Z")

</div>

I am posting my solution to this problem. I don’t think in any test case my solution will fail  
If in any please tell me

[https://www.codechef.com/viewsolution/45601423](https://www.codechef.com/viewsolution/45601423)

---

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 2, 2021, 6:48am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/9 "2021-05-02T06:48:34Z")

</div>

> [@messi1711](#):
>
> I don’t think in any test case my solution will fail

Lol, why is everyone so confident about their “WRONG SOLUTION”  
Your code fails in the following test case

**Input**

```auto
1
10 25 10
4 2 3 3 4 2 5 1 6 3

```

**Expected Output**

```auto
YES

```

**Your Output**

```auto
NO

```

I am locking your code too.

> **Your code which made me laugh**
>
> ```auto
> #include <bits/stdc++.h>
> #define ll long long int
> #define messi ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
> 
> using namespace std;
> 
> int main() {
> messi
> 	
> int t;
> cin>>t;
> 
> ll n, w, w1;
> while(t--){
> cin>>n>>w>>w1;
> 
> map<ll, ll> occ;
> int x;
> for(int i=0;i<n;i++){
> cin>>x;
> occ[x]++;
> }
> 
> if(w<=w1){ cout<<"YES\n";}
> else{
> ll extra=0;
> for(auto i: occ){
> x=i.second;
> if(x%2==0){ extra+=(x*i.first);}
> }
> 
> if(extra+w1>=w) cout<<"YES\n";
> else cout<<"NO\n";
> }
> }
> return 0;
> }
> 
> ```

I would also like to mention that your code failed in 1730 test cases (very small constraints) out of 10^4 test cases which I generated in my machine. These test cases are absolutely RANDOM.

---

<div class="post-metadata">

**Author:** ![messi1711](https://discuss.codechef.com/user_avatar/discuss.codechef.com/messi1711/32/91319_2.png) [@messi1711](https://discuss.codechef.com/u/messi1711)\
**Post date:** [May 2, 2021, 7:09am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/10 "2021-05-02T07:09:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cubefreak777](https://discuss.codechef.com/user_avatar/discuss.codechef.com/cubefreak777/32/215911_2.png) [@cubefreak777](https://discuss.codechef.com/u/cubefreak777)\
**Post date:** [May 2, 2021, 7:45am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/11 "2021-05-02T07:45:07Z")

</div>

2 3 4 ||Rod Center(10) || 4 3 2  
Weight = 2x(4+3+2)+10 = 28 \> 25

---

<div class="post-metadata">

**Author:** ![messi1711](https://discuss.codechef.com/user_avatar/discuss.codechef.com/messi1711/32/91319_2.png) [@messi1711](https://discuss.codechef.com/u/messi1711)\
**Post date:** [May 2, 2021, 7:50am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/12 "2021-05-02T07:50:21Z")

</div>

Okay thank you Cubefreak!!

---

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 2, 2021, 7:58am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/13 "2021-05-02T07:58:20Z")

</div>

> [@messi1711](#):
>
> HOW CAN SOMEONE BE SO DUMB IN EVEN READING THE QUESTION PROPERLY.

Dude!!!  
You are the dumbest. It wasn’t me who read the question wrong, it’s you. Your solution just sucks. Why would I start a thread when I can just do my work?  
I was pretty much sure about it - **The test cases are WEAK**. I just wanted to convey the same to everyone.

And as I said, your code failed in 1730 test cases (very small constraints) out of 10^4 test cases that I generated in my machine. These test cases are absolutely RANDOM.

Kindly mind your words when you’re posting something.

---

<div class="post-metadata">

**Author:** ![datguyprasham](https://discuss.codechef.com/user_avatar/discuss.codechef.com/datguyprasham/32/24644_2.png) [@datguyprasham](https://discuss.codechef.com/u/datguyprasham)\
**Post date:** [May 2, 2021, 8:04am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/14 "2021-05-02T08:04:29Z")

</div>

@suman_18733097 hey i would like to know how are you generating test cases cause i wanna check whether my code will give the desired output or not !

---

<div class="post-metadata">

**Author:** ![messi1711](https://discuss.codechef.com/user_avatar/discuss.codechef.com/messi1711/32/91319_2.png) [@messi1711](https://discuss.codechef.com/u/messi1711)\
**Post date:** [May 2, 2021, 8:08am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/15 "2021-05-02T08:08:27Z")

</div>

Okay Now Let your machine check this one.

[https://www.codechef.com/viewsolution/45735405](https://www.codechef.com/viewsolution/45735405)

---

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 2, 2021, 8:49am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/16 "2021-05-02T08:49:03Z")

</div>

> **Test Generator**
>
> ```auto
> """
> Author: Chitturi Sai Suman
> Created: 2021-04-30 19:24:23
> """
> from random import randint
> 
> def generate_input_as_string():
> size = 10
> n = size
> have = randint(1, 20)
> required = randint(20, 40)
> l = [randint(1, size) for i in range(n)]
> r = str(n) + " " + str(required) + " " + str(have) + "\n"
> r = r + ' '.join([str(i) for i in l])
> return r
> 
> def main():
> test = 10000
> with open("in.in","w") as file:
> file.write(str(test)+'\n')
> for t in range(test):
> string = generate_input_as_string()
> file.write(string+"\n")
> 
> main()
> 
> ```

> **My Code**
>
> ```auto
> """
> Author: Chitturi Sai Suman
> Created: 2021-04-30 19:24:23
> """
> ## 57:69:74:68:20:4C:4F:56:45
> ## _________  ________ _
> ## / ____ | | | | | | \ / | / \ | \ | |
> ## | |___ | | | | | \/ | / _ \ | . \ | |
> ## \ ____\ | | | | | |\__ /| | | /_\ | | |\ \| |
> ## ____| | | \__ / | | | | | | __ | | | \ ` |
> ## | _____/ \______ / |_| |_| | __| |__ | |_| \__|
> ## 
> 
> from functools import reduce
> from fractions import Fraction
> import re
> from statistics import mean, median, mode
> from collections import deque, OrderedDict, defaultdict
> from re import compile, findall, escape, search, match
> from sys import stdin, stdout, stderr, setrecursionlimit
> from math import pi, sqrt, gcd, ceil, floor, log2, log10, factorial
> from random import choice, getrandbits, randint, random, randrange, shuffle
> from itertools import combinations, combinations_with_replacement, permutations
> from collections import Counter, namedtuple, ChainMap, UserDict, UserList, UserString
> from math import cos, acos, tan, atan, atan2, sin, asin, radians, degrees, hypot
> from bisect import insort, insort_left, insort_right, bisect_left, bisect_right, bisect
> from heapq import heapify, heappop, heappush, heappushpop, heapreplace, merge, nlargest, nsmallest
> # from numpy import dot, trace, argmax, argmin, array, cumprod, cumsum, matmul
> 
> size = 2 * (10 ** 6 + 1)
> 
> # Scope for Global Variables
> # 
> # 
> 
> def preCompute():
> # Precompute some values here
> # 
> pass
> 
> def solve():
> # Solve Test Cases here
> n, required, have = io.Tuple()
> weights = io.List()
> freq = Counter(weights)
> for i in freq:
> if freq[i] % 2 == 0:
> have += i * freq[i]
> else:
> have += i * (freq[i] - 1)
> io.write("YES" if have >= required else "NO")
> 
> def main():
> 
> testcases = 0
> 
> # testcases += 1
> 
> if testcases == 0:
> testcases = io.Int()
> 
> preCompute()
> 
> for test in range(testcases):
> 
> # io.write("Case #%d: "%(test+1), end="")
> # Use the following lines to write any logic if needed
> # 
> # 
> solve()
> 
> class IO:
> def input(self):
> return stdin.readline().strip()
> def String(self):
> return self.input()
> def StringList(self):
> return list(map(str, self.input().split()))
> def Int(self):
> return int(self.input())
> def Float(self):
> return float(self.input())
> def List(self):
> return list(map(int, self.input().split()))
> def Tuple(self):
> return tuple(map(int, self.input().split()))
> def debug(self, *obj, sep = " ", end = "\n"):
> string = sep.join([str(item) for item in obj]) + end
> stderr.write(string)
> def write(self, *obj, sep = " ", end = '\n'):
> string = sep.join([str(item) for item in obj]) + end
> stdout.write(string)
> def put(self, val: str):
> stdout.write(val + '\n')
> def yes(self):
> self.write("yes")
> def Yes(self):
> self.write("Yes")
> def YES(self):
> self.write("YES")
> def no(self):
> self.write("no")
> def No(self):
> self.write("No")
> def NO(self):
> self.write("NO")
> 
> io = IO()
> shit = 998244353
> mod = 10 ** 9 + 7
> hell = 10 ** 9 + 9
> inf = 10 ** 18
> lcm = lambda x, y: ((x * y) // gcd(x, y))
> add = lambda x, y, p: (x % p + y % p) % p
> sub = lambda x, y, p: ((x % p - y % p) + p) % p
> mul = lambda x, y, p: ((x % p) * (y % p)) % p
> inverse = lambda x, p: (pow(x, p - 2, p))
> setBitCount = lambda x: bin(x).count("1")
> sumOfDigits = lambda x: sum([int(i) for i in str(x)])
> 
> dc = [1, 0, 0, -1, -1, -1, 1, 1]
> dr = [0, 1, -1, 0, -1, 1, -1, 1]
> 
> def abort(s):
> raise AssertionError(s)
> 
> setrecursionlimit(size)
> 
> main()
> 
> ```

---

<div class="post-metadata">

**Author:** ![suman\_18733097](https://discuss.codechef.com/user_avatar/discuss.codechef.com/suman_18733097/32/218666_2.png) [@suman\_18733097](https://discuss.codechef.com/u/suman_18733097)\
**Post date:** [May 2, 2021, 8:49am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/17 "2021-05-02T08:49:46Z")

</div>

I can tell whether the code is correct or not, it is correct because you modified it.

---

<div class="post-metadata">

**Author:** ![messi1711](https://discuss.codechef.com/user_avatar/discuss.codechef.com/messi1711/32/91319_2.png) [@messi1711](https://discuss.codechef.com/u/messi1711)\
**Post date:** [May 2, 2021, 8:59am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/18 "2021-05-02T08:59:03Z")

</div>

Thank You And I hope that We will again Give our opinions on another post 😂😂  
Really Loving your Skill To Find Errors ❤❤  
Learning from You!!

---

<div class="post-metadata">

**Author:** ![digon](https://discuss.codechef.com/user_avatar/discuss.codechef.com/digon/32/267818_2.png) [@digon](https://discuss.codechef.com/u/digon)\
**Post date:** [May 2, 2021, 9:39am UTC](https://discuss.codechef.com/t/rejudge-submissions-of-benchp/88868/19 "2021-05-02T09:39:36Z")

</div>

Please consider removing your template when you share code on a public forum. It can be annoying for viewers to scroll 50 lines of gibberish just to check a couple of lines of actual code.
