diff --git a/backend/profile/views/oj.py b/backend/profile/views/oj.py index 3625a1df..81486202 100644 --- a/backend/profile/views/oj.py +++ b/backend/profile/views/oj.py @@ -197,10 +197,14 @@ def get(self, request): create_time__lt=end_datetime, ) .order_by("create_time") - .values_list("create_time", flat=True) + .values_list("problem_id", "create_time") ) + solved_problem_ids = set() count_by_date = {} - for create_time in submissions: + for problem_id, create_time in submissions: + if problem_id in solved_problem_ids: + continue + solved_problem_ids.add(problem_id) activity_date = get_activity_service_date(create_time, current_timezone) count_by_date[activity_date] = count_by_date.get(activity_date, 0) + 1