Exemplo n.º 1
0
        public static void Run(IGoogleCodeJamCommunicator io = null)
        {
            InOut = io ?? new GoogleCodeJam2018Communicator();
            var lines      = InOut.ReadStringInput(out numberOfCases);
            var cases      = new CaseSplitter().Configure_TakingNFromFirstValPlusOne().GetCaseLines(lines);
            var results    = new List <string>();
            var caseNumber = 0;

            foreach (var caseLines in cases)
            {
                caseNumber++; //1-indexed.
                var parsedCase = new CaseInput(caseLines);
                var solver     = new CaseSolver(parsedCase);
                var result     = solver.Solve();

                var resultText = result.ToString();

                results.Add($"Case #{caseNumber}: {resultText}");
            }

            InOut.WriteOutput(results);
        }
Exemplo n.º 2
0
 internal CaseSolver(CaseInput inputCase)
 {
     input = inputCase;
 }