From 7812e6751fb896ee86fb387b9ae40b8b7d29af7d Mon Sep 17 00:00:00 2001 From: Kato Hiroki Date: Sun, 1 Feb 2026 06:53:47 +0000 Subject: [PATCH] chore: Remove ABL from ABC-like table (#3108) --- docs/guides/how-to-add-contest-table-provider.md | 12 ++++++------ src/lib/utils/contest_table_provider.ts | 4 +++- src/test/lib/utils/contest_table_provider.test.ts | 11 +++++------ .../lib/utils/test_cases/contest_table_provider.ts | 10 +++++----- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/guides/how-to-add-contest-table-provider.md b/docs/guides/how-to-add-contest-table-provider.md index 13c6b9b01..b71ccae8e 100644 --- a/docs/guides/how-to-add-contest-table-provider.md +++ b/docs/guides/how-to-add-contest-table-provider.md @@ -216,12 +216,12 @@ class TessokuBookSectionProvider extends TessokuBookProvider { ### 複合ソース型 -| コンテスト | contest_id | 問題数 | セクション | 分割 | 複数コンテスト | -| ------------------ | ---------------------- | ------ | ------------ | ---- | -------------- | -| ABS | `'abs'` | 11問 | A~K | なし | あり(11個) | -| ABC-Like | 計15コンテスト | 2~8問 | A~H | なし | あり(15個) | -| TESSOKU_BOOK | `'tessoku-book'` | 166問 | A(01-77)/B/C | あり | あり | -| MATH_AND_ALGORITHM | `'math-and-algorithm'` | 104問 | 001~104 | なし | あり | +| コンテスト | contest_id | 問題数 | セクション | 分割 | 複数コンテスト | +| ------------------ | ---------------------- | ------ | ------------ | ---- | ----------------------------------------- | +| ABS | `'abs'` | 11問 | A~K | なし | あり(11個) | +| ABC-Like | 計14コンテスト | 2~8問 | A~H | なし | あり(14個)、ABL は ACL と同じ区分で表示 | +| TESSOKU_BOOK | `'tessoku-book'` | 166問 | A(01-77)/B/C | あり | あり | +| MATH_AND_ALGORITHM | `'math-and-algorithm'` | 104問 | 001~104 | なし | あり | **複合型の参照解決**: `getMergedTasksMap()` が複数コンテスト由来の task_id を自動統合。テストデータは [prisma/contest_task_pairs.ts](../../prisma/contest_task_pairs.ts) を参照。 diff --git a/src/lib/utils/contest_table_provider.ts b/src/lib/utils/contest_table_provider.ts index a868325de..13c8e5a1d 100644 --- a/src/lib/utils/contest_table_provider.ts +++ b/src/lib/utils/contest_table_provider.ts @@ -468,7 +468,9 @@ export class AGC001OnwardsProvider extends ContestTableProviderBase { export class ABCLikeProvider extends ContestTableProviderBase { protected setFilterCondition(): (taskResult: TaskResult) => boolean { return (taskResult: TaskResult) => { - return classifyContest(taskResult.contest_id) === this.contestType; + const contestId = taskResult.contest_id; + // Note: ACL Beginner Contest (ABL) will be shown in ACL provider, so exclude it here. + return classifyContest(contestId) === this.contestType && contestId !== 'abl'; }; } diff --git a/src/test/lib/utils/contest_table_provider.test.ts b/src/test/lib/utils/contest_table_provider.test.ts index 7d7c0a6e7..5a681f56a 100644 --- a/src/test/lib/utils/contest_table_provider.test.ts +++ b/src/test/lib/utils/contest_table_provider.test.ts @@ -1508,9 +1508,9 @@ describe('ContestTableProviderBase and implementations', () => { test('expects to format contest ID as round label', () => { const provider = new ABCLikeProvider(ContestType.ABC_LIKE); - const label = provider.getContestRoundLabel('abl'); + const label = provider.getContestRoundLabel('jsc2021'); - expect(label).toBe('ABL'); + expect(label).toBe('JSC2021'); }); test('expects to generate table with multiple contests', () => { @@ -1519,7 +1519,6 @@ describe('ContestTableProviderBase and implementations', () => { const table = provider.generateTable(filtered); expect(Object.keys(table).length).toBeGreaterThan(0); - expect(table).toHaveProperty('abl'); expect(table).toHaveProperty('jsc2021'); expect(table).toHaveProperty('jsc2025advance-final'); }); @@ -1557,11 +1556,11 @@ describe('ContestTableProviderBase and implementations', () => { const provider = new ABCLikeProvider(ContestType.ABC_LIKE); const filtered = provider.filter(taskResultsForABCLikeProvider); - const ablTasks = filtered.filter((task) => task.contest_id === 'abl'); + const zone2021Tasks = filtered.filter((task) => task.contest_id === 'zone2021'); const jsc2021Tasks = filtered.filter((task) => task.contest_id === 'jsc2021'); - // ABL: A-F - expect(ablTasks.some((task) => task.task_table_index === 'F')).toBe(true); + // Zone2021: A-F + expect(zone2021Tasks.some((task) => task.task_table_index === 'F')).toBe(true); // JSC2021: A-H expect(jsc2021Tasks.some((task) => task.task_table_index === 'H')).toBe(true); }); diff --git a/src/test/lib/utils/test_cases/contest_table_provider.ts b/src/test/lib/utils/test_cases/contest_table_provider.ts index 69ca0ac6e..63d90eb6d 100644 --- a/src/test/lib/utils/test_cases/contest_table_provider.ts +++ b/src/test/lib/utils/test_cases/contest_table_provider.ts @@ -761,7 +761,10 @@ const [jsc2021_a, jsc2021_h] = createContestTasks('jsc2021', [ { taskTableIndex: 'H', statusName: TRYING }, ]); -const [zone2021_a] = createContestTasks('zone2021', [{ taskTableIndex: 'A', statusName: AC }]); +const [zone2021_a, zone2021_f] = createContestTasks('zone2021', [ + { taskTableIndex: 'A', statusName: AC }, + { taskTableIndex: 'F', statusName: TRYING }, +]); const [sumitrust2019_a] = createContestTasks('sumitrust2019', [ { taskTableIndex: 'A', statusName: AC }, @@ -782,10 +785,6 @@ export const taskResultsForABCLikeProvider: TaskResults = [ tenka1_2017_beginner_b, tenka1_2017_beginner_c, tenka1_2017_c, - // ABL (6 problems: A-F) - abl_a, - abl_b, - abl_f, // CADDI2018B (4 problems: A-D) caddi2018b_a, caddi2018b_d, @@ -808,6 +807,7 @@ export const taskResultsForABCLikeProvider: TaskResults = [ jsc2021_h, // Zone2021 (6 problems: A-F) zone2021_a, + zone2021_f, // Sumitrust2019 (6 problems: A-F) sumitrust2019_a, // JSC2025Advance-Final (references ABC422 task_id)