Dataset Viewer
Auto-converted to Parquet
data_source
stringclasses
1 value
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
code-contests-plus
[ { "role": "user", "content": "Twins\n\nTwins\n\nsquare1001 and E869120 are twins.\n\nPlease output the one that was born first.\n\ninput\n\nNo input is given.\n\noutput\n\nOutput the correct character string on one line.\n\nHowever, insert a line break at the end.\n\nOutput example 1\n\n\nsquare1001\n\n\n\n\n\n\nExample\n\nInput\n\n\n\n\nOutput\n\n## Instructions\n\nSolve this problem by reading inputs from stdin and writing the answer to stdout.\n\n**Important**: Do not directly test on the sample inputs shown above.\n\nChoose one of the following languages and write your solution in a code block:\n\n**Python:**\n```python\n# YOUR CODE HERE\n```\n\n**C++:**\n```cpp\n// YOUR CODE HERE\n```\n\n**Java:**\n```java\n// YOUR CODE HERE\n```\n\nEnsure your code:\n1. Reads all inputs from stdin\n2. Processes the problem correctly\n3. Writes the output to stdout\n4. Handles all edge cases mentioned in the problem" } ]
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"\"], \"outputs\": [\"square1001\"]}" }
{ "index": 1 }
code-contests-plus
[ { "role": "user", "content": "AtCoder Beginner Contest 095 - Something on It\n\nIn \"Takahashi-ya\", a ramen restaurant, a bowl of ramen costs 700 yen (the currency of Japan), plus 100 yen for each kind of topping (boiled egg, sliced pork, green onions).\n\nA customer ordered a bowl of ramen and told which toppings to put on his ramen to a clerk. The clerk took a memo of the order as a string S. S is three characters long, and if the first character in S is `o`, it means the ramen should be topped with boiled egg; if that character is `x`, it means the ramen should not be topped with boiled egg. Similarly, the second and third characters in S mean the presence or absence of sliced pork and green onions on top of the ramen.\n\nWrite a program that, when S is given, prints the price of the corresponding bowl of ramen.\n\nConstraints\n\n* S is a string of length 3.\n* Each character in S is `o` or `x`.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\nS\n\n\nOutput\n\nPrint the price of the bowl of ramen corresponding to S.\n\nExamples\n\nInput\n\noxo\n\n\nOutput\n\n900\n\n\nInput\n\nooo\n\n\nOutput\n\n1000\n\n\nInput\n\nxxx\n\n\nOutput\n\n700\n\n## Instructions\n\nSolve this problem by reading inputs from stdin and writing the answer to stdout.\n\n**Important**: Do not directly test on the sample inputs shown above.\n\nChoose one of the following languages and write your solution in a code block:\n\n**Python:**\n```python\n# YOUR CODE HERE\n```\n\n**C++:**\n```cpp\n// YOUR CODE HERE\n```\n\n**Java:**\n```java\n// YOUR CODE HERE\n```\n\nEnsure your code:\n1. Reads all inputs from stdin\n2. Processes the problem correctly\n3. Writes the output to stdout\n4. Handles all edge cases mentioned in the problem" } ]
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"ooo\", \"xxx\", \"oxx\", \"xox\", \"xxo\", \"oox\", \"oxo\", \"xoo\"], \"outputs\": [\"1000\", \"700\", \"800\", \"800\", \"800\", \"900\", \"900\", \"900\"]}" }
{ "index": 4 }
code-contests-plus
[{"role":"user","content":"Toys\n\nLittle Masha loves arranging her toys into piles on the floor. An(...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\"(...TRUNCATED)
{ "index": 5 }
code-contests-plus
[{"role":"user","content":"AtCoder Beginner Contest 122 - Double Helix\n\nOn the Planet AtCoder, the(...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"A\", \"C\", \"G\", \"T\"], \"outputs\": [\"T\", \"G\(...TRUNCATED)
{ "index": 6 }
code-contests-plus
[{"role":"user","content":"Little Elephant and Magic Square\n\nLittle Elephant loves magic squares v(...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"0 7 6\\n9 0 1\\n4 3 0\", \"0 21534 21527\\n21548 0 2(...TRUNCATED)
{ "index": 7 }
code-contests-plus
[{"role":"user","content":"xorsub\n\nYou have an array of integers A1, A2, ..., AN. The function F(P(...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"1\\n1 438\\n780\", \"1\\n1 845\\n849\", \"1\\n1 350\(...TRUNCATED)
{ "index": 8 }
code-contests-plus
[{"role":"user","content":"Prize\n\nPrize\n\nSegtree entered a programming contest with a team of $ (...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"1 1\", \"1000000000000000000 1000000000000000000\", (...TRUNCATED)
{ "index": 9 }
code-contests-plus
[{"role":"user","content":"Help Farmer\n\nOnce upon a time in the Kingdom of Far Far Away lived Sam (...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"1\", \"1000000000\", \"7\", \"4\", \"57\", \"808\", (...TRUNCATED)
{ "index": 10 }
code-contests-plus
[{"role":"user","content":"Platforms\n\nIn one one-dimensional world there are n platforms. Platform(...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"1 1 2 1\", \"1000000 1000000 1000000 999999\", \"924(...TRUNCATED)
{ "index": 11 }
code-contests-plus
[{"role":"user","content":"Snow Walking Robot\n\nRecently you have bought a snow walking robot and b(...TRUNCATED)
code
{"style":"rule","ground_truth":"{\"inputs\": [\"1\\nLRRRLDUUDLRLLRRUULRDUUUUUDLDRUUDRURDULDURLLLDLRL(...TRUNCATED)
{ "index": 12 }
End of preview. Expand in Data Studio

Code Contests Plus (VERL Format)

This dataset contains 8,432 competitive programming problems from the Code-Contests-Plus dataset, converted to VERL format for reinforcement learning applications. Each problem includes test cases validated through sandbox execution.

Source: ByteDance-Seed/Code-Contests-Plus (1x config)

License: MIT

Dataset Structure

The dataset follows the VERL format with the following fields:

  • data_source (string): Dataset source identifier ("code-contests-plus")
  • prompt (list): Chat template format with role/content structure containing the coding problem
  • ability (string): Task category ("code")
  • reward_model (dict): Evaluation information
    • style: Evaluation method ("rule")
    • ground_truth: JSON-encoded test cases with input/output pairs
  • extra_info (dict): Additional metadata
    • index: Example index from original dataset

Test Case Format

Each problem includes test cases in the reward_model.ground_truth field, stored as JSON with the following structure:

{
  "inputs": ["3\n1 2 3\n"],
  "outputs": ["6\n"]
}

The format consists of two parallel arrays:

  • inputs: Array of input strings for each test case
  • outputs: Array of expected output strings corresponding to each input

Each problem typically contains between 1 and 32 test cases, validated through sandbox execution during dataset creation.

Data Processing

The dataset was created through a multi-step processing pipeline:

1. Test Case Extraction

  • Extracted public test cases from the original dataset
  • Validated format and executability
  • Filtered problems without valid test cases

2. Sandbox Validation

  • Each problem's test cases were validated using a sandbox environment
  • Test input/output pairs verified for correctness
  • Only problems with passing validation were included

3. Size Filtering

  • Applied 10MB size limit to test case JSON (encoded)
  • Removed overly large problems to ensure efficient processing
  • Balanced dataset quality and usability

Processing Statistics

  • Total input examples: 11,690
  • Successfully processed: 8,432 (72.1% success rate)
  • Total filtered: 3,258 (27.9%)
    • No test cases: 54 (0.5%)
    • Size filtered (>10MB): 3,204 (27.4%)
  • Processing time: 69 minutes
  • Configuration used: 1x (standard difficulty)

Usage

from datasets import load_dataset
import json

# Load the dataset
dataset = load_dataset("sungyub/code-contests-plus-verl")

# Access an example
example = dataset['train'][0]

# Get the problem description
problem = example['prompt'][0]['content']
print("Problem:", problem)

# Parse test cases
ground_truth = json.loads(example['reward_model']['ground_truth'])
inputs = ground_truth['inputs']
outputs = ground_truth['outputs']

print(f"\nNumber of test cases: {len(inputs)}")
print(f"First input: {repr(inputs[0])}")
print(f"Expected output: {repr(outputs[0])}")

Example Problem

Problem Description:

Twins

square1001 and E869120 are twins, but they are not identical twins...

Test Case:

Input:  ""
Output: "square1001"

Statistics

  • Total examples: 8,432
  • Average test cases per problem: ~10-15
  • Test case range: 1-32 per problem
  • Dataset size: ~10 GB uncompressed, ~10 GB compressed (includes test cases)
  • Format: Parquet (11 shards, ~1GB each)
  • Schema: VERL-compatible

Data Quality

All problems in this dataset have been validated to ensure:

  1. Valid test cases: Each problem has at least one valid test case
  2. Correct input/output pairs: Test cases verified through sandbox execution
  3. Size constraints: Test cases are within reasonable size limits (≤10MB)
  4. Format consistency: All examples follow the same schema structure

Conversion Script

The dataset was created using preprocess_codecontests_verl.py:

# Standard conversion (used for this dataset)
python preprocess_codecontests_verl.py \
  --dataset-id ByteDance-Seed/Code-Contests-Plus \
  --config 1x \
  --output-dir ./codecontests_verl_full \
  --sandbox-url http://localhost:8080/run_code \
  --batch-size 100

# Process with different configuration
python preprocess_codecontests_verl.py \
  --dataset-id ByteDance-Seed/Code-Contests-Plus \
  --config 2x \
  --output-dir ./codecontests_verl_2x \
  --sandbox-url http://localhost:8080/run_code \
  --batch-size 100

# Process limited samples for testing
python preprocess_codecontests_verl.py \
  --dataset-id ByteDance-Seed/Code-Contests-Plus \
  --config 1x \
  --output-dir ./codecontests_test \
  --sandbox-url http://localhost:8080/run_code \
  --max-examples 100

Related Datasets

Additional Information

For more information about VERL format and usage in reinforcement learning, see:

Citation

If you use this dataset, please cite the original Code-Contests-Plus dataset:

@misc{code-contests-plus,
  title={Code-Contests-Plus},
  author={ByteDance-Seed},
  year={2024},
  publisher={HuggingFace},
  url={https://huggingface.co/datasets/ByteDance-Seed/Code-Contests-Plus}
}

License

This dataset is released under the MIT License, following the license of the original Code-Contests-Plus dataset.

Downloads last month
26

Collection including sungyub/code-contests-plus-verl