Advertisement
Tsuki11

Untitled

Mar 13th, 2020
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. 2. Judge
  2. You know the jude system, right?! Your job is to create a program similar to the Judge system.
  3. You will receive several input lines in the following format:
  4. {username} -> {contest} -> {points}
  5. The constestName and username are strings, the given points will be an integer number. You need to keep track of every contest and individual statistics of every user. You should check if such contest already exists, and if not, add it, otherwise check if the current user is participating in the contest, if he is participating take the higher score, otherwise just add it.
  6. Also you need to keep individual statistics for each user - the total points of all constests.
  7. You should end your program when you receive the command "no more time". At that point you should print each contest in order of input, for each contest print the participants ordered by points in desecending order, than ordered by name in ascending order. After that, you should print individual statistics for every participant ordered by total points in desecnding order, and then by alphabetical order.
  8. Input / Constraints
  9. • The input comes in the form of commands in the format specified above
  10. • Username and contest name always will be one word
  11. • Points will be an integer in range [0, 1000]
  12. • There will be no invalid input lines
  13. • If all sorting criteria fail, the order should be by order of input
  14. • The input ends when you receive the command "no more time"
  15. Output
  16. • The output format for the contests is:
  17. {constestName}: {participants.Count} participants
  18. {position}. {username} <::> {points}
  19. • After you print all contests, print the individual statistics for every participant
  20. • The output format is:
  21. Individual standings:
  22. {position}. {username} -> {totalPoints}
  23.  
  24.  
  25. Examples
  26. Input Output
  27. Pesho -> Algo -> 400
  28. Gosho -> Algo -> 300
  29. Stamat -> Algo -> 200
  30. Pesho -> DS -> 150
  31. Mimi -> DS -> 600
  32. no more time Algo: 3 participants
  33. 1. Pesho <::> 400
  34. 2. Gosho <::> 300
  35. 3. Stamat <::> 200
  36. DS: 2 participants
  37. 1. Mimi <::> 600
  38. 2. Pesho <::> 150
  39. Individual standings:
  40. 1. Mimi -> 600
  41. 2. Pesho -> 550
  42. 3. Gosho -> 300
  43. 4. Stamat -> 200
  44. Pesho -> OOP -> 350
  45. Gosho -> OOP -> 250
  46. Stamat -> Advanced -> 600
  47. Gosho -> OOP -> 300
  48. Prakash -> OOP -> 300
  49. Prakash -> Advanced -> 250
  50. Ani -> JSCore -> 400
  51. no more time OOP: 3 participants
  52. 1. Pesho <::> 350
  53. 2. Gosho <::> 300
  54. 3. Prakash <::> 300
  55. Advanced: 2 participants
  56. 1. Stamat <::> 600
  57. 2. Prakash <::> 250
  58. JSCore: 1 participants
  59. 1. Ani <::> 400
  60. Individual standings:
  61. 1. Stamat -> 600
  62. 2. Prakash -> 550
  63. 3. Ani -> 400
  64. 4. Pesho -> 350
  65. 5. Gosho -> 300
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement