Skip to content

Problem 210 checker rejects its own testdata (readLong(0, 200) vs. v up to 250) #181

Description

@xiawubing

Summary

algorithmic/problems/210/chk.cc reads each base's defense and value with hard bounds:

long long d = inf.readLong(0LL, 10LL);
long long v = inf.readLong(0LL, 200LL);     // lines 95-96 (blue) and 110-111 (red)

The shipped inputs testdata/4.in9.in contain v values up to 250 (blue and red sides),
so testlib fails while parsing the input file, before any contestant output is read.

Effect

Six of the ten cases are unjudgeable for every submission. The judge records
FAIL Integer 243 violates the range [0,200] (in.txt) (243 / 228 / 224 / 205 / 207 / 204 for
cases 4-9) and scores the case 0. Combined with case 10, which nobody solves, the effective cap
on this problem is about 0.30; the best archived submission scored 0.187.

Verification

Running the checker on every shipped input with an empty output file:

case 1-3, 10: points 0.0 ... BestPossible: <sum of red v>
case 4:       FAIL Integer 243 violates the range [0, 200] (4.in)
case 5:       FAIL Integer 228 ...   case 6: 224   case 7: 205   case 8: 207   case 9: 204

The .ans files equal the checker's own best_possible (sum of red v) on all ten cases, so
nothing else in the scoring needs to change. Re-judging one archived submission with loosened
bounds turns cases 4-9 from FAIL into 0.519 / 0.015 / 0.045 / 0 / 0.020 / 0 while cases
1-3 and 10 are unchanged.

Suggested fix

Loosen the per-base bounds on g, c, d, v (the statement gives no range for any of them;
c already reaches 2000, the exact upper bound of its guard, and d/v on the blue side are not even
used):

long long g = inf.readLong(0LL, 1000000000LL);
long long c = inf.readLong(0LL, 1000000000LL);
long long d = inf.readLong(0LL, 1000000000LL);
long long v = inf.readLong(0LL, 1000000000LL);

Optionally document the observed ranges (d ≤ 10, v ≤ 250) in statement.txt next to the
existing "Constraints (from released datasets)".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions