def METHOD_NAME(self, participation):
    cumtime = 0
    penalty = 0
    points = 0
    format_data = {}
    with connection.cursor() as cursor:
        cursor.execute("""
            SELECT MAX(cs.points) as `score`, (
                SELECT MIN(csub.date)
                    FROM judge_contestsubmission ccs LEFT OUTER JOIN
                         judge_submission csub ON (csub.id = ccs.submission_id)
                    WHERE ccs.problem_id = cp.id AND ccs.participation_id = %s AND ccs.points = MAX(cs.points)
            ) AS `time`, cp.id AS `prob`
            FROM judge_contestproblem cp INNER JOIN
                 judge_contestsubmission cs ON (cs.problem_id = cp.id AND cs.participation_id = %s) LEFT OUTER JOIN
                 judge_submission sub ON (sub.id = cs.submission_id)
            GROUP BY cp.id
        """, (participation.id, participation.id))
        for score, time, prob in cursor.fetchall():
            time = from_database_time(time)
            dt = (time - participation.start).total_seconds()
            # Compute penalty
            if self.config['penalty']:
                # An IE can have a submission result of `None`
                subs = participation.submissions.exclude(submission__result__isnull=True) \
                                                .exclude(submission__result__in=['IE', 'CE']) \
                                                .filter(problem_id=prob)
                if score:
                    prev = subs.filter(submission__date__lte=time).count() - 1
                    penalty += prev * self.config['penalty'] * 60
                else:
                    # We should always display the penalty, even if the user has a score of 0
                    prev = subs.count()
            else:
                prev = 0
            if score:
                cumtime = max(cumtime, dt)
            format_data[str(prob)] = {'time': dt, 'points': score, 'penalty': prev}
            points += score
    participation.cumtime = cumtime + penalty
    participation.score = round(points, self.contest.points_precision)
    participation.tiebreaker = 0
    participation.format_data = format_data
    participation.save()