Skip to content

Commit 9d216e9

Browse files
committed
✨ Add typical 90 to contest table (#2337)
1 parent 00cae94 commit 9d216e9

File tree

3 files changed

+404
-1
lines changed

3 files changed

+404
-1
lines changed

prisma/tasks.ts

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5134,6 +5134,210 @@ export const tasks = [
51345134
title: 'A. 科目選択 (Selecting Subjects)',
51355135
grade: 'Q9',
51365136
},
5137+
{
5138+
id: 'typical90_cl',
5139+
contest_id: 'typical90',
5140+
problem_index: '090',
5141+
name: "Tenkei90's Last Problem(★7)",
5142+
title: "090. Tenkei90's Last Problem(★7)",
5143+
},
5144+
{
5145+
id: 'typical90_ck',
5146+
contest_id: 'typical90',
5147+
problem_index: '089',
5148+
name: 'Partitions and Inversions(★7)',
5149+
title: '089. Partitions and Inversions(★7)',
5150+
},
5151+
{
5152+
id: 'typical90_cj',
5153+
contest_id: 'typical90',
5154+
problem_index: '088',
5155+
name: 'Similar but Different Ways(★6)',
5156+
title: '088. Similar but Different Ways(★6)',
5157+
},
5158+
{
5159+
id: 'typical90_ci',
5160+
contest_id: 'typical90',
5161+
problem_index: '087',
5162+
name: "Chokudai's Demand(★5)",
5163+
title: "087. Chokudai's Demand(★5)",
5164+
},
5165+
{
5166+
id: 'typical90_ch',
5167+
contest_id: 'typical90',
5168+
problem_index: '086',
5169+
name: "Snuke's Favorite Arrays(★5)",
5170+
title: "086. Snuke's Favorite Arrays(★5)",
5171+
},
5172+
{
5173+
id: 'typical90_cg',
5174+
contest_id: 'typical90',
5175+
problem_index: '085',
5176+
name: 'Multiplication 085(★4)',
5177+
title: '085. Multiplication 085(★4)',
5178+
},
5179+
{
5180+
id: 'typical90_cf',
5181+
contest_id: 'typical90',
5182+
problem_index: '084',
5183+
name: 'There are two types of characters(★3)',
5184+
title: '084. There are two types of characters(★3)',
5185+
},
5186+
{
5187+
id: 'typical90_ce',
5188+
contest_id: 'typical90',
5189+
problem_index: '083',
5190+
name: 'Colorful Graph(★6)',
5191+
title: '083. Colorful Graph(★6)',
5192+
},
5193+
{
5194+
id: 'typical90_cd',
5195+
contest_id: 'typical90',
5196+
problem_index: '082',
5197+
name: 'Counting Numbers(★3)',
5198+
title: '082. Counting Numbers(★3)',
5199+
},
5200+
{
5201+
id: 'typical90_cc',
5202+
contest_id: 'typical90',
5203+
problem_index: '081',
5204+
name: 'Friendly Group(★5)',
5205+
title: '081. Friendly Group(★5)',
5206+
},
5207+
{
5208+
id: 'typical90_cb',
5209+
contest_id: 'typical90',
5210+
problem_index: '080',
5211+
name: "Let's Share Bit(★6)",
5212+
title: "080. Let's Share Bit(★6)",
5213+
},
5214+
{
5215+
id: 'typical90_ca',
5216+
contest_id: 'typical90',
5217+
problem_index: '079',
5218+
name: 'Two by Two(★3)',
5219+
title: '079. Two by Two(★3)',
5220+
},
5221+
{
5222+
id: 'typical90_bz',
5223+
contest_id: 'typical90',
5224+
problem_index: '078',
5225+
name: 'Easy Graph Problem(★2)',
5226+
title: '078. Easy Graph Problem(★2)',
5227+
grade: 'Q5',
5228+
},
5229+
{
5230+
id: 'typical90_n',
5231+
contest_id: 'typical90',
5232+
problem_index: '014',
5233+
name: 'We Used to Sing a Song Together(★3)',
5234+
title: '014. We Used to Sing a Song Together(★3)',
5235+
grade: 'Q3',
5236+
},
5237+
{
5238+
id: 'typical90_m',
5239+
contest_id: 'typical90',
5240+
problem_index: '013',
5241+
name: 'Passing(★5)',
5242+
title: '013. Passing(★5)',
5243+
grade: 'Q2',
5244+
},
5245+
{
5246+
id: 'typical90_l',
5247+
contest_id: 'typical90',
5248+
problem_index: '012',
5249+
name: 'Red Painting(★4)',
5250+
title: '012. Red Painting(★4)',
5251+
grade: 'Q3',
5252+
},
5253+
{
5254+
id: 'typical90_k',
5255+
contest_id: 'typical90',
5256+
problem_index: '011',
5257+
name: 'Gravy Jobs(★6)',
5258+
title: '011. Gravy Jobs(★6)',
5259+
grade: 'D1',
5260+
},
5261+
{
5262+
id: 'typical90_j',
5263+
contest_id: 'typical90',
5264+
problem_index: '010',
5265+
name: 'Score Sum Queries(★2)',
5266+
title: '010. Score Sum Queries(★2)',
5267+
grade: 'Q4',
5268+
},
5269+
{
5270+
id: 'typical90_i',
5271+
contest_id: 'typical90',
5272+
problem_index: '009',
5273+
name: 'Three Point Angle(★6)',
5274+
title: '009. Three Point Angle(★6)',
5275+
grade: 'Q1',
5276+
},
5277+
{
5278+
id: 'typical90_h',
5279+
contest_id: 'typical90',
5280+
problem_index: '008',
5281+
name: 'AtCounter(★4)',
5282+
title: '008. AtCounter(★4)',
5283+
grade: 'Q2',
5284+
},
5285+
{
5286+
id: 'typical90_g',
5287+
contest_id: 'typical90',
5288+
problem_index: '007',
5289+
name: 'CP Classes(★3)',
5290+
title: '007. CP Classes(★3)',
5291+
grade: 'Q4',
5292+
},
5293+
{
5294+
id: 'typical90_f',
5295+
contest_id: 'typical90',
5296+
problem_index: '006',
5297+
name: 'Smallest Subsequence(★5)',
5298+
title: '006. Smallest Subsequence(★5)',
5299+
grade: 'Q1',
5300+
},
5301+
{
5302+
id: 'typical90_e',
5303+
contest_id: 'typical90',
5304+
problem_index: '005',
5305+
name: 'Restricted Digits(★7)',
5306+
title: '005. Restricted Digits(★7)',
5307+
grade: 'D4',
5308+
},
5309+
{
5310+
id: 'typical90_d',
5311+
contest_id: 'typical90',
5312+
problem_index: '004',
5313+
name: 'Cross Sum(★2)',
5314+
title: '004. Cross Sum(★2)',
5315+
grade: 'Q4',
5316+
},
5317+
{
5318+
id: 'typical90_c',
5319+
contest_id: 'typical90',
5320+
problem_index: '003',
5321+
name: 'Longest Circular Road(★4)',
5322+
title: '003. Longest Circular Road(★4)',
5323+
grade: 'Q1',
5324+
},
5325+
{
5326+
id: 'typical90_b',
5327+
contest_id: 'typical90',
5328+
problem_index: '002',
5329+
name: 'Encyclopedia of Parentheses(★3)',
5330+
title: '002. Encyclopedia of Parentheses(★3)',
5331+
grade: 'Q3',
5332+
},
5333+
{
5334+
id: 'typical90_a',
5335+
contest_id: 'typical90',
5336+
problem_index: '001',
5337+
name: 'Yokan Party(★4)',
5338+
title: '001. Yokan Party(★4)',
5339+
grade: 'Q2',
5340+
},
51375341
{
51385342
id: 'past18_a',
51395343
contest_id: 'past18-open',

src/lib/utils/contest_table_provider.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,38 @@ export class JOIFirstQualRoundProvider extends ContestTableProviderBase {
308308
}
309309
}
310310

311+
export class Typical90Provider extends ContestTableProviderBase {
312+
protected setFilterCondition(): (taskResult: TaskResult) => boolean {
313+
return (taskResult: TaskResult) => {
314+
if (classifyContest(taskResult.contest_id) !== this.contestType) {
315+
return false;
316+
}
317+
318+
return taskResult.contest_id === 'typical90';
319+
};
320+
}
321+
322+
getMetadata(): ContestTableMetaData {
323+
return {
324+
title: '競プロ典型 90 問',
325+
abbreviationName: 'typical90',
326+
};
327+
}
328+
329+
getDisplayConfig(): ContestTableDisplayConfig {
330+
return {
331+
isShownHeader: false,
332+
isShownRoundLabel: false,
333+
roundLabelWidth: '', // No specific width for task index in Typical90
334+
isShownTaskIndex: true,
335+
};
336+
}
337+
338+
getContestRoundLabel(contestId: string): string {
339+
return '';
340+
}
341+
}
342+
311343
/**
312344
* A class that manages individual provider groups
313345
* Manages multiple ContestTableProviders as a single group,
@@ -459,6 +491,15 @@ export const prepareContestProviderPresets = () => {
459491
buttonLabel: 'JOI 一次予選',
460492
ariaLabel: 'Filter JOI First Qualifying Round',
461493
}).addProvider(ContestType.JOI, new JOIFirstQualRoundProvider(ContestType.JOI)),
494+
495+
/**
496+
* Single group for Typical 90 Problems
497+
*/
498+
Typical90: () =>
499+
new ContestTableProviderGroup(`競プロ典型 90 問`, {
500+
buttonLabel: '競プロ典型 90 問',
501+
ariaLabel: 'Filter Typical 90 Problems',
502+
}).addProvider(ContestType.TYPICAL90, new Typical90Provider(ContestType.TYPICAL90)),
462503
};
463504
};
464505

@@ -468,6 +509,7 @@ export const contestTableProviderGroups = {
468509
fromAbc212ToAbc318: prepareContestProviderPresets().ABC212ToABC318(),
469510
dps: prepareContestProviderPresets().dps(), // Dynamic Programming (DP) Contests
470511
joiFirstQualRound: prepareContestProviderPresets().JOIFirstQualRound(),
512+
typical90: prepareContestProviderPresets().Typical90(),
471513
};
472514

473515
export type ContestTableProviderGroups = keyof typeof contestTableProviderGroups;

0 commit comments

Comments
 (0)