Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions src/lib/utils/contest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const agcLikePrefixes = getContestPrefixes(AGC_LIKE);
* @example
* {
* utpc: 'UTPC' // University of Tokyo Programming Contest
* ttpc: 'TTPC' // Tokyo Institute of Technology Programming Contest
* tupc: 'TUPC' // Tohoku University Programming Contest
* }
*
Expand All @@ -127,6 +128,7 @@ const agcLikePrefixes = getContestPrefixes(AGC_LIKE);
*/
const ATCODER_UNIVERSITIES: ContestPrefix = {
utpc: 'UTPC',
ttpc: 'TTPC',
tupc: 'TUPC',
} as const;

Expand Down
25 changes: 25 additions & 0 deletions src/test/lib/utils/test_cases/contest_name_and_task_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,30 @@ const UTPC_TEST_DATA: UniversityContestsTestData = Object.fromEntries(
]),
) as UniversityContestsTestData;

type TtpcYear = '2015' | '2019' | '2022' | '2023';
type TtpcTaskPatterns = {
[K in TtpcYear]: string[];
};

const TTPC_TASK_PATTERNS: TtpcTaskPatterns = {
'2015': ['A', 'B', 'C', 'N', 'O', 'P'],
'2019': ['A', 'B', 'C', 'M', 'N', 'O'],
'2022': ['A', 'B', 'C', 'M', 'N', 'O'],
'2023': ['A', 'B', 'C', 'N', 'O', 'P'],
};

const TTPC_TEST_DATA: UniversityContestsTestData = Object.fromEntries(
Array.from({ length: 9 }, (_, i) => 2015 + i)
.filter((year) => year === 2015 || year === 2019 || year >= 2022)
.map((year) => [
`ttpc${year}`,
{
contestId: `ttpc${year}`,
tasks: TTPC_TASK_PATTERNS[year.toString() as keyof TtpcTaskPatterns],
},
]),
) as UniversityContestsTestData;

type TupcYear = '2022' | '2023';
type TupcTaskPatterns = {
[K in TupcYear]: string[];
Expand Down Expand Up @@ -290,6 +314,7 @@ const generateUniversityTestCases = (

const ALL_UNIVERSITY_TEST_DATA: UniversityContestsTestData = {
...UTPC_TEST_DATA,
...TTPC_TEST_DATA,
...TUPC_TEST_DATA,
};

Expand Down
14 changes: 14 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 @@ -263,6 +263,18 @@ const generateUtpcTestCases = (
return testCase;
});
};
const generateTtpcTestCases = (
years: number[],
): { name: string; value: TestCaseForContestNameLabel }[] => {
return years.map((year) => {
const testCase = createTestCaseForContestNameLabel(`TTPC ${year}`)({
contestId: `ttpc${year}`,
expected: `TTPC${year}`,
});

return testCase;
});
};
const generateTupcTestCases = (
years: number[],
): { name: string; value: TestCaseForContestNameLabel }[] => {
Expand All @@ -278,12 +290,14 @@ const generateTupcTestCases = (

// Note:
// UTPC contests on AtCoder: 2011-2014 and 2020-2023 (not held during 2015-2019)
// TTPC contests on AtCoder: 2015, 2019, 2022-
// TUPC contests on AtCoder: 2022-
//
// See:
// https://kenkoooo.com/atcoder/resources/contests.json
export const universities = [
...generateUtpcTestCases([2011, 2012, 2013, 2014, 2020, 2021, 2022, 2023]),
...generateTtpcTestCases([2015, 2019, 2022, 2023]),
...generateTupcTestCases([2022, 2023]),
];

Expand Down
5 changes: 5 additions & 0 deletions src/test/lib/utils/test_cases/contest_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export const agcLike = [

// Note:
// UTPC contests on AtCoder: 2011-2014 and 2020-2023 (not held during 2015-2019)
// TTPC contests on AtCoder: 2015, 2019, 2022-
// TUPC contests on AtCoder: 2022-
//
// See:
Expand All @@ -226,6 +227,10 @@ const universityContestIds = [
'utpc2021',
'utpc2022',
'utpc2023',
'ttpc2015',
'ttpc2019',
'ttpc2022',
'ttpc2023',
'tupc2022',
'tupc2023',
];
Expand Down
Loading