Skip to content

Fix #212: draw problem 69's student pairs from a secret per-test seed - #214

Merged
joyemang33 merged 1 commit into
FrontierCS:mainfrom
whuang369:fix/212-problem-69-pairs
Nov 20, 2026
Merged

joyemang33 merged 1 commit into
FrontierCS:mainfrom
whuang369:fix/212-problem-69-pairs

Conversation

@whuang369

Copy link
Copy Markdown
Contributor

The statement says each student's pair (u, v) is drawn independently and uniformly from [1, n], but the interactor computed it from the round number (u = j % n + 1, v = (37j + 13) % n + 1), the same on every test. The program in the issue prints the 1000 shortest distinct words and replays that formula without reading a power. It was accepted on every test at 67.29 points.

Each testdata/N.ans keeps the reference length on its first line and now holds a distinct secret 63-bit seed on a second line, drawn with Python's secrets.randbits(63). The interactor reads the seed and draws all q pairs from std::mt19937_64(seed) before it reads any word, u then v for each student. Raw values at or above the largest multiple of n are redrawn, so every index is exactly uniform. As in problem 59 (#211), mt19937_64 is fixed by the C++ standard, so a seed gives the same pairs with any compiler, and a missing seed is a judge failure (_fail). Wrong-answer messages no longer name the student's pair, and they print powers with %lld instead of testlib's toString(), which GCC 15 miscompiles to "0" there. The statement, the protocol and the scoring are unchanged. Like the other hidden answer files, the seeds are public in this repository; the fix removes the answer that needs no outside data.

Honest scores do not change. In the judge image (g++ 11.4), every solution in algorithmic/solutions/69 scores the same on test 1 against both interactors. The five that score above 0 (gpt5.2.cpp and gpt5.2_1-3.cpp at 30.4-30.8, gpt5_high.cpp at 19.1-19.3) score the same on all 10 tests, and so does the archived GPT-5.6-sol (Codex) solution from trial frontier-cs-algorithm-69__5Sf5JNL, at 60.03-60.06.

The new algorithmic/tests/test_problem69.py rebuilds the pairs with a pure-Python mt19937_64, checked against the 10000th output the C++ standard requires, so the expected pairs do not come from the compiler's library. Its 29 tests check that:

  • the replay from the issue scores 0 on all 10 tests;
  • the interactor asks exactly the seeded pairs and scores a correct transcript as before;
  • the pairs do not depend on the words, and the order of a pair matters;
  • the pairs are pinned by hash and spread over the index range;
  • neither the seed nor the student's pair reaches the output or the log.

All 29 pass with g++ 11.4 in the judge image and with g++ 15.2. On main, 28 of them fail. The rest of algorithmic/tests passes in the judge image (246 passed). The 4 errors in test_problem36_239.py also occur on main, because that file reads commit 65117c99, which is not in this repository.

Fixes #212.

Summary

Please read CONTRIBUTING.md before submitting.

Type of Change

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

Testing

Checklist

  • Code follows the project structure and conventions
  • Self-review completed
  • Documentation updated (if applicable)

CI Validation (for new problems)

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

…-test seed

The statement says each student's pair (u, v) is drawn independently
and uniformly from [1, n], but the interactor computed it from the round
number (u = j % n + 1, v = (37j + 13) % n + 1), the same on every test.
The program in the issue prints the 1000 shortest distinct words and
replays that formula without reading a power. It was accepted on every
test at 67.29 points.

Each testdata/N.ans keeps the reference length on its first line and
now holds a distinct secret 63-bit seed on a second line, drawn with
Python's secrets.randbits(63). The interactor reads the seed and draws
all q pairs from std::mt19937_64(seed) before it reads any word, u then
v for each student. Raw values at or above the largest multiple of n
are redrawn, so every index is exactly uniform. As in problem 59
(FrontierCS#211), mt19937_64 is fixed by the C++ standard, so a seed gives the
same pairs with any compiler, and a missing seed is a judge failure
(_fail). Wrong-answer messages no longer name the student's pair, and
they print powers with %lld instead of testlib's toString(), which
GCC 15 miscompiles to "0" there. The statement, the protocol and the
scoring are unchanged. Like the other hidden answer files, the seeds
are public in this repository; the fix removes the answer that needs
no outside data.

Honest scores do not change. In the judge image (g++ 11.4), every
solution in algorithmic/solutions/69 scores the same on test 1 against
both interactors. The five that score above 0 (gpt5.2.cpp and
gpt5.2_1-3.cpp at 30.4-30.8, gpt5_high.cpp at 19.1-19.3) score the same
on all 10 tests, and so does the archived GPT-5.6-sol (Codex) solution
from trial frontier-cs-algorithm-69__5Sf5JNL, at 60.03-60.06.

The new algorithmic/tests/test_problem69.py rebuilds the pairs with a
pure-Python mt19937_64, checked against the 10000th output the C++
standard requires, so the expected pairs do not come from the
compiler's library. Its 29 tests check that:
- the replay from the issue scores 0 on all 10 tests;
- the interactor asks exactly the seeded pairs and scores a correct
  transcript as before;
- the pairs do not depend on the words, and the order of a pair
  matters;
- the pairs are pinned by hash and spread over the index range;
- neither the seed nor the student's pair reaches the output or the
  log.

All 29 pass with g++ 11.4 in the judge image and with g++ 15.2. On
main, 28 of them fail. The rest of algorithmic/tests passes in the judge
image (246 passed). The 4 errors in test_problem36_239.py also occur on
main, because that file reads commit 65117c99, which is not in this
repository.

Fixes FrontierCS#212.
@joyemang33
joyemang33 merged commit 61bfa6d into FrontierCS:main Nov 20, 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 69 interactor: each round's pair is a fixed function of the round number, so a program that ignores every power scores 67

2 participants