Skip to content

Fix #205: drop problem 23's unchecked accept for Tid % 100 == 0 - #210

Merged
joyemang33 merged 1 commit into
FrontierCS:mainfrom
whuang369:fix/205-problem-23-tid-shortcut
Nov 1, 2026
Merged

joyemang33 merged 1 commit into
FrontierCS:mainfrom
whuang369:fix/205-problem-23-tid-shortcut

Conversation

@whuang369

@whuang369 whuang369 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

check_Tid() returned ok Test 0. for any Tid divisible by 100 before the submitted A=B program ran, so even an empty program scored 100 on such a test. At c7ec558 the only tests were Tid 0, 100 and 200, which made the whole problem free. None of the 16 released test ids on main is a multiple of 100, so current scores are not affected.

Tid % 100 picks the test set. dict maps 0 to 20 to themselves and anything else to 0, but work() has only 17 generators, and generator 0 is empty. So 0 got the free accept, 17 to 20 indexed past the end of vf (undefined behavior), and 21 to 99 ran no test strings and printed Ratio: nan.

  • Remove the shortcut.
  • work() fails with _fail (a data error) when Tid % 100 selects no generator.
  • validate_test() fails with _fail when a test generates no test strings, so no test can pass without running the program.
  • Remove the Scoring paragraph in statement.txt that documented the shortcut.

The released tests (Tid % 100 in 1 to 16) are unchanged: the old and new checkers give byte-identical output on all 16 of them for 8 programs (empty, a=b, the reference program from the .ans files and 5 archived solutions).

Verified in the frontier-cs-judge image (g++ 11.4, -O2 -std=gnu++17) and with g++ 15.2: all 33 tests in the new algorithmic/tests/test_problem23.py pass. On main, the 17 that cover Tid % 100 == 0 and the ids without a test set fail, and the 16 released-test cases pass.

Relation to #207: #207 also removes the shortcut, but fills set 0 with sets 1 and 2, so Tid % 100 == 0 and 21 to 99 become real tests instead of data errors. It does not change statement.txt, which still documents the shortcut, and Tid % 100 in 17 to 20 still indexes past vf. Both PRs add algorithmic/tests/test_problem23.py, so only one can merge as is.

Fixes #205.

…== 0

check_Tid() returned "ok Test 0." for any Tid divisible by 100 before
the submitted A=B program ran, so even an empty program scored 100 on
such a test. At c7ec558 the only tests were Tid 0, 100 and 200, which
made the whole problem free. None of the 16 released test ids on main
is a multiple of 100, so current scores are not affected.

Tid % 100 picks the test set. dict maps 0 to 20 to themselves and
anything else to 0, but work() has only 17 generators, and generator 0
is empty. So 0 got the free accept, 17 to 20 indexed past the end of
vf (undefined behavior), and 21 to 99 ran no test strings and printed
"Ratio: nan".

- Remove the shortcut.
- work() fails with _fail (a data error) when Tid % 100 selects no
  generator.
- validate_test() fails with _fail when a test generates no test
  strings, so no test can pass without running the program.
- Remove the Scoring paragraph in statement.txt that documented the
  shortcut.

The released tests (Tid % 100 in 1 to 16) are unchanged: the old and
new checkers give byte-identical output on all 16 of them for 8
programs (empty, "a=b", the reference program from the .ans files and
5 archived solutions).

Tested with g++ 15.2 (-O2 -std=gnu++17): all 33 tests in the new
algorithmic/tests/test_problem23.py pass. On main, the 17 that cover
Tid % 100 == 0 and the ids without a test set fail, and the 16
released-test cases pass.

Fixes FrontierCS#205.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joyemang33
joyemang33 merged commit 59687e5 into FrontierCS:main Nov 1, 2026
3 of 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.

Problem 23 (A=B): checker returns ok without running the program when the test id is a multiple of 100

2 participants