Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
32
32
input
stringlengths
28
13k
output
stringlengths
800
90k
source
stringclasses
5 values
license
stringclasses
1 value
dataset
stringclasses
1 value
split
stringclasses
1 value
difficulty
stringclasses
30 values
solution
stringlengths
0
17.9k
c0d4209f929db2b5bf3526a47a2520b0
Problem description. Vipul is a hardworking super-hero who maintains the bracket ratio of all the strings in the world. Recently he indulged himself in saving the string population so much that he lost his ability for checking brackets (luckily, not permanently ).Being his super-hero friend help him in his time of hard...
<think> Okay, I need to solve this problem where I have to check if the brackets in a string are balanced. Hmm, so the input is a string consisting of parentheses, and I have to determine if they're properly balanced. The example given has three test cases. Let's see. So, the problem is similar to the classic valid pa...
codechef
cc-by-4.0
code_contests
train
UNKNOWN_DIFFICULTY
T = int(input()) for _ in range(T): s = input().strip() stack = [] valid = True for c in s: if c == '(': stack.append(c) elif c == ')': if not stack: valid = False break stack.pop() if valid and not stack: pr...
5378dbbc2f9928bfe9b3a196e3a45a0b
The Chef likes to stay in touch with his staff. So, the Chef, the head server, and the sous-chef all carry two-way transceivers so they can stay in constant contact. Of course, these transceivers have a limited range so if two are too far apart, they cannot communicate directly. The Chef invested in top-of-the-line t...
<think> Okay, let's see. The problem is to determine whether all three people (Chef, head server, sous-chef) can communicate with each other, possibly through the third person. So the condition is that all three can form a connected network via their transceivers. The transceivers can communicate directly if the distan...
codechef
cc-by-4.0
code_contests
train
1
import sys def main(): T = int(sys.stdin.readline()) for _ in range(T): R = int(sys.stdin.readline()) R_sq = R * R points = [] for _ in range(3): x, y = map(int, sys.stdin.readline().split()) points.append((x, y)) # Compute pairwise squared distan...
5295c0a98f0025a377be5340304aaae3
Frank explained its friend Felman the algorithm of Euclides to calculate the GCD of two numbers. Then Felman implements it algorithm int gcd(int a, int b) { if (b==0) return a; else return gcd(b,a%b); } and it proposes to Frank that makes it but with a little integer and another integer that has up to 250 d...
<think> Okay, let's see. I need to compute the GCD of two numbers where one is up to 40000 and the other can be up to 250 digits long. Hmm, the problem says that for each pair (A, B), A is a regular integer and B is a very big number. The challenge is to compute GCD(A, B) efficiently. Wait, the Euclidean algorithm usu...
codechef
cc-by-4.0
code_contests
train
MEDIUM
import math n = int(input()) for _ in range(n): a_str, b_str = input().split() a = int(a_str) if a == 0: if all(c == '0' for c in b_str): print(0) else: print(int(b_str)) else: mod = 0 for c in b_str: mod = (mod * 10 + int(c)) % a ...
e2e75d9d7d47d6f22c7eb408f8911af8
A Little Elephant from the Zoo of Lviv likes lucky strings, i.e., the strings that consist only of the lucky digits 4 and 7. The Little Elephant calls some string T of the length M balanced if there exists at least one integer X (1 ≤ X ≤ M) such that the number of digits 4 in the substring T[1, X - 1] is equal to the n...
<think> Okay, I need to solve this problem where I have to count the number of balanced substrings in a given string of 4s and 7s. Let's try to understand the problem step by step. First, the definition of a balanced substring T of length M. It's balanced if there exists an X between 1 and M (inclusive) such that the ...
codechef
cc-by-4.0
code_contests
train
interview
import bisect def count_balanced_substrings(s): n = len(s) count_4 = [0] * (n + 1) for i in range(1, n+1): count_4[i] = count_4[i-1] + (1 if s[i-1] == '4' else 0) ans = 0 for L in range(1, n+1): a = count_4[L-1] # Binary search for the smallest R >= L where count_4[R] > a ...
06aaff0ac61dca6506122cd03fa73ab0
Given a string s. Can you make it a palindrome by deleting exactly one character? Note that size of the string after deletion would be one less than it was before. Input First line of the input contains a single integer T denoting number of test cases. For each test case, you are given a single line containing string ...
<think> Okay, I need to solve this problem where I have to determine if a given string can become a palindrome by deleting exactly one character. Let's think about how to approach this. First, I remember that a palindrome reads the same forwards and backwards. So the basic idea is that if the string is already a palin...
codechef
cc-by-4.0
code_contests
train
2
def is_palindrome(s): return s == s[::-1] T = int(input()) for _ in range(T): s = input().strip() if is_palindrome(s): print("YES") continue left = 0 right = len(s) - 1 found = False while left < right: if s[left] == s[right]: left += 1 right ...
158a2912d0543c34123ff7faa6739b3f
An established group of scientists are working on finding solution to NP hard problems. They claim Subset Sum as an NP-hard problem. The problem is to determine whether there exists a subset of a given set S whose sum is a given number K. You are a computer engineer and you claim to solve this problem given that all...
<think> Okay, I need to solve this subset sum problem where all numbers are non-negative. Let's see. The problem is to determine if any subset of the given set S adds up exactly to K. The constraints are that T can be up to 1000 test cases, and N can be up to 1000 elements. Hmm, but wait, K is up to 1000. Oh right, tha...
codechef
cc-by-4.0
code_contests
train
UNKNOWN_DIFFICULTY
import sys def main(): input = sys.stdin.read().split() idx = 0 T = int(input[idx]) idx +=1 for _ in range(T): N, K = int(input[idx]), int(input[idx+1]) idx +=2 S = list(map(int, input[idx:idx+N])) idx +=N mask = 1 for num in S: if num == ...
c9b38a543b4ef0e6ff5c3723ec010ebd
"There are n persons who initially don't know each other. On each morning, two of them, who were not(...TRUNCATED)
"<think>\nOkay, let's see. The problem is to find for each day after adding a new friendship, the ma(...TRUNCATED)
codeforces
cc-by-4.0
code_contests
train
11
"import sys\nfrom collections import deque\n\ndef main():\n input = sys.stdin.read().split()\n (...TRUNCATED)
d8321e50eedc1aa555c804b13f80d197
"Let's call a string a phone number if it has length 11 and fits the pattern \"8xxxxxxxxxx\", where (...TRUNCATED)
"<think>\nOkay, let's see. The problem is about finding the maximum number of phone numbers we can c(...TRUNCATED)
codeforces
cc-by-4.0
code_contests
train
7
"n = int(input())\ns = input().strip()\ncount_8 = s.count('8')\nmax_phones = n // 11\nprint(min(coun(...TRUNCATED)
11844e142b5a486ec5d9cdac9a026562
"You are given q queries in the following form:\n\nGiven three integers l_i, r_i and d_i, find minim(...TRUNCATED)
"<think>\nOkay, I need to solve this programming problem. Let's read the question carefully.\n\nSo, (...TRUNCATED)
codeforces
cc-by-4.0
code_contests
train
7
"q = int(input())\nfor _ in range(q):\n l, r, d = map(int, input().split())\n if d < l:\n (...TRUNCATED)
5d4b200b67053c08ff60889967ad689a
"In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming e(...TRUNCATED)
"<think>\nOkay, let's tackle this problem. Hmm, the problem is about determining if the Wrong Answer(...TRUNCATED)
codeforces
cc-by-4.0
code_contests
train
VERY_HARD
"import sys\nfrom sys import stdin\nfrom collections import deque\n\ndef main():\n sys.setrecursi(...TRUNCATED)
End of preview. Expand in Data Studio

nvidia/OpenCodeReasoning(複製)

データの内容

競技プログラミングの問題と Python の解答のデータ。1 行が 1 件の問題に対する 1 つの応答で、応答の全体は output、そのうちコードだけが solution に入る。問題文は input に入るが、split_1 では input が - のままで、dataset・split・index から TACO や APPS を引いて補う。問題は TACO・APPS・CodeContests・open-r1/codeforces から集め、応答は R1 が生成した。

データの概要

項目 値
行数 約 752,713(2 構成・2 分割の合計)
列数 9〜10(構成による)
容量 9.73 GB(ファイル 42 本)
ファイルの形式 parquet 40
公開 public

構成と分割

構成(config) 分割(split)ごとの行数 列数
split_0 split_0 約 585,308 9
split_1 split_1 167,405 10

列(構成 split_0・分割 split_0。構成ごとに列が違う)

列 型 先頭の行の値
id string c0d4209f929db2b5bf3526a47a2520b0
input string Problem description. Vipul is a hardworking supe…
output string <think> Okay, I need to solve this problem where…
source string codechef
license string cc-by-4.0
dataset string code_contests
split string train
difficulty string UNKNOWN_DIFFICULTY
solution string T = int(input()) for _ in range(T): s = inpu…

行数と列は HF のデータセットビューアの集計(元のデータセットの現在の版で数えたもの)。全データセットの一覧は HYUKI5/dataset-catalog にある。

複製について

nvidia/OpenCodeReasoning をリビジョン 20a1ca19c0d050fe9057fc08339d6b370ec1c67a の時点でそのまま複製したもの。中身は変えていない。判断モデル Laya(convaiinnovations/laya)の微調整に使う候補として、調査メモ(Laya 学習用データセット調査)に載せたデータを集めている。

出典

論文

アノテーションの方法

(元のカードに該当の見出しが無いので、ラベルの付け方に触れた段落を抜き出した)

** ラベル付けの方法

  • [ハイブリッド: 自動化、合成]

微調整に使うときの注意

  • 調査メモの台帳での区分: A(許諾型のライセンスだけで、疑義の注記が無い)。区分は記載の文言で機械的に付けたもので、法的な判定ではない。学習に入れる前に元のカードとライセンスの原文で確かめる。
  • Laya の入力は 2,048 token まで(ModernBERT-large / mmBERT)。長い本文は先頭から黙って切られるので、切れる行は事前に除くか、要約・切り出しをしてから入れる。
  • 分割は記事・文書単位で行い、同じ本文から作った別の問いを学習側と較正側に分けない。温度と閾値は学習に使っていない分割で別々に当てる。

調査メモの記述

メモ 節 ライセンス(記載) 確認 注記
nvidia_nemotron.md 付録. 取得した nvidia 組織のデータセット全件の簡易一覧 (L375) cc-by-4.0 確認済 確認印なし(各ファイルの凡例により確認済扱い) / 原文注記: × 数学・コード・科学・計測

元のカード(日本語訳)

以下は元のデータセットのカードの本文を日本語に訳したもの(機械翻訳)。訳に疑問があるときは、末尾の原文を確かめる。


OpenCodeReasoning: Advancing Data Distillation for Competitive Coding

データの概要

OpenCodeReasoning は、コーディングのための推論ベースの合成データセットとして現時点で最大のものであり、28,319 の一意な競技プログラミングの問題にわたる Python のサンプル 735,255 件を含む。 OpenCodeReasoning は教師あり微調整(SFT)のために設計されている。

  • 技術報告 - OpenCodeReasoning の方法論と技術的な詳細を確認できる。
  • Github リポジトリ - SFT の実行に使われた完全なパイプラインにアクセスできる。

このデータセットは、商用・非商用のどちらの利用にも対応している。

データの分布

Source # Question # Sample
AIZU 2123 62,476
AtCoder 2043 47,222
CodeChef 3796 72,925
CodeForces 10069 386,948
Codewars 2493 34,326
GeeksForGeeks 2667 37,602
HackerEarth 2269 59,181
HackerRank 895 10,955
Kattis 1187 13,095
LeetCode 777 10,525
合計 28,319 735,255

データのフィールド

Field Type Description
id string 問題ごとの一意な ID
input string 入力となる競技プログラミングの問題(split_0 のみ)。split_1 では、dataset/split/index のフィールドに基づいて問題を取得する必要がある。
output string R1 の応答。
solution string R1 の応答のうち、コードの部分だけ。
dataset string 問題の収集元のデータセットの名前(例: "apps"、"taco"、"code_contests")
license string データセットに付随するライセンス(例: "mit"、"apache-2.0"、"cc-by-4.0")
split string 問題の収集元となった、データセットの分割の名前(例: "train"、"valid"、"test")
source string 競技プログラミングのプラットフォームの名前(例: CodeForces、CodeChef)
difficulty string 入力の問題の難易度のラベル。
index string APPS/TACO データセットから入力の問題を取り出すための索引(split_1 のみ)。

使い方

次のコードでデータセットを読み込める。

from datasets import load_dataset

ocr_ds_split_0 = load_dataset("nvidia/OpenCodeReasoning", "split_0")
print(ocr_ds_split_0)
DatasetDict({
    split_0: Dataset({
        features: ['id', 'input', 'output', 'source', 'license', 'dataset', 'split', 'difficulty', 'solution'],
        num_rows: 567850
    })
})

ocr_ds_split_1 = load_dataset("nvidia/OpenCodeReasoning", "split_1")
print(ocr_ds_split_1)
DatasetDict({
    split_1: Dataset({
        features: ['id', 'index', 'input', 'output', 'source', 'license', 'dataset', 'split', 'difficulty', 'solution'],
        num_rows: 167405
    })
})

datasets = {
    "taco": load_dataset("BAAI/TACO"),
    "apps": load_dataset("codeparrot/apps")
}
for item in tqdm(ocr_ds_split_1["train"]):
    assert item["input"] == "-"
    assert item["dataset"] in ["taco", "apps"]
    item["input"] = datasets[item["dataset"]][item["split"]][int(item["index"])]["question"]

データセットの特徴づけ

** データ収集の方法

  • [ハイブリッド: 自動化、合成]

** ラベル付けの方法

  • [ハイブリッド: 自動化、合成]

ライセンスと利用規約

このデータセットは、Creative Commons Attribution 4.0 International License(CC BY 4.0)のもとで公開されている。ライセンス本文は https://creativecommons.org/licenses/by/4.0/legalcode で確認できる。

データの開発者: NVIDIA

用途:

コード生成のために推論能力を蒸留する LLM を学習させる開発者。

公開日:

04/04/2025

データのバージョン

1.0 (04/04/2025)

想定される用途

OpenCodeReasoning データセットは、コミュニティが公開モデルを改良し続けるために使われることを想定している。このデータは、モデルの学習に自由に使ってよい。ただし、利用者が使うことを選んだ各データセットについて、 そのデータセットのライセンスが意図する用途に適しているかどうかを確認する責任は利用者にある。

倫理的な配慮:

NVIDIA は、信頼できる AI は共有の責任であると考えており、幅広い AI の応用の開発を可能にするための方針と慣行を定めている。利用規約に従ってダウンロードまたは使用する場合、開発者は社内のモデルチームと連携し、このモデルが関連する業界と用途の要件を満たし、予期しない製品の誤用に対処できるようにすべきである。

セキュリティ上の脆弱性や NVIDIA AI に関する懸念はこちらから報告してほしい。

引用

このデータが役に立つ場合は、次を引用してほしい:

@article{ahmad2025opencodereasoning,
      title={OpenCodeReasoning: Advancing Data Distillation for Competitive Coding}, 
      author={Wasi Uddin Ahmad, Sean Narenthiran, Somshubra Majumdar, Aleksander Ficek, Siddhartha Jain, Jocelyn Huang, Vahid Noroozi, Boris Ginsburg},
      year={2025},
      eprint={2504.01943},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2504.01943}, 
}
原文(英語)

OpenCodeReasoning: Advancing Data Distillation for Competitive Coding

Data Overview

OpenCodeReasoning is the largest reasoning-based synthetic dataset to date for coding, comprises 735,255 samples in Python across 28,319 unique competitive programming questions. OpenCodeReasoning is designed for supervised fine-tuning (SFT).

  • Technical Report - Discover the methodology and technical details behind OpenCodeReasoning.
  • Github Repo - Access the complete pipeline used to perform SFT.

This dataset is ready for commercial/non-commercial use.

Data distribution

Source # Question # Sample
AIZU 2123 62,476
AtCoder 2043 47,222
CodeChef 3796 72,925
CodeForces 10069 386,948
Codewars 2493 34,326
GeeksForGeeks 2667 37,602
HackerEarth 2269 59,181
HackerRank 895 10,955
Kattis 1187 13,095
LeetCode 777 10,525
Total 28,319 735,255

Data Fields

Field Type Description
id string A unique id for each question
input string The input competitive programming question (split_0 only). For split_1, user needs to get the question based on the dataset/split/index fields.
output string R1's response.
solution string Only the code portion of R1's response.
dataset string The name of the dataset from which this question is collected from (e.g., "apps", "taco", "code_contests")
license string The license associated with the dataset (e.g., "mit", "apache-2.0", "cc-by-4.0")
split string The name of the split of the dataset from which this question is collected from (e.g., "train", "valid", "test")
source string The name of the competitive programming platform (e.g., CodeForces, CodeChef)
difficulty string A difficulty label for the input question.
index string An index to retrieve the input question from APPS/TACO dataset (only available for split_1).

How to use it

You can load the dataset with the following lines of code.

from datasets import load_dataset

ocr_ds_split_0 = load_dataset("nvidia/OpenCodeReasoning", "split_0")
print(ocr_ds_split_0)
DatasetDict({
    split_0: Dataset({
        features: ['id', 'input', 'output', 'source', 'license', 'dataset', 'split', 'difficulty', 'solution'],
        num_rows: 567850
    })
})

ocr_ds_split_1 = load_dataset("nvidia/OpenCodeReasoning", "split_1")
print(ocr_ds_split_1)
DatasetDict({
    split_1: Dataset({
        features: ['id', 'index', 'input', 'output', 'source', 'license', 'dataset', 'split', 'difficulty', 'solution'],
        num_rows: 167405
    })
})

datasets = {
    "taco": load_dataset("BAAI/TACO"),
    "apps": load_dataset("codeparrot/apps")
}
for item in tqdm(ocr_ds_split_1["train"]):
    assert item["input"] == "-"
    assert item["dataset"] in ["taco", "apps"]
    item["input"] = datasets[item["dataset"]][item["split"]][int(item["index"])]["question"]

Dataset Characterization

** Data Collection Method

  • [Hybrid: Automated, Synthetic]

** Labeling Method

  • [Hybrid: Automated, Synthetic]

License/Terms of Use

This dataset is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0) available at https://creativecommons.org/licenses/by/4.0/legalcode.

Data Developer: NVIDIA

Use Case:

Developers training LLMs to distill reasoning capabilities for code generation.

Release Date:

04/04/2025

Data Version

1.0 (04/04/2025)

Intended use

The OpenCodeReasoning Dataset is intended to be used by the community to continue to improve open models. The data may be freely used to train models. However, for each dataset an user elects to use, the user is responsible for checking if the dataset license is fit for the intended purpose.

Ethical Considerations:

NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.

Please report security vulnerabilities or NVIDIA AI Concerns here.

Citation

If you find the data useful, please cite:

@article{ahmad2025opencodereasoning,
      title={OpenCodeReasoning: Advancing Data Distillation for Competitive Coding}, 
      author={Wasi Uddin Ahmad, Sean Narenthiran, Somshubra Majumdar, Aleksander Ficek, Siddhartha Jain, Jocelyn Huang, Vahid Noroozi, Boris Ginsburg},
      year={2025},
      eprint={2504.01943},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2504.01943}, 
}
Downloads last month
85

Paper for HYUKI5/nvidia__OpenCodeReasoning