402 - M*A*S*H

All about problems in Volume 4. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

10153EN
Experienced poster
Posts: 148
Joined: Sun Jan 06, 2002 2:00 am
Location: Hong Kong
Contact:

Post by 10153EN » Sun Jan 06, 2002 8:46 pm

My program gets wrong answer after the rejudgement. But I don't know what's wrong with it after testing it with many special data.

Can anyone tell me what's tricky for this problem or any special cases for this problem?? thx

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel » Sun Jan 06, 2002 9:04 pm

I think, that there is one test case, in which there remain more than X persons. After the Rejudgement I had the same Problem until I changed my program, so that it printed all the remaining positions.

10153EN
Experienced poster
Posts: 148
Joined: Sun Jan 06, 2002 2:00 am
Location: Hong Kong
Contact:

Post by 10153EN » Sun Jan 06, 2002 9:17 pm

Problem solved. thx~~

but it seems to have contradiction with the problem =(

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel » Sun Jan 06, 2002 9:31 pm

Yes, there is a contradiction to the problem.
I have written an E-Mail to the admins but got the answer, that there is not such a case, that there remain more than X people.

chang
New poster
Posts: 16
Joined: Wed Jan 16, 2002 2:00 am

Post by chang » Sun Feb 10, 2002 9:18 pm

Hey Adrin/10153EN ,

Would u pls clarify the bug in details. I can't understand ur topic. So pls give that special input that u mentioned & the outputs that ur code gives.
Thanks in advance for ur help.

Chang

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel » Sun Feb 10, 2002 9:35 pm

I have no input for this special case, but in the description there is the line:
You are assured that Klinger's deck will get the job done by the time the 20th card is used.
This is wrong, because there must be a test case in the input the judge uses in which the number of remaining people is greater than X. If you print only X positions, you get Wrong Answer (but only since the rejudge).

Saveman
New poster
Posts: 3
Joined: Sun Nov 18, 2001 2:00 am
Location: Poland
Contact:

Post by Saveman » Mon Apr 01, 2002 4:15 pm

Also we can get 'wrong answer' or even 'time limit exceeded' when we will work until the number of remaining people will be == X.

I don't know why the judges says that there is no such input data! :sad:

lundril
New poster
Posts: 6
Joined: Tue Mar 19, 2002 2:00 am
Contact:

I can prove it :-)

Post by lundril » Thu May 16, 2002 6:20 pm

Just to give my 2 cent as comment:
I can prove that there is such input, because I have a program which
won't be accepted if I change the abort condition of the loop
to NOT check the number of remaining cards.

Instead my program gets a segmentation fault or "Floating Point Error"
with this modification which clearly implicates that the program accesses
invalid memory, which might be the none existent cards.

so long
lundril

sjn
Learning poster
Posts: 73
Joined: Mon Apr 08, 2002 8:22 am
Contact:

Post by sjn » Sat May 25, 2002 7:41 am

who can tell me what is the output for

25 1 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel » Sat May 25, 2002 9:56 am

Output is:
Selection #1
1 2 3 4 5 6 11 19

sjn
Learning poster
Posts: 73
Joined: Mon Apr 08, 2002 8:22 am
Contact:

Post by sjn » Sat May 25, 2002 7:10 pm

I have also passed this case,and the cases following

Input:
10 2 3 5 4 3 2 9 6 10 10 6 2 7 3 4 7 4 5 3 2 4
47 6 11 2 7 3 4 8 5 10 7 8 3 7 4 2 3 9 10 2 5 3
31 9 5 8 2 1 7 7 11 3 6 5 4 9 10 5 2 1 5 3 9 7
16 3 11 2 7 3 4 8 5 10 7 8 3 7 4 2 3 9 10 2 5 3
25 1 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11

Output:
Selection #1
1 8

Selection #2
1 3 16 23 31 47

Selection #3
6 8 12 14 17 21 23 26 28

Selection #4
1 3 16

Selection #5
1 2 3 4 5 6 11 19

but i still got WA,who can tell me??? :cry:

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel » Sat May 25, 2002 10:12 pm

Your output is correct, but test your program with this input (I am not sure that it is used, but I considered the case in my program):
10 11 3 5 4 3 2 9 6 10 10 6 2 7 3 4 7 4 5 3 2 4
Output:
Selection #1
1 2 3 4 5 6 7 8 9 10

sjn
Learning poster
Posts: 73
Joined: Mon Apr 08, 2002 8:22 am
Contact:

Post by sjn » Sun May 26, 2002 10:03 am

i can also pass it :(
i really don't why
i use pascal language
if u know pascal,i hope u can help me with my porgram. :oops:

mido
Learning poster
Posts: 78
Joined: Sun Jun 16, 2002 9:48 pm
Location: Cairo,Egypt

402 - M*A*S*H

Post by mido » Sun Jun 23, 2002 11:14 pm

I'm not sure I understand the problem...I need a simple example to understand it...my question is this:

if we have this :
3 2 3

then 1 & 2 should be left, right?

10153EN
Experienced poster
Posts: 148
Joined: Sun Jan 06, 2002 2:00 am
Location: Hong Kong
Contact:

Post by 10153EN » Mon Jun 24, 2002 6:34 am

Sorry for interrupt, what do you mean by *left, right*?

Post Reply

Return to “Volume 4 (400-499)”