506 - System Dependencies

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

Moderator: Board moderators

SilentStrike
New poster
Posts: 22
Joined: Fri Jan 04, 2002 2:00 am

Large sample input? Tricky test case?

Post by SilentStrike »

Does anyone have any really nasty input? I passed all the input on the forum.

Does the order of removal matter (Is removing A then B then C the same as A then C then B, so long as B and C are not dependant on one another)? I know that I can change one line in my program so that it outputs the same thing as the sample output (only difference is the order of removal of TCPIP and HTML), or that it has the exact same output for the large input on the forum. But I don't have a program that does both. Does this mean it's incorrect?
taborda
New poster
Posts: 6
Joined: Wed Mar 16, 2005 1:57 am

Post by taborda »

i got AC (PE) right now..the thing is like little joey said:
Likewise, a component, not explicitly installed, can be explicitly removed in response to a command (if it is not needed to support other components)
so i got my AC with this input:

Code: Select all

DEPEND TCPIP NETCARD
DEPEND  BROWSER TCPIP  HTML
INSTALL NETCARD
INSTALL BROWSER
REMOVE BROWSER
LIST
REMOVE NETCARD
INSTALL BROWSER
REMOVE BROWSER
LIST
END
and the output should be:

Code: Select all

DEPEND TCPIP NETCARD
DEPEND  BROWSER TCPIP  HTML
INSTALL NETCARD
   Installing NETCARD 
INSTALL BROWSER
   Installing TCPIP 
   Installing HTML 
   Installing BROWSER 
REMOVE BROWSER
   Removing BROWSER
   Removing HTML
   Removing TCPIP
LIST
   NETCARD
REMOVE NETCARD
   Removing NETCARD
INSTALL BROWSER
   Installing NETCARD 
   Installing TCPIP 
   Installing HTML 
   Installing BROWSER 
REMOVE BROWSER
   Removing BROWSER
   Removing HTML
   Removing TCPIP
   Removing NETCARD
LIST
END
notice that when you install NETCARD explictly when you remove BROWSER NETCARD is NOT removed!!...but it is removed if you only install browser (and NETCARD is implicitly installed)

:)
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

Caesum wrote:What about the following ?
DEPEND A B C
DEPEND B D E G
DEPEND C G E K
DEPEND K Z
DEPEND E S
INSTALL A
LIST
REMOVE A
LIST
INSTALL B
INSTALL C
INSTALL A
REMOVE A
INSTALL K
LIST
REMOVE C
REMOVE A
INSTALL A
LIST
INSTALL C
REMOVE A
LIST
END
My WA program gives
DEPEND A B C
DEPEND B D E G
DEPEND C G E K
DEPEND K Z
DEPEND E S
INSTALL A
Installing D
Installing S
Installing E
Installing G
Installing B
Installing Z
Installing K
Installing C
Installing A
LIST
D
S
E
G
B
Z
K
C
A
REMOVE A
Removing A
Removing B
Removing D
Removing C
Removing E
Removing S
Removing G
Removing K
Removing Z
LIST
INSTALL B
Installing D
Installing S
Installing E
Installing G
Installing B
INSTALL C
Installing Z
Installing K
Installing C
INSTALL A
Installing A
REMOVE A
Removing A
INSTALL K
K is already installed.
LIST
D
S
E
G
B
Z
K
C
REMOVE C
Removing C
Removing K
Removing Z
REMOVE A
A is not installed.
INSTALL A
Installing Z
Installing K
Installing C
Installing A
LIST
D
S
E
G
B
Z
K
C
A
INSTALL C
C is already installed.
REMOVE A
Removing A
Removing C
Removing K
Removing Z
LIST
D
S
E
G
B
END
Your remove order for the first REMOVE A is not the same as mine.
The order of REMOVE A should be the reverse of the order of INSTALL A.
I don't know if the judge will accept this order.
Post Reply

Return to “Volume 5 (500-599)”