Program.cs 922 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using static D13._1.Program;
  5. using D13._1;
  6. namespace D13._2
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. if (args.Length < 1) throw new ArgumentException();
  13. if (File.Exists(args[0]) == false) throw new FileNotFoundException();
  14. var persons = new HashSet<Person>();
  15. var preferences = new Dictionary<(string, string), int>();
  16. ParseFile(args[0], persons, preferences);
  17. var me = new Person("Bastien");
  18. foreach (var p in persons)
  19. {
  20. preferences.Add((me.Name, p.Name), 0);
  21. preferences.Add((p.Name, me.Name), 0);
  22. }
  23. persons.Add(me);
  24. int best = SearchBestTablePlan(persons, preferences);
  25. Console.WriteLine($"The answer is : {best}");
  26. }
  27. }
  28. }