Fix stat out-of-list

This commit is contained in:
cuom1999 2023-04-24 11:56:10 -05:00
parent 9cdcfa54d6
commit da07a9a9a4

View file

@ -847,6 +847,7 @@ class ContestStats(TitleMixin, ContestMixin, DetailView):
continue continue
problem_idx = codes.index(problem_code) problem_idx = codes.index(problem_code)
bin_idx = math.floor(point * self.POINT_BIN / max_point) bin_idx = math.floor(point * self.POINT_BIN / max_point)
bin_idx = max(min(bin_idx, self.POINT_BIN), 0)
counter[problem_idx][bin_idx] += count counter[problem_idx][bin_idx] += count
for i in range(num_problems): for i in range(num_problems):
problem_points[i] = [ problem_points[i] = [