Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace Ranking
  6. {
  7. class Ranking
  8. {
  9. static void Main()
  10. {
  11. string line = string.Empty;
  12.  
  13. string[] cmd = null;
  14.  
  15. var contestPassForCont = new Dictionary<string, string>();
  16.  
  17. while ((line = Console.ReadLine()) != "end of contests")
  18. {
  19. cmd = line.Split(":", StringSplitOptions.RemoveEmptyEntries);
  20. var type = cmd[0];
  21. var pass = cmd[1];
  22.  
  23. if (!contestPassForCont.ContainsKey(type))
  24. {
  25. contestPassForCont[type] = pass;
  26. }
  27. }
  28.  
  29. var answer = new Dictionary<string, Dictionary<string, int>>();
  30.  
  31. while ((line = Console.ReadLine()) != "end of submissions")
  32. {
  33. cmd = line
  34. .Split(new char[] { ':', '=', '>' }, StringSplitOptions.RemoveEmptyEntries);
  35.  
  36. var type = cmd[0];
  37. var pass = cmd[1];
  38. var user = cmd[2];
  39. var points = int.Parse(cmd[3]);
  40.  
  41. if (contestPassForCont.ContainsValue(pass) &&
  42. contestPassForCont.ContainsKey(type))
  43. {
  44. //var test = answer[user].ContainsValue(points);
  45. int test2 = answer[user][type];
  46.  
  47. //if (check && answer[user].ContainsKey(user) &&
  48. // answer[user].Any(t => t.Key == type))
  49. //{
  50. // answer[user].Remove(type);
  51. // answer[user].Add(type, points);
  52. //}
  53. //else
  54. //{
  55. // answer[user] = new Dictionary<string, int>();
  56. // answer[user].Add(type, points);
  57. //}
  58. }
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement