static void Main() { List <string> words = new List <string>(); int N = int.Parse(Console.ReadLine()); for (int i = 1; i <= N + N; i++) { string word = Console.ReadLine(); words.Add(word); } //Stopwatch sw = new Stopwatch(); //sw.Start(); CrosswordGenerator crosswordGenerator = new CrosswordGenerator(words, N); string[] crossword = crosswordGenerator.GenerateCrossword(); if (crossword == null) { Console.WriteLine("NO SOLUTION!"); } else { foreach (string line in crossword) { Console.WriteLine(line); } } //sw.Stop(); //Console.WriteLine(sw.Elapsed); }
static void Main() { List<string> words = new List<string>(); int N = int.Parse(Console.ReadLine()); for (int i = 1; i <= N + N; i++) { string word = Console.ReadLine(); words.Add(word); } //Stopwatch sw = new Stopwatch(); //sw.Start(); CrosswordGenerator crosswordGenerator = new CrosswordGenerator(words, N); string[] crossword = crosswordGenerator.GenerateCrossword(); if (crossword == null) { Console.WriteLine("NO SOLUTION!"); } else { foreach (string line in crossword) { Console.WriteLine(line); } } //sw.Stop(); //Console.WriteLine(sw.Elapsed); }