Beispiel #1
0
        public SubmissionResult Verify(Submission submission, Problem problem, ProblemTest problemTest, Execution execution, string output)
        {
            SubmissionResult submissionResult = new SubmissionResult
            {
                SubmissionId = submission.Id,
                TestId       = submission.Id,
                Time         = execution.TotalMs,
                Memory       = (int)execution.UsedMemoryKBs
            };

            if (problem.TimeLimit + 199 < execution.TotalMs)
            {
                submissionResult.Score    = 0;
                submissionResult.StatusId = StatusFactory.GetStatus(Constants.Statuses.Codes.TLE).Id;
            }
            if (problem.MemoryLimit < execution.UsedMemoryKBs)
            {
                submissionResult.Score    = 0;
                submissionResult.StatusId = StatusFactory.GetStatus(Constants.Statuses.Codes.MLE).Id;
            }
            else if (!execution.HasOutputFile)
            {
                submissionResult.Score    = 0;
                submissionResult.StatusId = StatusFactory.GetStatus(Constants.Statuses.Codes.MOF).Id;
            }
            else if (MathcesOutput(output, execution.Output))
            {
                submissionResult.Score    = problemTest.Score;
                submissionResult.StatusId = StatusFactory.GetStatus(Constants.Statuses.Codes.OK).Id;
            }
            else
            {
                submissionResult.Score    = 0;
                submissionResult.StatusId = StatusFactory.GetStatus(Constants.Statuses.Codes.WA).Id;
            }
            if (!execution.HasTerminated && submissionResult.Score == 0)
            {
                submissionResult.Score    = 0;
                submissionResult.StatusId = StatusFactory.GetStatus(Constants.Statuses.Codes.TLE).Id;
            }
            return(submissionResult);


            return(null);
        }
Beispiel #2
0
 public SubmissionResult Verify(Submission submission, Problem problem, ProblemTest problemTest, Execution execution, string output)
 {
     throw new NotImplementedException();
 }