Skip to content

feat(contests): generic partial credit + new HireUp OA questions - #127

Merged
codenamed22 merged 3 commits into
mainfrom
feat/hireup-partial-credit
Aug 1, 2026
Merged

codenamed22 merged 3 commits into
mainfrom
feat/hireup-partial-credit

Conversation

@codenamed22

@codenamed22 codenamed22 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces the HireUp OA question set, extends its window to 90 minutes, and introduces partial credit that applies uniformly to every contest — not just HireUp.

Scoring (generic for all contests)

Every problem is worth 100 points. A submission scores:

round(100 * passedCount / totalCount)
  • Only a member's best submission per problem counts, so resubmitting improves a score rather than accumulating one.
  • Standings rank by total points, then solved count, then time/attempt penalty.
  • When everyone either passes all tests or none, ordering matches the previous accepted-only behaviour.
  • There is no per-test weighting and no contest-specific rubric — one rule, one code path.

Judge change

The judge previously stopped at the first failing test. It now runs the full test suite so partial credit reflects everything that actually passes. Compile errors still short-circuit, since no test can run.

HireUp OA

  • New questions: Driver Rebalancing Across City Corridors (prefix imbalance) and Best Dispatch Hub (weighted tree rerooting).
  • Duration extended from 60 to 90 minutes (8:00–9:30 PM IST, 1 August).
  • Python and C++ reference solutions added for both; the tree solution is iterative to avoid recursion limits at N = 2 * 10^5.

Database

Two migrations, both applied to the configured database with no drift:

  • 20260801090000_add_contest_partial_credit — adds ContestParticipant.score, backfilling existing rows from solvedCount * 100 so finalized contests keep their ordering.
  • 20260801120000_simplify_contest_partial_credit — drops the per-test weighting columns once scoring became uniform.

ContestParticipant.score is retained so finalized standings keep their historical score.

Validation

  • 113 unit tests pass, including new coverage for best-attempt selection and scoring after a failed test.
  • tsc --noEmit, production build, and Prettier all pass.
  • Both reference solutions pass every sample, hidden, and maximum-size stress case in Python and C++.
  • prisma migrate diff reports no difference between the live database and the schema.

Reviewer note

StandingRow.lastAcAt is renamed to lastScoredAt: the tiebreaker now tracks the best scoring attempt, which may not be an accepted one.

@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shardup-site Ready Ready Preview Aug 1, 2026 10:56am

Every contest now scores with one rule instead of a HireUp-only rubric:
each problem is worth 100 points and a submission earns
round(100 * passedCount / totalCount) from its best attempt per problem.

- Drop per-test 'points' weighting and the derived earnedPoints /
  possiblePoints columns; score is computed from pass counts alone.
- Rename StandingRow.lastAcAt to lastScoredAt, since the tiebreaker now
  tracks the best scoring attempt rather than an accepted one.
- Add the migration that drops the now-unused weighting columns so the
  schema and migration history stay in sync.
@codenamed22 codenamed22 changed the title Add weighted partial credit to HireUp OA feat(contests): generic partial credit + new HireUp OA questions Aug 1, 2026
The chain stress test at N=200,000 made the expected answer 2.4 MB, above
the judge's 2 MB OUTPUT_LIMIT (lib/judge/piston.ts). Piston truncates at
that limit, so even a correct submission would have been marked wrong,
and the CI reference validator failed 2/8 tests on it.

- Cap Best Dispatch Hub at N <= 5*10^4 in both the constraints and the
  stress tests, which drops the largest answer to ~0.5 MB. An O(N^2)
  solution still times out at that size. Driver Rebalancing keeps
  N = 200,000 since it prints a single number.
- Give the validator an 8 MB spawnSync buffer. Node's 1 MB default
  silently truncated large answers and reported them as mismatches
  instead of surfacing the real problem.
@codenamed22
codenamed22 merged commit 1d31c51 into main Aug 1, 2026
4 checks passed
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