-
Notifications
You must be signed in to change notification settings - Fork 8
feat(contest): ICPC mode #203
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
base: v2.0
Are you sure you want to change the base?
Conversation
Penalty value, default set submit cd time to 1 secs. Show IOI Score Type in IOI Mode.
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.
Pull request overview
This PR introduces ICPC (ACM) contest mode to the platform, implementing the ICPC ranking algorithm alongside the existing IOI mode. It also makes the IOI 2013 ranking algorithm selectable, which previously existed but was not user-accessible.
Changes:
- Implemented ICPC scoring algorithm with penalty-based ranking (first AC time + penalties for wrong submissions)
- Added contest mode selector and penalty value configuration in contest management UI
- Added score type selector for problems in IOI mode (IOI2017 vs IOI2013)
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/static/templ/contests/scoreboard.html | Adds ICPC-style scoreboard rendering with AC count, penalty time display, and sorting logic for ICPC mode |
| src/static/templ/contests/proset.html | Conditionally hides score column in ICPC mode where only AC/not-AC matters |
| src/static/templ/contests/manage/pro.html | Adds UI for selecting problem score type (IOI2013/IOI2017) when managing contest problems |
| src/static/templ/contests/manage/general.html | Adds penalty value configuration field and dynamic UI updates based on contest mode |
| src/services/contests.py | Implements get_icpc_scores method with SQL query calculating ICPC scores and filtering invalid submissions |
| src/handlers/contests/scoreboard.py | Routes score calculation to ICPC or IOI algorithms based on contest mode |
| src/handlers/contests/manage/pro.py | Adds score type parameter handling and update action, fixes cache invalidation to use hdel instead of full cache deletion |
| src/handlers/contests/manage/general.py | Adds penalty_value parameter handling with validation and mode-specific defaults |
| migration/20251215000000_add_contest_penalty_value.py | Adds penalty_value column to contest table with default value of 20 minutes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8f3e13e to
0417eee
Compare
If two teams have the same number of problem solved and penalty, then the winner goes to the team of the less ID of their last accepted challenge.
This PR introduces a new contest mode, ICPC, with the primary change being the implementation of the ICPC ranking algorithm.
Additionally, it makes the IOI 2013 ranking algorithm optional.
Although this algorithm already existed in the codebase, it was not previously selectable