Пример #1
0
        public static void testForceSolverPerformance()
        {
            var solver = new CaseSolver();

            Console.WriteLine(solver.Solve(1000));
            Console.WriteLine(solver.Solve(5000));
            Console.WriteLine(solver.Solve(10000));
            Console.WriteLine(solver.Solve(50000));
            Console.WriteLine(solver.Solve(99999990));
        }
Пример #2
0
        public static void testSolver_full()
        {
            var solver = new CaseSolver();

            for (int ii = 0; ii < 10000; ii++)
            {
                solver.Solve(ii);
            }
        }
Пример #3
0
        public static void testSolver_basic()
        {
            var solver = new CaseSolver();

            Console.WriteLine(solver.Solve(132));
            Console.WriteLine(solver.Solve(1000));
            Console.WriteLine(solver.Solve(7));

            Console.WriteLine(solver.Solve(1000));
            Console.WriteLine(solver.Solve(5000));
            Console.WriteLine(solver.Solve(10000));
            Console.WriteLine(solver.Solve(50000));
            Console.WriteLine(solver.Solve(99999990));

            Console.WriteLine(solver.Solve(7563));
        }
Пример #4
0
        public void Run()
        {
            var lines   = InOut.ReadStringInput(out numberOfCases);
            var cases   = new CaseSplitter().GetSingleLineCases(lines).ToArray();
            var solver  = new CaseSolver();
            var results = new List <string>();

            for (int ii = 0; ii < numberOfCases; ii++)
            {
                var answer = solver.Solve(long.Parse(cases[ii]));
                results.Add(string.Format("Case #{0}: {1}", ii + 1, answer));
            }

            InOut.WriteOutput(results);
        }