Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- var inputs = new List<string>();
- for (int i = 0; i < n; i++)
- {
- inputs.Add(Console.ReadLine());
- }
- string[] types = Console.ReadLine().Split(' ');
- string fail = types[0];
- string root = types[2];
- int count = 0;
- var result = new Dictionary<string, string>();
- for (int i = 0; i < n; i++)
- {
- string[] split = inputs[i].Split(new char[] { '\\', ';' }).ToArray();
- if (split[0] == root)
- {
- string[] splitFial = split[split.Length - 2].Split('.').ToArray();
- if (splitFial[1] == fail)
- {
- result.Add(split[split.Length - 2], split[split.Length - 1]);
- count++;
- }
- }
- }
- if (count == 0)
- {
- Console.WriteLine("No");
- }
- else
- {
- var sorted = result.OrderByDescending(r => r.Value).ThenBy(r => r.Key);
- foreach (var item in sorted)
- {
- Console.WriteLine($"{item.Key} - {item.Value} KB");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement