Skip to content

Problem 213: Checker output format is inconsistent with the statement and test answers #185

Description

@weiwch

Description

Problem 213 has an output-format mismatch between the problem statement and the checker.

The statement requires each operation to contain three integers:

l r direction

The sample output and the provided answer files use the same three-integer format. However, algorithmic/problems/213/chk.cc reads only two integers for each operation:

x=ouf.readInt(); y=x+m-1; z=ouf.readInt();

As a result, for a statement-compliant operation such as l r direction, the checker interprets r as direction and will normally reject the output as illegal.

Impact

This mismatch makes it impossible for a submission that follows the documented output format to receive any score. The first ordinary three-integer operation is misparsed, the right endpoint is checked as if it were the direction, and the checker terminates with a wrong-answer verdict before validating the constructed sequence or calculating a score.

Because the two-integer format actually expected by the checker is neither documented nor used by the sample and answer files, contestants cannot produce a scoring submission from the repository's published specification.

There are also several related inconsistencies in the problem package:

  • testdata/1.ans selects x = 3 for an input with n = 2 and provides an operation without a direction value.
  • The statement says that x and m are printed on the first line, while the sample prints them on separate lines.
  • The statement specifies a 5-second time limit, but config.yaml specifies 2 seconds.

Suggested changes

  1. Update the checker to read all three operation fields:

    x = ouf.readInt();
    y = ouf.readInt();
    z = ouf.readInt();

    Then keep the existing interval-length, bounds, and direction validation.

  2. Replace testdata/1.ans with a valid answer, for example:

    2
    1
    1 2 0
    

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