-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(be): implement contest participant standings #1233
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Jaehyeon1020
approved these changes
Jan 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rankings
를 표시할 때 지금은 많은 문제를 해결한 유저 순서대로 유저 정보만 나열이 되는데, 실제 몇 등인지 랭크를 같이 표시해주는 방법도 생각해보면 좋을 것 같습니다!
gyunseo
changed the title
feat(be): implement contest participant rank
feat(be): implement contest participant standings
Jan 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
/contest/{contest_id}
Path로groupId
query와 함께 GET 요청을 보냈을 때, contest detail뿐만 아니라 contest participant의 standing을 함께 반환합니다.Additional context
@aintbe 님과 Contest의 점수 계산 방식에 대해 논의를 해봤습니다. (점수 계산 issue는 User가 Contest에서 Problem을 풀었을 때, ContestProblem에 점수를 배정하고, Contest에서 AC 개수에 따른 점수 계산하는 feature. #1238 에서 다룹니다.)
일단 잠정적으로는 LeetCode의 방식을 따라 가기로 했습니다.
리트코드 방식: ICPC + 코드포스
푼 문제의 score 합산해서 정렬
score가 같으면 페널티 역순으로 정렬
페널티 = 마지막으로 푼 문제의 소요 시간 + 틀린 문제 수 * 5분
그래서 일단은
ContestRecord
table에 User가 풀어서 얻은 점수인score
라는 field를 추가했습니다.우선은 score가 높은 순으로 정렬하고, 만약 score가 같을 시에는
totalPenalty
(패널티)가 적은 사람이 패널티가 높은 사람보다 순위가 좋도록 (standing의 절대치가 작다라는 말) 했습니다.closes #1203
Before submitting the PR, please make sure you do the following
fixes #123
).