2022-10-20 18:21:11 +08:00
|
|
|
# 示例题目
|
|
|
|
|
|
|
|
## 文件构成
|
|
|
|
|
|
|
|
```
|
|
|
|
.
|
|
|
|
├── config.json # 题目配置信息
|
2023-12-23 19:50:32 +08:00
|
|
|
├── description.md # (optional) 题目描述,必须通过 API 提交,使用 import 脚本时将读取该文件
|
2022-10-20 18:21:11 +08:00
|
|
|
├── data # 数据目录
|
|
|
|
│ ├── input # 输入数据
|
|
|
|
│ │ ├── (x).input # 第 x 组输入数据
|
|
|
|
│ │ └── ...
|
|
|
|
│ └── output # 输出数据
|
|
|
|
│ ├── (x).output # 第 x 组输出数据
|
|
|
|
│ └── ...
|
|
|
|
└── judge # 评测脚本目录
|
|
|
|
├── c.Makefile # (optional) 自定义评测脚本
|
|
|
|
├── prebuild.Makefile # (optional) 题目初始化脚本
|
2023-07-16 15:42:26 +08:00
|
|
|
└── ... # 其余可能用到的程序、脚本等
|
2022-10-20 18:21:11 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## 详细说明
|
|
|
|
|
|
|
|
### 题目配置信息
|
|
|
|
|
|
|
|
```json5
|
|
|
|
{
|
2023-12-23 19:50:32 +08:00
|
|
|
"Runtime": {
|
|
|
|
// 运行时配置
|
2022-10-20 18:21:11 +08:00
|
|
|
"TimeLimit": 1000, // 时间限制 (ms)
|
|
|
|
"MemoryLimit": 16, // 内存限制 (MB)
|
2023-07-16 15:42:26 +08:00
|
|
|
"NProcLimit": 1 // 进(线)程 限制
|
2022-10-20 18:21:11 +08:00
|
|
|
},
|
2023-12-23 19:50:32 +08:00
|
|
|
"Languages": [
|
|
|
|
// 支持的语言
|
2023-07-16 15:42:26 +08:00
|
|
|
// c 语言,使用自定义评测脚本,脚本为 ./judge/XYZ.Makefile
|
2022-10-20 18:21:11 +08:00
|
|
|
{"Lang": "c", "Type": "custom", "Script": "XYZ.Makefile", "Cmp": ""},
|
2023-07-16 15:42:26 +08:00
|
|
|
// c++ 语言,使用默认评测脚本,答案比对方式为 NCMP(testlib)
|
2022-10-20 18:21:11 +08:00
|
|
|
{"Lang": "cpp", "Type": "default", "Script": "", "Cmp": "NCMP"}
|
2023-12-23 19:50:32 +08:00
|
|
|
],
|
|
|
|
"Tasks": [
|
|
|
|
// 评测点信息
|
2023-07-16 15:42:26 +08:00
|
|
|
{"Id": 1, "Points": 10}, // 第一个评测点,分值 25 分,使用 ./data/{input,output}/1.{input,output} 为测试数据
|
|
|
|
{"Id": 2, "Points": 20},
|
|
|
|
{"Id": 3, "Points": 30},
|
|
|
|
{"Id": 4, "Points": 40}
|
2022-10-20 18:21:11 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### 评测脚本
|
|
|
|
|
2023-07-16 15:42:26 +08:00
|
|
|
1. 默认评测脚本目前只支持 `c` 语言和 `cpp`,参见 `../../framework/template/default/{c,cpp}.Makefile`
|
|
|
|
2. 自定义评测脚本参见 `./judge/XYZ.Makefile`
|
2023-12-23 19:50:32 +08:00
|
|
|
3. `prebuild.Makefile`: 题目初始化脚本,用于编译辅助程序、生成数据等。如果存在该文件,系统会在题目分发到判机后自动执行,否则跳过该步骤
|
2022-10-20 18:21:11 +08:00
|
|
|
|
2023-07-16 15:42:26 +08:00
|
|
|
## 注意事项
|
2022-10-20 18:21:11 +08:00
|
|
|
|
2023-07-16 15:42:26 +08:00
|
|
|
1. 打包的时候确保 `config.json`, `data`, `judge` 在根目录下
|
2022-10-20 18:21:11 +08:00
|
|
|
|