Factorial trailing-zero judge accepts a solution truncated at 25

Open
#859 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@dots0101 is already working on this.

Since Nov 25, 2026.

  • #860 by @dots0101 — open

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
  1. At the tested source revision, evaluate the expression above for the five inputs 3, 5, 0, 25, and 100. It matches every expected value.
  2. Try 125. The expression returns 30, while 125! has 25 + 5 + 1 = 31 trailing zeroes.
  3. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sysprog21/codetrial

All issues in sysprog21/codetrial

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.