> For the complete documentation index, see [llms.txt](https://xgn.gitbook.io/hhsoj-essential-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xgn.gitbook.io/hhsoj-essential-doc/problem-setup/the-problem.json-file.md).

# The problem.json file

Manifest!

The problem.json file contains the basic information of a problem. It is placed under the problem folder.

{% hint style="info" %}
You need basic [Json](https://en.wikipedia.org/wiki/JSON) skills before continuing. Google it if you don't know.
{% endhint %}

## The Problem Attribute

The file itself is a object, so start it by writing a pair of `{}`

| Element | Type      | Explanation                                                                              | Example       |
| ------- | --------- | ---------------------------------------------------------------------------------------- | ------------- |
| name    | String    | Name                                                                                     | "A+B Problem" |
| tl      | Integer   | Time Limit per test in ms                                                                | 1000          |
| ml      | Integer   | Memory Limit per test in KB                                                              | 262144        |
| ver     | Integer   | <p>the current problem version.</p><p>Should be positive</p>                             | 1             |
| diff    | Float     | \[WIP]The difficulty of the problem                                                      | 1.0           |
| tests   | TestMap   | The subtask detail                                                                       | -             |
| order   | String\[] | <p>The order of the subtasks to be judged</p><p>Should represent a subtask by its ID</p> | -             |

## The TestMap

TestMap contains information for subtasks. Each key maps to the id of a subtask, each value maps to the configuration for that subtask. Each subtask has the following arguments:

| Element     | Type      | Explanation                                                                                                                                                                                    | Example |
| ----------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| scheme      | String    | <p>Should be one from "min" "max" "sum" "avg"</p><p>The marking scheme for the subtask</p>                                                                                                     | "min"   |
| requirement | String\[] | <p>All subtasks in requirement should be passed in order to test this subtask.</p><p>Represent subtasks by their ID.</p><p>All subtasks in requirement should be judged earlier than this.</p> | \[]     |
| toEnd       | Boolean   | <p>Declares that all testcases in this subtask should be tested</p><p>Often used when scheme is "sum" "avg"</p>                                                                                | true    |
| score       | Float     | <p>the <a href="/hhsoj-essential-doc/problem-setup/dealing-with-scoring.md#whats-the-score-of-a-submission">base score ratio</a> of this subtask. </p><p>Expected: 0.0\~1.0</p>                | 0.6     |

## Example Problem.json

```javascript
{
	"name":"Test Problem",
	"tl":1000,
	"ml":262144,
	"ver":7,
	"order":["easy","hard"],
	"diff":2.0,
	"tests":{
		"easy":{
			"scheme":"min",
			"requirement:":[],
			"toEnd":true,
			"score":0.6
		},
		"hard":{
			"scheme":"sum",
			"requirement":["easy"],
			"toEnd":false,
			"score":0.2
		}
	}
}

```

{% hint style="info" %}
Don't forget that the **ID of the subtask** is the name of the subtask folder!
{% endhint %}
