Skip to content

Fix problem 61 checker to expect single-integer answer (fixes #186) - #190

Open
siddharthachatterjee wants to merge 1 commit into
FrontierCS:mainfrom
siddharthachatterjee:fix-problem-61-checker
Open

Fix problem 61 checker to expect single-integer answer (fixes #186)#190
siddharthachatterjee wants to merge 1 commit into
FrontierCS:mainfrom
siddharthachatterjee:fix-problem-61-checker

Conversation

@siddharthachatterjee

Copy link
Copy Markdown

Summary

Fixes issue #186.

Previous algorithmic/problems/61/check.cpp first parsed participant output d as number of segments followed by d (l, r) pairs, while statement and answer files expect a single integer output instead of listing of segments.

Fixes by reading single long long participant_score per test_case, checking if this matches ref_score. Additionally, simplified formulas for ratio and unbounded_ratio as participant_score and ref_score are guaranteed to match at that point in execution.

Type of Change

  • New research problem
  • New algorithmic problem
  • New Frontier-CS 2.0 problem
  • Bug fix
  • Documentation update
  • Other:

Testing

  • First compiled check.cpp against judge/include/testlib.h
  • Checked that original checker rejected correct sample output of 3 6 with error provided in issue description
  • Confirmed that the new checker still rejects both under- and over-claim
  • Ran the fixed checker against all 57 archived testdata/*.in files, feeding .ans back as the "participant" output resulting in all 57 pass.

Checklist

  • Code follows the project structure and conventions
  • Self-review completed
  • [N/A] Documentation updated (if applicable)

CI Validation (for new problems)

N/A, only edited check.cpp

When adding new problems, CI will automatically validate that your reference solution achieves score > 0.

  • Algorithmic problems: Include reference.cpp in your problem directory
  • Research problems: Include reference.py (or reference.cpp if language: cpp in config.yaml)
  • 2.0 problems: Include reference.py unless the problem config declares another language

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