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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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

Return to “Volume 4 (400-499)”