From a4989a82ec91073fcfe8d5f2ed6174e4ba313dbf Mon Sep 17 00:00:00 2001 From: kenkoooo Date: Sun, 15 Oct 2023 15:48:55 +0900 Subject: [PATCH 1/2] fix: algo-rated always has >=3 problems --- atcoder-problems-backend/sql-client/src/rated_point_sum.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atcoder-problems-backend/sql-client/src/rated_point_sum.rs b/atcoder-problems-backend/sql-client/src/rated_point_sum.rs index d3db5db78..ee6c19b05 100644 --- a/atcoder-problems-backend/sql-client/src/rated_point_sum.rs +++ b/atcoder-problems-backend/sql-client/src/rated_point_sum.rs @@ -30,7 +30,7 @@ impl RatedPointSumClient for PgPool { WHERE contests.start_epoch_second >= $1 AND contests.rate_change != $2 - AND contest_problem_count.problem_count >= 2 + AND contest_problem_count.problem_count >= 3 ", ) .bind(FIRST_AGC_EPOCH_SECOND) From b933a541d5c222b6a33d7907db231fa600c4a50c Mon Sep 17 00:00:00 2001 From: kenkoooo Date: Sun, 15 Oct 2023 22:33:35 +0900 Subject: [PATCH 2/2] fix: test --- .../sql-client/tests/test_rated_point_sum.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/atcoder-problems-backend/sql-client/tests/test_rated_point_sum.rs b/atcoder-problems-backend/sql-client/tests/test_rated_point_sum.rs index 2cd10585e..d76bcd6a6 100644 --- a/atcoder-problems-backend/sql-client/tests/test_rated_point_sum.rs +++ b/atcoder-problems-backend/sql-client/tests/test_rated_point_sum.rs @@ -45,7 +45,7 @@ async fn setup_contests(pool: &PgPool) { id: SAME_CONTEST_RATED.to_string(), start_epoch_second: FIRST_AGC_EPOCH_SECOND, duration_second: 1000, - title: "Unrated New Contest".to_string(), + title: "Rated New Contest".to_string(), rate_change: "All".to_string(), }, Contest { @@ -129,6 +129,16 @@ async fn setup_contest_problems(pool: &PgPool) { problem_index: "1".to_string(), contest_id: HEURISTIC_CONTEST.to_string(), }, + ContestProblem { + problem_id: "problem7".to_string(), + problem_index: "7".to_string(), + contest_id: RATED_CONTEST.to_string(), + }, + ContestProblem { + problem_id: "problem8".to_string(), + problem_index: "8".to_string(), + contest_id: SAME_CONTEST_RATED.to_string(), + }, ]; for problem in problems {