def update_contest_problem_status(self):
        # 能运行到这里的都是比赛题目
        contest = Contest.objects.get(id=self.submission.contest_id)
        if contest.status != CONTEST_UNDERWAY:
            logger.info("Contest debug mode, id: " + str(contest.id) + ", submission id: " + self.submission.id)
            return

        with transaction.atomic():
            contest_problem = ContestProblem.objects.select_for_update().get(contest=contest, id=self.submission.problem_id)
            contest_problem.add_submission_number()

            user = User.objects.select_for_update().get(id=self.submission.user_id)
            problems_status = user.problems_status

            if problems_status not in "contest_problems":
                problems_status["contest_problems"] = {}

            # 增加用户提交计数器
            user.userprofile.add_submission_number()

            # 之前状态不是ac, 现在是ac了 需要更新用户ac题目数量计数器,这里需要判重
            if problems_status["contest_problems"].get(str(contest_problem.id), -1) != 1 and \
                            self.submission.result == result["accepted"]:
                user.userprofile.add_accepted_problem_number()

            if self.submission.result == result["accepted"]:
                contest_problem.add_ac_number()
                problems_status["contest_problems"][str(contest_problem.id)] = 1
            else:
                problems_status["contest_problems"][str(contest_problem.id)] = 2

            user.problems_status = problems_status
            user.save(update_fields=["problems_status"])

        self.update_contest_rank(contest)
dataset/ETHPy150Open QingdaoU/OnlineJudge/judge_dispatcher/tasks.py/JudgeDispatcher.update_contest_problem_status/swapped operands of `not in`