Skip to content

Commit d251421

Browse files
committed
Change AHC rated to unrated
1 parent 8b30524 commit d251421

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

atcoder-problems-frontend/src/utils/ContestClassifier.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ export type ContestCategory = typeof ContestCategories[number];
2020

2121
export const AGC_001_START = 1468670400;
2222

23+
const isAhc = (contestId: string): boolean => {
24+
return Boolean(/^ahc\d{3}$/.exec(contestId));
25+
};
26+
2327
export const isRatedContest = (contest: Contest): boolean => {
2428
return (
25-
contest.rate_change !== "-" && contest.start_epoch_second >= AGC_001_START
29+
contest.rate_change !== "-" &&
30+
contest.start_epoch_second >= AGC_001_START &&
31+
!isAhc(contest.id)
2632
);
2733
};
2834

@@ -49,10 +55,6 @@ export const classifyContest = (contest: Contest): ContestCategory => {
4955
return "AGC";
5056
}
5157

52-
if (/^ahc\d{3}$/.exec(contest.id)) {
53-
return "AHC";
54-
}
55-
5658
if (isRatedContest(contest)) {
5759
return classifyOtherRatedContest(contest);
5860
}
@@ -67,6 +69,9 @@ export const classifyContest = (contest: Contest): ContestCategory => {
6769
return "JAG";
6870
}
6971

72+
if (isAhc(contest.id)) {
73+
return "AHC";
74+
}
7075
if (
7176
/(^Chokudai Contest||^HACK TO THE FUTURE|Asprova|Heuristics Contest)/.exec(
7277
contest.title

0 commit comments

Comments
 (0)