Exemplo n.º 1
0
        public void Run()
        {
            var cases   = InOut.ReadStringInput(out numberOfCases).ToList();
            var results = new List <string>();

            for (int ii = 0; ii < numberOfCases; ii++)
            {
                var parsedCase = new InputCase(cases[ii]);
                var solver     = new CaseSolver(parsedCase);
                Tuple <long, long> resultTuple = solver.Solve();

                var resultText = resultTuple.Item1.ToString() + ' ' + resultTuple.Item2.ToString();

                results.Add(string.Format("Case #{0}: {1}", ii + 1, resultText));
            }

            InOut.WriteOutput(results);
        }
Exemplo n.º 2
0
        public static void testDictionaryCreation()
        {
            var x = new CaseSolver(null);

            x.GetTupleList(10);
            x.GetTupleList(67);
            x.GetTupleList(100);
            x.GetTupleList(100000000);
            x.GetTupleList(1000000000000000000);
            //Console.WriteLine(string.Join(",", new InputCase("+-+-++++--- 4").Sequence));
            //Console.WriteLine(new InputCase("+-+-++++--- 4").SequenceLength);
            //Console.WriteLine(new InputCase("+-+-++++--- 4").FlipSize);

            //Console.WriteLine(string.Join(",", new InputCase("+++++++++++++ 9").Sequence));
            //Console.WriteLine(new InputCase("+++++++++++++ 9").SequenceLength);
            //Console.WriteLine(new InputCase("+++++++++++++ 9").FlipSize);

            //Console.WriteLine(string.Join(",", new InputCase("---- 2").Sequence));
            //Console.WriteLine(new InputCase("---- 2").SequenceLength);
            //Console.WriteLine(new InputCase("---- 2").FlipSize);
        }