File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ export interface MergedProblem extends Problem {
4343 readonly Difficulty ?: Difficulty ;
4444 /** experimental difficulty かどうか */
4545 readonly Augmented ?: boolean ;
46+ /** コンテスト中の問題インデックス */
47+ readonly Index ?: number ;
4648}
4749
4850/** コンテスト情報,解答状況,およびショートコード情報をマージした問題 */
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {
2828import { ProblemDetailModal } from '../../components/ProblemDetailModal' ;
2929import { useNavigate } from 'react-router' ;
3030import { useSearchParams } from 'react-router-dom' ;
31+ import { getHeader } from '../../utils' ;
3132
3233export type FilterState = 'All' | 'Only Trying' | 'Only AC' ;
3334
@@ -115,9 +116,11 @@ export const ListTable: React.FC<Props> = (props) => {
115116 title : string ,
116117 row : RankingMergedProblem
117118 ) {
119+ const header =
120+ row . Index !== undefined ? `${ getHeader ( row . Index ) } . ` : '' ;
118121 return (
119122 < ProblemLink
120- problemTitle = { title }
123+ problemTitle = { ` ${ header } ${ title } ` }
121124 problemNo = { row . No as ProblemNo }
122125 level = { row . Level }
123126 problemLinkColorMode = { problemLinkColorMode }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import { ContestLink } from '../../components/ContestLink';
2626import { ProblemTypeIconSpanWithName } from '../../components/ProblemTypeIcon' ;
2727import { TabbedDifficultyChart } from './TabbedDifficultyChart' ;
2828import { useResetScroll } from '../../utils/UseResetScroll' ;
29+ import { getHeader } from '../../utils' ;
2930
3031const initialUniversalState = {
3132 problem : { } as Problem ,
@@ -96,6 +97,11 @@ export const ProblemDetailPage: React.FC = () => {
9697
9798 const contestId = problemContestMap . get ( problemId ) ;
9899 const contest = contestId ? contestMap . get ( contestId ) : undefined ;
100+ const header = contest
101+ ? `${ getHeader (
102+ contest . ProblemIdList . findIndex ( ( pid ) => pid === problem . ProblemId )
103+ ) } . `
104+ : '' ;
99105
100106 const shortestRankingProblem = golferProblemMap . get ( problemId ) ;
101107 const pureShortestRankingProblem = golferPureProblemMap . get ( problemId ) ;
@@ -157,7 +163,7 @@ export const ProblemDetailPage: React.FC = () => {
157163 < th > Title</ th >
158164 < td >
159165 < ProblemLink
160- problemTitle = { problem . Title }
166+ problemTitle = { ` ${ header } ${ problem . Title } ` }
161167 problemNo = { problem . No as ProblemNo }
162168 level = { problem . Level }
163169 problemLinkColorMode = { colorMode }
Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ export const mergeSolveStatus = (
2727 } ) ,
2828 new Map < ContestId , ExtendedContest > ( )
2929 ) ;
30+ const problemIndexMap = contests . reduce ( ( map , contest ) => {
31+ contest . ProblemIdList . forEach ( ( pid , i ) => {
32+ if ( pid < 0 ) return ;
33+ map . set ( pid , i ) ;
34+ } ) ;
35+ return map ;
36+ } , new Map < ProblemId , number > ( ) ) ;
3037 const mergedProblems = problems . map (
3138 ( problem ) : MergedProblem => {
3239 const DateNum = Date . parse ( problem . Date as string ) ;
@@ -66,6 +73,7 @@ export const mergeSolveStatus = (
6673 SolveStatus,
6774 Difficulty,
6875 Augmented,
76+ Index : undefined ,
6977 } ;
7078 }
7179 // assert コンテスト情報あり
@@ -78,6 +86,7 @@ export const mergeSolveStatus = (
7886 SolveStatus : ProblemSolveStatus . Trying ,
7987 Difficulty,
8088 Augmented,
89+ Index : problemIndexMap . get ( problem . ProblemId ) ,
8190 } ;
8291 }
8392 // assert AC 済み
@@ -102,6 +111,7 @@ export const mergeSolveStatus = (
102111 SolveStatus,
103112 Difficulty,
104113 Augmented,
114+ Index : problemIndexMap . get ( problem . ProblemId ) ,
105115 } ;
106116 }
107117 ) ;
You can’t perform that action at this time.
0 commit comments