Factorial trailing-zero judge accepts a solution truncated at 25

Ouverte
#859 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@dots0101 y travaille déjà.

Depuis le 25/11/2026.

  • #860 par @dots0101 — ouverte

Évaluation

Difficulté
3/5
Temps estimé
Une demi-journée
Accessibilité débutants
20/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
json, nodejs, python
Domaine
testing-qa

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

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.

Langage dominant
Rust
Étoiles
236
Forks
153
Merge moyen
1 j 9 h
PR mergées (30 j)
187

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sysprog21/codetrial

Toutes les issues de sysprog21/codetrial

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.