Блог пользователя agent_p

Автор agent_p, история, 3 недели назад, По-английски

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.

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
3 недели назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

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
»
3 недели назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

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.