Factorial trailing-zero judge accepts a solution truncated at 25

未关闭
#859 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@dots0101 已经在做这个了。

开始于 2026年11月25日。

  • #860 来自 @dots0101 —— 未关闭

评估

难度
3/5
预计耗时
半天
新手友好度
20/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
json, nodejs, python
领域
testing-qa

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Rust
星标
236
派生
153
平均合并
1 天 9 小时
30 天内合并 PR
187

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sysprog21/codetrial 的其他 Issue

查看 sysprog21/codetrial 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。