@@ -16,6 +16,10 @@ export const classifyContest = (contest_id: string) => {
1616 return ContestType . AGC ;
1717 }
1818
19+ if ( / ^ a w c \d { 4 } $ / . exec ( contest_id ) ) {
20+ return ContestType . AWC ;
21+ }
22+
1923 if ( contest_id . startsWith ( 'APG4b' ) ) {
2024 return ContestType . APG4B ;
2125 }
@@ -242,10 +246,10 @@ export function getContestPrefixes(contestPrefixes: Record<string, string>) {
242246 * Contest type priorities (0 = Highest, 21 = Lowest)
243247 *
244248 * Priority assignment rationale:
245- * - Educational contests (0-10): ABS, ABC, APG4B, etc.
249+ * - Educational contests (0-10, 16 ): ABS, ABC, APG4B and AWC etc.
246250 * - Contests for genius (11-15): ARC, AGC, and their variants
247- * - Special contests (16-18 ): UNIVERSITY, FPS_24, OTHERS
248- * - External platforms (19-21 ): AOJ_COURSES, AOJ_PCK, AOJ_JAG
251+ * - Special contests (17-19 ): UNIVERSITY, FPS_24, OTHERS
252+ * - External platforms (20-22 ): AOJ_COURSES, AOJ_PCK, AOJ_JAG
249253 *
250254 * @remarks
251255 * HACK: The priorities for ARC, AGC, UNIVERSITY, AOJ_COURSES, and AOJ_PCK are temporary
@@ -271,12 +275,13 @@ export const contestTypePriorities: Map<ContestType, number> = new Map([
271275 [ ContestType . ABC_LIKE , 13 ] ,
272276 [ ContestType . ARC_LIKE , 14 ] ,
273277 [ ContestType . AGC_LIKE , 15 ] ,
274- [ ContestType . UNIVERSITY , 16 ] ,
275- [ ContestType . FPS_24 , 17 ] ,
276- [ ContestType . OTHERS , 18 ] , // AtCoder (その他)
277- [ ContestType . AOJ_COURSES , 19 ] ,
278- [ ContestType . AOJ_PCK , 20 ] ,
279- [ ContestType . AOJ_JAG , 21 ] ,
278+ [ ContestType . AWC , 16 ] ,
279+ [ ContestType . UNIVERSITY , 17 ] ,
280+ [ ContestType . FPS_24 , 18 ] ,
281+ [ ContestType . OTHERS , 19 ] , // AtCoder (その他)
282+ [ ContestType . AOJ_COURSES , 20 ] ,
283+ [ ContestType . AOJ_PCK , 21 ] ,
284+ [ ContestType . AOJ_JAG , 22 ] ,
280285] ) ;
281286
282287export function getContestPriority ( contestId : string ) : number {
@@ -297,20 +302,24 @@ export function getContestPriority(contestId: string): number {
297302 * - "abc"
298303 * - "arc"
299304 * - "agc"
305+ * - "awc"
300306 *
301- * followed by exactly three digits. The matching is case-insensitive.
307+ * followed by exactly three or four digits. The matching is case-insensitive.
302308 *
303309 * Example matches:
304310 * - "abc376"
305311 * - "ARC128"
306312 * - "agc045"
313+ * - "awc0001"
307314 *
308315 * Example non-matches:
309316 * - "xyz123"
310317 * - "abc12"
311318 * - "abc1234"
319+ * - "awc12345"
312320 */
313321const regexForAxc = / ^ ( a b c | a r c | a g c ) ( \d { 3 } ) / i;
322+ const regexForAwc = / ^ ( a w c ) ( \d { 4 } ) / i;
314323
315324/**
316325 * Regular expression to match AtCoder University contest identifiers.
@@ -338,6 +347,13 @@ export const getContestNameLabel = (contestId: string) => {
338347 ) ;
339348 }
340349
350+ if ( regexForAwc . exec ( contestId ) ) {
351+ return contestId . replace (
352+ regexForAwc ,
353+ ( _ , contestType , contestNumber ) => `${ contestType . toUpperCase ( ) } ${ contestNumber } ` ,
354+ ) ;
355+ }
356+
341357 if ( contestId === 'APG4b' || contestId === 'APG4bPython' ) {
342358 return contestId ;
343359 }
0 commit comments