Skip to content

Conversation

@tobiichi3227
Copy link
Collaborator

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

@tobiichi3227 tobiichi3227 changed the title feat: contest icpc mode feat(contest): ICPC mode Jan 20, 2026
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant