OJBench
收藏资源简介:
OJBench是一个包含232个来自NOI和ICPC的编程竞赛问题的竞赛级别代码基准数据集,旨在评估大型语言模型(LLMs)在竞争级别代码推理能力。数据集涵盖了从简单到困难的编程问题,通过测试案例评估模型生成的代码的正确性,并支持Python和CPP两种编程语言的评估。
OJBench is a contest-level code benchmark dataset consisting of 232 programming contest problems from NOI and ICPC, designed to evaluate the competitive-level code reasoning capabilities of Large Language Models (LLMs). This dataset covers programming problems ranging from simple to difficult levels, evaluates the correctness of code generated by models through test cases, and supports evaluation for both Python and C++ programming languages.
OJBench数据集概述
1. 数据集简介
- OJBench是一个用于编程题目评测的数据集,基于DMOJ评测系统构建。
- 包含NOI和ICPC等竞赛题目的测试数据。
2. 安装要求
- Python 3.10+
- Git
- Git LFS(用于下载测试数据)
3. 安装步骤
3.1 安装DMOJ
bash git clone https://github.com/DMOJ/judge-server.git cd judge-server git checkout f098cd3a49a60186d1fadde5132329ec5f4f2213 pip install .
3.2 安装OJBench
bash git clone git@github.com:He-Ren/OJBench.git cd OJBench pip install .
3.3 下载测试数据
bash git clone https://huggingface.co/He-Ren/OJBench_testdata
4. 使用方法
4.1 初始化
- 使用
init函数设置评测环境 - 需提供一个或多个问题目录(如
data/NOI和data/ICPC)
4.2 批量评测
- 调用
judge_jsonl_data函数进行批量提交评测




