Skip to content

Commit d3b9aee

Browse files
authored
Merge pull request #1323 from AtCoder-NoviSteps/#1321
✨ Add gigacode 2019 contest (#1321)
2 parents 0609285 + 1568900 commit d3b9aee

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/lib/utils/contest.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,11 @@ export const classifyContest = (contest_id: string) => {
5656
return ContestType.MATH_AND_ALGORITHM;
5757
}
5858

59-
// HACK: 2024年9月下旬時点では、「Chokudai SpeedRun」と「Donutsプロコンチャレンジ」「COLOCON」のみ該当。
59+
// HACK: 2024年9月下旬時点では、「Chokudai SpeedRun」と「Donutsプロコンチャレンジ」「COLOCON」「GigaCode」のみ該当。
6060
// 対象コンテストが増えた場合は、判定条件を見直す必要がある。
61-
if (
62-
contest_id.startsWith('chokudai_S') ||
63-
contest_id.startsWith('donuts') ||
64-
contest_id.startsWith('colopl')
65-
) {
61+
const prefixes = ['chokudai_S', 'donuts', 'colopl', 'gigacode'];
62+
63+
if (prefixes.some((prefix) => contest_id.startsWith(prefix))) {
6664
return ContestType.OTHERS;
6765
}
6866

src/test/lib/utils/contest.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,13 @@ describe('Contest', () => {
170170
});
171171
});
172172

173-
describe('when contest_id contains donuts or colopl', () => {
173+
describe('when contest_id contains donuts, colopl and gigacode', () => {
174174
const testCases = [
175175
{ contestId: 'donuts-live2014', expected: ContestType.OTHERS },
176176
{ contestId: 'donuts-2015', expected: ContestType.OTHERS },
177177
{ contestId: 'colopl2018-qual', expected: ContestType.OTHERS },
178178
{ contestId: 'colopl2018-final', expected: ContestType.OTHERS },
179+
{ contestId: 'gigacode-2019', expected: ContestType.OTHERS },
179180
];
180181

181182
runTests('classifyContest', testCases, ({ contestId, expected }: TestCaseForContestType) => {
@@ -360,12 +361,13 @@ describe('Contest', () => {
360361
);
361362
});
362363

363-
describe('when contest_id contains donuts or colopl', () => {
364+
describe('when contest_id contains donuts, colopl and gigacode', () => {
364365
const testCases = [
365366
{ contestId: 'donuts-live2014', expected: ContestType.OTHERS },
366367
{ contestId: 'donuts-2015', expected: ContestType.OTHERS },
367368
{ contestId: 'colopl2018-qual', expected: ContestType.OTHERS },
368369
{ contestId: 'colopl2018-final', expected: ContestType.OTHERS },
370+
{ contestId: 'gigacode-2019', expected: ContestType.OTHERS },
369371
];
370372

371373
runTests(

0 commit comments

Comments
 (0)