1437 - 電機系 (呂老師) DS 上機考2 Scoreboard

Time

2018/04/16 18:30:00 2018/04/16 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11894 電機系 DS 上機考 Santa List

11894 - 電機系 DS 上機考 Santa List   

Description

Objective

  • Use linked lists to find out the Santa list of Christmas gifts.
  • Each node stores a child name and the gift
  • Naughty kids can only get a lump of coal
  • Example: (Andy,paper)->(Sandy,Candy)->(David,coal)
Requirements
  • SantaList will be initialized with the input at the 1st line
  • AppendList
    • The gift list will be inserted in to SantaList after the existing good kids and before naughty kids.
    • You can assume no child's name repeats.
  • NaughtyKid
    • Naughty kids can be listed more than once, Santa Claus always move them to the end of the list one by one
    • Santa Claus will replace the gift of naughty kids with "coal"
    • You can assume the name of the listed naughty kids always exist in Santa Claus' list
  • Find out the final list when get the "End"

Input

Output

  • Pring SantaFinalList or Empty
  • List of children and their corresponding gifts (or coal)
  • Connect with symbols “->”
  • No space in between
  • If the list is Empty, print “Empty” only.

Sample Input  Download

Sample Output  Download

Tags




Discuss