agent_p's blog

By agent_p, history, 2 weeks ago, In English

I'm trying to create a Hello World type problem on polygon that requires only printing a statement as solution. So the problem will not have any input. Similar to the problem 1812A

I'm not finding any guide on setting such a problem. Like what will the test be.

Please help me with it.

  • Vote: I like it
  • +5
  • Vote: I do not like it

»
2 weeks ago, # |
  Vote: I like it +6 Vote: I do not like it

Go to the Tests section in Polygon and add a test case where the expected output is what participants need to produce to receive an "Accepted" verdict.

If you want multiple specific outputs to be accepted, for example both agent_p and helloworld123, you will need to create a custom checker in the Checker section of Polygon.

Example code below:

Code
  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How can I keep the input of the test blank?

»
2 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

I've prepared output-only problems multiple times.

In the input section I usually write single sentence "No input" or "Reading data is not required" and then set up tests like that

Multiple tests in case a solution is not deterministic.

Putting "NO INPUT" and disincentivising participants from reading it might be even better than a blank input. If you really want to make a test with empty input you can uncheck "Tests well-formed" and then "Add Test" > "from the files" and upload empty file.

If you want to include a sample into problem statement to show output format, but at the same time you want to hide the real answer to the problem you can

  1. "Edit" a test

  2. check "Use in statements"

  3. "If you want to specify custom content of input or output data for statements click here"

  4. provide statement-only output

  5. uncheck "Verify output for statements"

Also you can implement custom checker that will directly compare solution output to the right hardcoded answer.