galactik: wrong code being AC

It is quite strange that the case 5 0,-1,-1,-1,-1,-1 will give 0 while actual answer is -1…i don’t think there was any constraint disallowing all negative costs or 0 connections ans still the code is AC in practice.here is the code link.

here is the link for codechef AC code

http://www.codechef.com/viewsolution/2384166

@jay_adm we want you to look into the matter and make required changes .

4 Likes

yes these test cases were missing in the problem. One of my friends sid12 mailed this test case along with 2-3 more 5 days after the contest started. But he got a very late reply and the solutions were never rejudged.

I’ve made my own investigations on the LONG/JULY13/GALACTIK problem,
and it turns out the contest test cases are really weak indeed…

At first, i must say as a disclaimer that my purpose here is not to
denounce people who got AC although their implementation has some
failures, but to point out the fact that test cases are weak for this
specific problem. So please do not blame me for giving submission ids. :slight_smile:

I only had a look on submissions in the following 3 languages :

  • C
  • Python
  • Java

Two reasons for that :

  • There are not so many submissions
  • These are languages i can partially understand

Now let’s start.


Test case #1 :

3 0
1
2
3

Expected answer : 7

  • submissions 2335802,2335812 gave : 6 (AC ??)

Test case #2 :

1 0
-1

Expected answer : 0

  • submissions 2339274 gave : -1 (AC ??)
  • submissions 2338565 gave : -1 (AC ??)
  • submissions 2381681,2381726,2381747,2381775,2381805 gave : -1 (AC ??)

Test case #3 :

5 0
-1
-1
-1
-1
-1

Expected answer : -1

  • submissions 2351305 gave : 0 (AC ??)
  • submissions 2366259,2366302 gave : 0 (AC ??)
  • submissions 2340047 gave : 0 (AC ??)
  • submissions 2335888 gave nothing, as it crashed (AC ??)
  • submissions 2364389 gave : 21475336485 (AC ??)
  • submissions 2333863 gave : 0 (AC ??)
  • submissions 2382242,2382259 gave : 0 (AC ??)
  • submissions 2337394,2338695 gave : 0 (AC ??)
  • submissions 2329544,2329621,2332988 gave : 0 (AC ??)

Test case #4 :

3 2
2 3
1 2
1
1
1

Expected answer : 0

  • submissions 2365259,2365281,2366615 gave nothing, as it crashed (AC ??)

Test case #5 :

6 0
1
3
5
2
4
6

Expected answer : 25

  • submissions 2335802,2335812 gave : 21 (AC ??)

Test case #6 :

6 0
1
3
5
2
4
-6

Expected answer : -1

  • submissions 2364389 gave : 4294967309 (AC ??)

Test case #7 :

6 4
1 2
2 5
3 4
1 6
1
3
5
2
4
-6

Expected answer : 3

  • submissions 2359509 gave : 7 (AC ??)

Need to continue ?

Actually, i can see AT LEAST (as i only had a look for C, Python and Java)
15 different users that shouldn’t have got AC for this problem (/!\ and i have
no problem with that
) if contest test cases would have been well designed. I don’t
know about other languages, or even other problems

Then my question is as follow : will there be a special care taken in the future
to generate very broad test cases for contests, or can we expect that kind
of behaviour in the next editions ? Thank you very much for any answer or
comment about that, and sorry if i seem rude to someone, it’s not my intend.


Edit :

  • removed the extra spaces at the end of lines in 8th test case, removed the 5th test case (not needed anymore), and rerun local judge. i then packed some of your answers guys, as comments (to make the topic more readable)
  • removed the usernames, as they really are not needed to understand what i talk about
  • hey guys, don’t worry ! as i said, it’s ok for me if your code got AC without being perfect. don’t feel like you have to apologize of something : you really did nothing wrong ! i could even say i’m jealous because of the luck you had ! ^^
  • i never said nor thought it would be good to rejudge all submissions for this problem. you earned these AC, so it shouldn’t me removed. it would otherwise be unfair…
  • have a look at that : http://discuss.codechef.com/questions/13512/weak-test-cases-for-tkconvex
15 Likes

i got WA,6-7 times, checked my solutions for the mentioned corner Test cases .
I am getting all the expected answers.
2369346
2363276

It is disheartening seeing the above mentioned cases of AC

even i am getting correct ans for all of the above test cases …

I asked similar thing some time ago, you can try it

http://discuss.codechef.com/questions/1673/is-it-possible-to-create-new-test-cases-for-practice-problem

@cyberax You said my 2 submissions were wrong for your test case #8. Let me tell you one thing you have given the input in wrong format. That’s why the code has crashed and That is also the reason ehy codes of others even @vineetpaliwal has crashed. First you enter the input in right format and then check , because it is giving right answer on my machine when i manually enter your test case and crashes if I just copy and paste your test case.

1 Like

@cyberax Thank you for pointing my mistake. My code indeed had a bug in it. I have used a function “visit” and an array “visited” in my code. Inside the function i had mistakenly interchanged “visit” and “visited” on lines 4 and 5 so the error was generated in test case #4. The test cases for this question are indeed weak and my solution should not have got AC. However i feel rejudging all solutions would be too harsh as i was able to correct my code easily after reading this as it was a small mistake. I hope future test cases are much more exhaustive

@cyberax Thanx for pointing out that my code had a bug…but seriously as pointed out my code gave wa for test case #3 and #7 just because of this silly mistake-“i declared cost array as long long but during scanning i was using %d format specifier for it”…why would one debug if he gets ac…i hope future test cases will be much more tricky…its disheartening for me too…seeing my name here due to a mere silly mistake.

@cyberax:seems you have spent hours to find the bugs, good spirit. In general I feel codchef is serious about test cases(some time my submission got wa due to a single tc). Hope the Admin panel, look into the matter and put proper emphasis while generating the test cases.

1 Like

@cyberax great to see your commitment but seriously did codechef rejudge the submissions.

thank you for the link. :slight_smile: it’s a quite similar question indeed.

a little difference though : i ask for a specific care to be taken to test cases, specificly not to have to redjuge all submissions. if things are done well enough from the beginning, there should be no pain afterwards, fighting with the online judge.

1 Like

i agree with both @ravishanker and @sobhagya and you did a marvelous job and loboursome as well (Hatsoff to you)but will codechef rejudge the submissions.

dude you have given input case in wrong format as there are spaces in your input where it should not be because of which my code “gave nothing, as it crashed”.

1 Like

http://www.codechef.com/viewsolution/2339350

Yes, the input format for the test case #5 and other test cases contains some space. That’s why it shows nothing and crashed.

And i checked some of the codes and they works fine with this test case. And shocked to see @vineetpaliwal code crashed. It’s working fine.

1 Like

@cyberax : Two of your test cases contains extra spaces , and hence is improperly formatted . My code gives correct answer on both the test cases . You should please edit your post and remove my name .

1 Like

OOOPS ! Sorry, it’s fixed now. Please check the post again (i’ve added comments at the end). thanks for pointing that out, really sorry about that, my bad.

I don’t want admin to redjuge the submissions. I’m only bringing out a question which is basicly : will it happen again ? :slight_smile:

I don’t want admin to redjuge the submissions. It would be unfair.