@@ -17,7 +17,7 @@ import {
17
17
combineTableColorList ,
18
18
} from "../../utils/TableColor" ;
19
19
import { ProblemLink } from "../../components/ProblemLink" ;
20
- import { ContestLink } from "../../components/ContestLink" ;
20
+ import { ContestLink , getRatedTarget } from "../../components/ContestLink" ;
21
21
import ProblemModel from "../../interfaces/ProblemModel" ;
22
22
import { SubmitTimespan } from "../../components/SubmitTimespan" ;
23
23
import { RatingInfo } from "../../utils/RatingInfo" ;
@@ -36,9 +36,11 @@ interface Props {
36
36
userRatingInfo : RatingInfo ;
37
37
}
38
38
39
- const getProblemHeaderAlphabetFromTitle = ( problem : MergedProblem ) => {
39
+ const getProblemHeaderAlphabet = ( problem : MergedProblem , contest : Contest ) => {
40
40
const list = problem . title . split ( "." ) ;
41
- return list . length === 0 ? "" : list [ 0 ] ;
41
+ if ( list . length === 0 ) return "" ;
42
+ if ( list [ 0 ] === "H" && getRatedTarget ( contest ) < 2000 ) return "Ex" ;
43
+ return list [ 0 ] ;
42
44
} ;
43
45
44
46
const AtCoderRegularTableSFC : React . FC < Props > = ( props ) => {
@@ -80,7 +82,7 @@ const AtCoderRegularTableSFC: React.FC<Props> = (props) => {
80
82
} ) ;
81
83
const problemStatus = new Map (
82
84
problemStatusList . map ( ( status ) => {
83
- const alphabet = getProblemHeaderAlphabetFromTitle ( status . problem ) ;
85
+ const alphabet = getProblemHeaderAlphabet ( status . problem , contest ) ;
84
86
return [ alphabet , status ] ;
85
87
} )
86
88
) ;
@@ -107,11 +109,17 @@ const AtCoderRegularTableSFC: React.FC<Props> = (props) => {
107
109
) ;
108
110
109
111
const headerList = props . contests
110
- . flatMap ( ( contest ) => props . contestToProblems . get ( contest . id ) ?? [ ] )
111
- . map ( ( problem ) => getProblemHeaderAlphabetFromTitle ( problem ) )
112
+ . flatMap ( ( contest ) =>
113
+ ( props . contestToProblems . get ( contest . id ) ?? [ ] ) . map ( ( problem ) =>
114
+ getProblemHeaderAlphabet ( problem , contest )
115
+ )
116
+ )
112
117
. filter ( ( alphabet ) => alphabet . length > 0 ) ;
113
118
114
- const header = Array . from ( new Set ( headerList ) ) . sort ( ) ;
119
+ let header = Array . from ( new Set ( headerList ) ) ;
120
+ if ( header . includes ( "Ex" ) )
121
+ header = header . filter ( ( c ) => c != "Ex" ) . concat ( "Ex" ) ;
122
+
115
123
return (
116
124
< Row className = "my-4" >
117
125
< h2 > { props . title } </ h2 >
0 commit comments