Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/lib/utils/contest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ const atCoderUniversityPrefixes = getContestPrefixes(ATCODER_UNIVERSITIES);
*/
const ATCODER_OTHERS: ContestPrefix = {
chokudai_S: 'Chokudai SpeedRun',
atc001: 'AtCoder Typical Contest 001',
'code-festival-2014-quala': 'Code Festival 2014 予選 A',
'code-festival-2014-qualb': 'Code Festival 2014 予選 B',
'code-festival-2014-final': 'Code Festival 2014 決勝',
Expand Down Expand Up @@ -313,16 +314,18 @@ export function getContestPriority(contestId: string): number {
* - "abc376"
* - "ARC128"
* - "agc045"
* - "atc001"
* - "awc0001"
*
* Example non-matches:
* - "xyz123"
* - "abc12"
* - "abc1234"
* - "atc1234"
* - "awc12345"
*/
const regexForAxc = /^(abc|arc|agc)(\d{3})/i;
const regexForAwc = /^(awc)(\d{4})/i;
const regexForAxc = /^(abc|arc|agc|atc)(\d{3})$/i;
const regexForAwc = /^(awc)(\d{4})$/i;

/**
* Regular expression to match AtCoder University contest identifiers.
Expand Down
4 changes: 4 additions & 0 deletions src/test/lib/utils/test_cases/contest_name_labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export const atCoderOthers = [
contestId: 'chokudai_S002',
expected: 'Chokudai SpeedRun 002',
}),
createTestCaseForContestNameLabel('AtCoder Typical Contest 001')({
contestId: 'atc001',
expected: 'ATC 001',
}),
];

export const mathAndAlgorithm = [
Expand Down
4 changes: 4 additions & 0 deletions src/test/lib/utils/test_cases/contest_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ export const atCoderOthers = [
contestId: 'chokudai_S002',
expected: ContestType.OTHERS,
}),
createTestCaseForContestType('AtCoder Typical Contest 001')({
contestId: 'atc001',
expected: ContestType.OTHERS,
}),
createTestCaseForContestType('CODE FESTIVAL 2014 qual A')({
contestId: 'code-festival-2014-quala',
expected: ContestType.OTHERS,
Expand Down
Loading