Advertisement
koteshkoeziche

10. *SoftUni Exam Results

Nov 21st, 2020
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. 10. *SoftUni Exam Results
  2.  
  3. Judge statistics on the last Programing Fundamentals exam was not working correctly, so you have the task to take all the submissions and analyze them properly. You should collect all the submissions and print the final results and statistics about each language that the participants submitted their solutions in.
  4. You will be receiving lines in the following format: "{username}-{language}-{points}" until you receive "exam finished". You should store each username and his submissions and points.
  5. You can receive a command to ban a user for cheating in the following format: "{username}-banned". In that case, you should remove the user from the contest, but preserve his submissions in the total count of submissions for each language.
  6. After receiving "exam finished" print each of the participants, ordered descending by their max points, then by username, in the following format:
  7. Results:
  8. {username} | {points}
  9. After that print each language, used in the exam, ordered descending by total submission count and then by language name, in the following format:
  10. Submissions:
  11. {language} – {submissionsCount}
  12. Input / Constraints
  13. Until you receive "exam finished" you will be receiving participant submissions in the following format: "{username}-{language}-{points}".
  14. You can receive a ban command -> "{username}-banned"
  15. The points of the participant will always be a valid integer in the range [0-100];
  16. Output
  17. • Print the exam results for each participant, ordered descending by max points and then by username, in the following format:
  18. Results:
  19. {username} | {points}
  20. • After that print each language, ordered descending by total submissions and then by language name, in the following format:
  21. Submissions:
  22. {language} – {submissionsCount}
  23. • Allowed working time / memory: 100ms / 16MB.
  24. Examples
  25. Input Output Comment
  26. Pesho-Java-84
  27. Gosho-C#-84
  28. Gosho-C#-70
  29. Kiro-C#-94
  30. exam finished Results:
  31. Kiro | 94
  32. Gosho | 84
  33. Pesho | 84
  34. Submissions:
  35. C# - 3
  36. Java - 1 We order the participant descending by max points and then by name, printing only the username and the max points.
  37. After that we print each language along with the count of submissions, ordered descending by submissions count, and then by language name.
  38. Pesho-Java-91
  39. Gosho-C#-84
  40. Kiro-Java-90
  41. Kiro-C#-50
  42. Kiro-banned
  43. exam finished Results:
  44. Pesho | 91
  45. Gosho | 84
  46. Submissions:
  47. C# - 2
  48. Java - 2 Kiro is banned so he is removed from the contest, but he`s submissions are still preserved in the languages submissions count.
  49. So althou there are only 2 participants in the results, there are 4 submissions in total.
  50.  
  51.  
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement