×

# galactik: wrong code being AC

 3 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. http://ideone.com/L5Cenu 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 . asked 16 Jul '13, 16:53 425●4●6●17 accept rate: 0% 2.4k●128●183●169

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. :)

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


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

## Test case #2 :

1 0
-1


• 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


• 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


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

## Test case #5 :

6 0
1
3
5
2
4
6


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

## Test case #6 :

6 0
1
3
5
2
4
-6


• submissions 2364389 gave : 4294967309 (AC ??)

## Test case #7 :

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


• 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

3.4k21955
accept rate: 20%

1

@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.

(19 Jul '13, 09:43)

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

(19 Jul '13, 11:59) 3★

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.

(19 Jul '13, 12:56)

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

(19 Jul '13, 21:21)
 0 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. answered 16 Jul '13, 17:08 1.5k●8●21●30 accept rate: 0%
 0 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 answered 19 Jul '13, 03:48 4★pkay 31●1 accept rate: 33%
 0 even i am getting correct ans for all of the above test cases .. answered 19 Jul '13, 04:11 91●2●4●6 accept rate: 0%
 0 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 answered 19 Jul '13, 12:05 16.9k●49●115●225 accept rate: 11% 1 thank you for the link. :) 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. (19 Jul '13, 12:45)
 0 @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 answered 19 Jul '13, 16:21 3★kcahdog 10.0k●28●54●129 accept rate: 14% I don't want admin to redjuge the submissions. It would be unfair. (19 Jul '13, 21:23)
 0 @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. answered 19 Jul '13, 16:54 1●1 accept rate: 0% I removed usernames for not you guys feeling bad. Sorry. (19 Jul '13, 21:24)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,424
×1,070
×118
×18
×9

question asked: 16 Jul '13, 16:53

question was seen: 1,953 times

last updated: 22 Jul '13, 05:00