Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace Ranking
- {
- class Ranking
- {
- static void Main()
- {
- string line = string.Empty;
- string[] cmd = null;
- var contestPassForCont = new Dictionary<string, string>();
- while ((line = Console.ReadLine()) != "end of contests")
- {
- cmd = line.Split(":", StringSplitOptions.RemoveEmptyEntries);
- var type = cmd[0];
- var pass = cmd[1];
- if (!contestPassForCont.ContainsKey(type))
- {
- contestPassForCont[type] = pass;
- }
- }
- var answer = new Dictionary<string, Dictionary<string, int>>();
- while ((line = Console.ReadLine()) != "end of submissions")
- {
- cmd = line
- .Split(new char[] { ':', '=', '>' }, StringSplitOptions.RemoveEmptyEntries);
- var type = cmd[0];
- var pass = cmd[1];
- var user = cmd[2];
- var points = int.Parse(cmd[3]);
- if (contestPassForCont.ContainsValue(pass) &&
- contestPassForCont.ContainsKey(type))
- {
- //var test = answer[user].ContainsValue(points);
- int test2 = answer[user][type];
- //if (check && answer[user].ContainsKey(user) &&
- // answer[user].Any(t => t.Key == type))
- //{
- // answer[user].Remove(type);
- // answer[user].Add(type, points);
- //}
- //else
- //{
- // answer[user] = new Dictionary<string, int>();
- // answer[user].Add(type, points);
- //}
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement