예제 #1
0
        public void SubmitSolution()
        {
            var problemsRepo = new ProblemsRepo();
            var goodTasks    = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 38, 39, 40, 41, 42, 46 };
//			var goodTasks = new[] { 13 };
            var apiClient = new ApiClient();

            foreach (var p in goodTasks)
            {
                try
                {
                    Console.WriteLine($"!solving: {p}");
                    var problemSpec  = problemsRepo.Get(p);
                    var solutionSpec = UltraSolver.AutoSolve(problemSpec);
                    var postSolution = apiClient.PostSolution(p, solutionSpec);
                    Console.WriteLine(postSolution);
                    problemsRepo.PutSolution(p, solutionSpec);
                    problemsRepo.PutResponse(p, postSolution);
                }
                catch (Exception e)
                {
                    problemsRepo.PutSolution(p, e.ToString());
                }
                Thread.Sleep(1000);
            }
        }
예제 #2
0
        public void VisualiseSolution()
        {
            var problemsRepo = new ProblemsRepo();
            var problemSpec  = problemsRepo.Get(1170);

            Console.WriteLine("problem");
            Console.WriteLine(problemSpec);
            problemSpec.CreateVisualizerForm().ShowDialog();
            var solutionSpec = UltraSolver.AutoSolve(problemSpec);

            solutionSpec.CreateVisualizerForm().ShowDialog();
            Console.WriteLine("solution");
            Console.WriteLine(solutionSpec);
        }