Factorial trailing-zero judge accepts a solution truncated at 25
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- json, nodejs, python
- Domain
- testing-qa
Research direction
The judge entry for factorial-trailing-zeroes lives in problem-bank/judges.json, with a generated judge file and a package fixture that must be updated alongside it. Check that the expression n // 5 + n // 25 gets rejected once the cases 125 (expected 31) and 10000 (expected 2499) are added. Pull request #860 is already open against this issue and the author asked for assignment, so check that work is not duplicated before starting.
Written by the indexing model from the issue text.
Description
Observed behavior
The built-in judge for factorial-trailing-zeroes accepts n // 5 + n // 25 on all five of its test inputs. Starting at 125, that expression undercounts factors of five.
Expected behavior
The judge should reject an implementation that ignores higher powers of five within the stated input range (0–10,000).
Reproduction
- At the tested source revision, evaluate the expression above for the five inputs 3, 5, 0, 25, and 100. It matches every expected value.
- Try 125. The expression returns 30, while 125! has 25 + 5 + 1 = 31 trailing zeroes.
- Try 10,000. Even summing through 625 gives only 2,496. The correct answer is 2,000 + 400 + 80 + 16 + 3 = 2,499.
CodeTrial version
codetrial 0.1.0 (1ed2e26) locally. The judge data was independently rechecked at upstream source revision 925db68fffc8e1d89f928c0b4c28ae482befafed.
Environment
Windows, Python integer arithmetic against the problem-bank data, and Node.js for the targeted judge regression test.
Evidence and proposed fix
A local patch adds both cases, independently checks the expected values by counting factors in individual multiples of five, and updates the generated judge and package fixture. The targeted regression, generated-file checks and package golden check pass.
I'd like to take this issue and submit that fix. Please assign it to me (@dots0101) if the scope looks right.
- Dominant language
- Rust
- Stars
- 236
- Forks
- 153
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 187
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sysprog21/codetrial
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Unify Java harness validation error messagesPossibly taken @weichieh0204 claimed this today. Open
sysprog21/codetrial#872 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Inferred void class operations are never checked against the starter's return typePossibly taken @papaya0112 claimed this today. Open
sysprog21/codetrial#871 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Edge Thumbnail Store accepts a store that does not refresh a key on overwritePossibly taken @BOBOGUAGUA428 claimed this today. Open
sysprog21/codetrial#869 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in sysprog21/codetrial
Similar issues
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eliasstravik/herdr-projects#1605 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jlcodes99/cockpit-tools#3332 ·
Maintainers usually reply within 3 days
-
Cognito: the email MFA code (EMAIL_OTP challenge after a password flow) has 8 digits; AWS delivers 6Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#692 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
pamburus/hl#1779 · 1 comment ·
Maintainers usually reply within 1 day