Datasets:

Modalities:
Text
Formats:
json
ArXiv:
Libraries:
Datasets
Dask
License:
Dataset Viewer
Auto-converted to Parquet Duplicate
context
stringlengths
88
7.54k
groundtruth
stringlengths
9
28.8k
groundtruth_language
stringclasses
3 values
type
stringclasses
2 values
code_test_cases
listlengths
1
565
dataset
stringclasses
6 values
code_language
stringclasses
1 value
difficulty
float64
0
1
mid
stringlengths
32
32
Mr. Chanek has an integer represented by a string s. Zero or more digits have been erased and are denoted by the character _. There are also zero or more digits marked by the character X, meaning they're the same digit. Mr. Chanek wants to count the number of possible integer s, where s is divisible by 25. Of course, ...
s = input() ways = 0 if len(s) == 1: if s in ['_', 'X', '0']: ways = 1 elif len(s) == 2: if s in ['25', '50', '75']: ways = 1 elif s in ['__', '_X', 'X_']: ways = 3 elif s == '_0': ways = 1 elif s in ['_5', 'X5']: ways = 2 elif s in ['2_', '5_', '7_', '2X'...
python
code_algorithm
[ { "input": "0\n", "output": "1\n" }, { "input": "_XX\n", "output": "9\n" }, { "input": "_00\n", "output": "9\n" }, { "input": "0_25\n", "output": "0\n" }, { "input": "25\n", "output": "1\n" }, { "input": "X\n", "output": "1\n" }, { "input":...
code_contests
python
0
ed6f1257ca12e3c82eb8f21afb8ef487
Mr. Chanek wants to knit a batik, a traditional cloth from Indonesia. The cloth forms a grid a with size n × m. There are k colors, and each cell in the grid can be one of the k colors. Define a sub-rectangle as an ordered pair of two cells ((x_1, y_1), (x_2, y_2)), denoting the top-left cell and bottom-right cell (in...
n, m, k, r, c = map(int, input().split()) ax, ay, bx, by = map(int, input().split()) p = n * m if ax != bx or ay != by: p -= r * c print(pow(k, p, 1000000007))
python
code_algorithm
[ { "input": "4 5 170845 2 2\n1 4 3 1\n", "output": "756680455\n" }, { "input": "3 3 2 2 2\n1 1 2 2\n", "output": "32\n" }, { "input": "997824195 298198038 671030405 831526 973640\n694897941 219757278 695597597 220039071\n", "output": "885735196\n" }, { "input": "78 15 96708421...
code_contests
python
0
d33e36bf94b08b4d06c6cb4c1381cc4f
Casimir has a rectangular piece of paper with a checkered field of size n × m. Initially, all cells of the field are white. Let us denote the cell with coordinates i vertically and j horizontally by (i, j). The upper left cell will be referred to as (1, 1) and the lower right cell as (n, m). Casimir draws ticks of di...
import sys import math import heapq import bisect from collections import Counter from collections import defaultdict, deque from io import BytesIO, IOBase from itertools import permutations import string class FastIO(IOBase): newlines = 0 def __init__(self, file): import os self.os = os ...
python
code_algorithm
[ { "input": "8\n2 3 1\n*.*\n...\n4 9 2\n*.*.*...*\n.*.*...*.\n..*.*.*..\n.....*...\n4 4 1\n*.*.\n****\n.**.\n....\n5 5 1\n.....\n*...*\n.*.*.\n..*.*\n...*.\n5 5 2\n.....\n*...*\n.*.*.\n..*.*\n...*.\n4 7 1\n*.....*\n.....*.\n..*.*..\n...*...\n3 3 1\n***\n***\n***\n3 5 1\n*...*\n.***.\n.**..\n", "output": "NO\...
code_contests
python
0
ca88f3cd16ba3a4859a25088141e9b4f
CQXYM is counting permutations length of 2n. A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears twice in the array) and [1,3,4] is also not a permutation (n=3 but there is 4 in the array). A...
from sys import stdin, gettrace if gettrace(): def inputi(): return input() else: def input(): return next(stdin)[:-1] def inputi(): return stdin.buffer.readline() LIMIT = 200001 MOD = 1000000007 def solve(factorial): n = int(input()) print( (factorial[2*n]*pow(2, MOD-2,...
python
code_algorithm
[ { "input": "4\n1\n2\n9\n91234\n", "output": "1\n12\n830455698\n890287984\n" }, { "input": "2\n99997\n3\n", "output": "979296788\n360\n" }, { "input": "14\n13633\n739\n4\n1\n23481\n279\n5113\n2013\n48785\n12\n44\n5766\n3\n127\n", "output": "265272552\n34141923\n20160\n1\n405591801\n64...
code_contests
python
0
dded87415d219981884917305a6a7adc
CQXYM wants to create a connected undirected graph with n nodes and m edges, and the diameter of the graph must be strictly less than k-1. Also, CQXYM doesn't want a graph that contains self-loops or multiple edges (i.e. each edge connects two different vertices and between each pair of vertices there is at most one ed...
for _ in range(int(input())):n, m, k = map(int, input().split());print('YES') if (k == 3 and m == (n * (n - 1)) // 2) or (k > 3 and m >= n - 1 and m <= (n * (n - 1)) // 2) or (n == 1 and m == 0 and k > 1) else print('NO')
python
code_algorithm
[ { "input": "5\n1 0 3\n4 5 3\n4 6 3\n5 4 1\n2 1 1\n", "output": "YES\nNO\nYES\nNO\nNO\n" }, { "input": "1\n1 0 0\n", "output": "NO\n" }, { "input": "1\n5 7 0\n", "output": "NO\n" }, { "input": "5\n1 0 2\n1 0 1\n5 20 3\n5 20 4\n5 20 5\n", "output": "YES\nNO\nNO\nNO\nNO\n" ...
code_contests
python
0
c778c5080a0af3985dbf796423726d96
The problem statement looms below, filling you with determination. Consider a grid in which some cells are empty and some cells are filled. Call a cell in this grid exitable if, starting at that cell, you can exit the grid by moving up and left through only empty cells. This includes the cell itself, so all filled in ...
# SHRi GANESHA author: Kunal Verma # import os import sys from collections import defaultdict, Counter from io import BytesIO, IOBase from math import gcd def lcm(a, b): return (a * b) // gcd(a, b) ''' mod = 10 ** 9 + 7 fac = [1] for i in range(1, 2 * 10 ** 5 + 1): fac.append((fac[-1] *...
python
code_algorithm
[ { "input": "4 5\n..XXX\n...X.\n...X.\n...X.\n5\n1 3\n3 3\n4 5\n5 5\n1 5\n", "output": "YES\nYES\nNO\nYES\nNO\n" }, { "input": "3 3\n...\nXXX\nXX.\n10\n2 3\n1 2\n2 2\n1 3\n2 3\n1 2\n1 3\n1 3\n2 3\n1 1\n", "output": "NO\nNO\nYES\nNO\nNO\nNO\nNO\nNO\nNO\nYES\n" }, { "input": "1 1\n.\n1\n1 1...
code_contests
python
0
027ae5229e7bff4483923b232d817be2
Omkar is creating a mosaic using colored square tiles, which he places in an n × n grid. When the mosaic is complete, each cell in the grid will have either a glaucous or sinoper tile. However, currently he has only placed tiles in some cells. A completed mosaic will be a mastapeece if and only if each tile is adjace...
import sys o = {'G':'S', 'S':'G'};n = int(input());d = [list(input()[:n]) for _ in range(n)];f = [1] * (n * n);finished = 1 if n % 2: print('NONE'); sys.exit() x = [''] * (n // 2) def findt(i, j): return abs(j - i) // 2 if (j - i) % 2 else min(i + j, 2 * (n - 1) - j - i) // 2 def findr(i, j, t): if (j - i) % 2: ret...
python
code_algorithm
[ { "input": "10\n.S....S...\n..........\n...SSS....\n..........\n..........\n...GS.....\n....G...G.\n..........\n......G...\n..........\n", "output": "UNIQUE\nSSSSSSSSSS\nSGGGGGGGGS\nSGSSSSSSGS\nSGSGGGGSGS\nSGSGSSGSGS\nSGSGSSGSGS\nSGSGGGGSGS\nSGSSSSSSGS\nSGGGGGGGGS\nSSSSSSSSSS\n" }, { "input": "4\nS....
code_contests
python
0
7340efb269e595e32d5cd4256348800d
It is the easy version of the problem. The difference is that in this version, there are no nodes with already chosen colors. Theofanis is starving, and he wants to eat his favorite food, sheftalia. However, he should first finish his homework. Can you help him with this problem? You have a perfect binary tree of 2^k...
n = int(input()) vid = 6 k = 2 m = int(1e9 + 7) for i in range(n - 1): vid = (vid * pow(4, k, m)) % m k *= 2 print(vid)
python
code_algorithm
[ { "input": "14\n", "output": "934234\n" }, { "input": "3\n", "output": "24576\n" }, { "input": "50\n", "output": "902552662\n" }, { "input": "60\n", "output": "937481864\n" }, { "input": "40\n", "output": "622757975\n" }, { "input": "10\n", "output...
code_contests
python
0
03949d61d7e32aef9a92ff98a89330ef
It is the hard version of the problem. The difference is that in this version, there are nodes with already chosen colors. Theofanis is starving, and he wants to eat his favorite food, sheftalia. However, he should first finish his homework. Can you help him with this problem? You have a perfect binary tree of 2^k - ...
import io,os #input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline M = 10**9 + 7 colors = {'white':0,'yellow':0,'green':1,'blue':1,'red':2,'orange':2} def getnext(index,n,colored,dic,layer): if layer==n: if index not in dic: return [2,2,2] else: dic[index][colored[index]] +...
python
code_algorithm
[ { "input": "10\n3\n1 blue\n4 red\n5 orange\n", "output": "328925088\n" }, { "input": "3\n2\n5 orange\n2 white\n", "output": "1024\n" }, { "input": "2\n2\n1 white\n2 white\n", "output": "0\n" }, { "input": "5\n9\n31 yellow\n30 green\n26 yellow\n13 red\n2 red\n22 white\n12 red\...
code_contests
python
0
013e36f8f3dee7c47acbe89bf885a328
You are given a matrix, consisting of n rows and m columns. The rows are numbered top to bottom, the columns are numbered left to right. Each cell of the matrix can be either free or locked. Let's call a path in the matrix a staircase if it: * starts and ends in the free cell; * visits only free cells; * ha...
''' E. Staircases https://codeforces.com/contest/1598/problem/E ''' import sys input = sys.stdin.readline output = sys.stdout.write def solve(R, C, Q, queries): blocked = [[0]*C for _ in range(R)] # total staircases if no cell blocked res = R*C # 1-block for c in range(C): # right-down from row 0 for ln in r...
python
code_algorithm
[ { "input": "3 4 10\n1 4\n1 2\n2 3\n1 2\n2 3\n3 2\n1 3\n3 4\n1 3\n3 1\n", "output": "49\n35\n24\n29\n49\n39\n31\n23\n29\n27\n" }, { "input": "1000 1000 2\n239 634\n239 634\n", "output": "1332632508\n1333333000\n" }, { "input": "2 2 8\n1 1\n1 1\n1 1\n2 2\n1 1\n1 2\n2 1\n1 1\n", "output...
code_contests
python
0
e4315068752313a050d2199207c8eaa7
Little Johnny Bubbles enjoys spending hours in front of his computer playing video games. His favorite game is Bubble Strike, fast-paced bubble shooting online game for two players. Each game is set in one of the N maps, each having different terrain configuration. First phase of each game decides on which map the gam...
n,target = map(float,input().split()) n = int(n) def getprob(study): tot = n*(n-1)*(n-2)//6 case1 = study*(study-1)*(study-2)//6 case2 = study*(study-1)*(n-study)//2 case3 = study*(n-study)*(n-study-1)//2 return (case1+case2+case3*0.5)*1.0/tot front = 0 rear = n while front<rear: mid...
python
code_algorithm
[ { "input": "7 1.0000\n", "output": "6\n" }, { "input": "956 0.9733\n", "output": "826\n" }, { "input": "444 0.0265\n", "output": "8\n" }, { "input": "267 0.4122\n", "output": "76\n" }, { "input": "840 0.5672\n", "output": "336\n" }, { "input": "937 0.8...
code_contests
python
0
37c5323b7eec8e56d57a3d9db5cb7b1b
Alice and Bob are playing a game. They are given an array A of length N. The array consists of integers. They are building a sequence together. In the beginning, the sequence is empty. In one turn a player can remove a number from the left or right side of the array and append it to the sequence. The rule is that the s...
from __future__ import division, print_function import math import sys import os from io import BytesIO, IOBase #from collections import deque, Counter, OrderedDict, defaultdict #import heapq #ceil,floor,log,sqrt,factorial,pow,pi,gcd #import bisect #from bisect import bisect_left,bisect_right BUFSIZE = 8192 class Fa...
python
code_algorithm
[ { "input": "6\n5 8 2 1 10 9\n", "output": "Bob\n" }, { "input": "3\n5 4 5\n", "output": "Alice\n" }, { "input": "1\n5\n", "output": "Alice\n" }, { "input": "3\n5 6 5\n", "output": "Bob\n" }, { "input": "2\n5 12\n", "output": "Alice\n" } ]
code_contests
python
0
0b82e39a18efc587bc5fec3b4162b3aa
On the great island of Baltia, there live N people, numbered from 1 to N. There are exactly M pairs of people that are friends with each other. The people of Baltia want to organize a successful party, but they have very strict rules on what a party is and when the party is successful. On the island of Baltia, a party ...
import sys input = sys.stdin.readline n,m = map(int,input().split()) G = [[] for _ in range(n)] for _ in range(m): u,v = map(int,input().split()) u -= 1 v -= 1 if u >= 48 or v >= 48: continue G[u].append(v) G[v].append(u) if n >= 48: G = G[:48] def ok(a,b,c,d,e): allfd = Tr...
python
code_algorithm
[ { "input": "5 4\n1 2\n2 3\n3 4\n4 5\n", "output": "-1\n" }, { "input": "6 3\n1 4\n4 2\n5 4\n", "output": "1 2 3 5 6\n" }, { "input": "6 13\n5 6\n2 5\n1 4\n6 2\n3 5\n4 5\n6 4\n3 1\n1 6\n1 5\n2 4\n6 3\n1 2\n", "output": "1 2 4 5 6\n" }, { "input": "10 8\n5 2\n1 8\n5 7\n1 9\n6 4...
code_contests
python
0.6
190d012411765eb1e1bcac2fefb45fe0
Berland State University has received a new update for the operating system. Initially it is installed only on the 1-st computer. Update files should be copied to all n computers. The computers are not connected to the internet, so the only way to transfer update files from one computer to another is to copy them usin...
import sys for t in range(int(input())): n, k = map(int, sys.stdin.readline().strip().split()) ans = 0 cur = 1 while cur <= k and cur < n: cur *= 2 ans += 1 if cur <= n: ans += (n - cur + k - 1) // k print(ans)
python
code_algorithm
[ { "input": "4\n8 3\n6 6\n7 1\n1 1\n", "output": "4\n3\n6\n0\n" }, { "input": "1\n576460752303423489 576460752303423489\n", "output": "60\n" }, { "input": "1\n36028797018963968 18014398509481983\n", "output": "56\n" }, { "input": "4\n576460752303423488 288230376151711743\n5764...
code_contests
python
0
eaaf5d959fe53391d06797f073326264
Monocarp wrote down two numbers on a whiteboard. Both numbers follow a specific format: a positive integer x with p zeros appended to its end. Now Monocarp asks you to compare these two numbers. Can you help him? Input The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of testcases. The first li...
#for line in sys.stdin.readlines()...line = line.strip() #list(map(int,input().split(" "))) #list(itertools.permutations([..,..,..])) #list(itertools.combinations([..,..,..], 3) import sys import math from math import log2 as lg from collections import deque import random import heapq import itertools const = 10000000...
python
code_algorithm
[ { "input": "5\n2 1\n19 0\n10 2\n100 1\n1999 0\n2 3\n1 0\n1 0\n99 0\n1 2\n", "output": ">\n=\n<\n=\n<\n" }, { "input": "1\n2000 0\n2 3\n", "output": "=\n" }, { "input": "1\n1 6\n1000000 0\n", "output": "=\n" }, { "input": "3\n1 3\n100 1\n2 3\n200 1\n6 3\n600 1\n", "output"...
code_contests
python
0.7
e2bf854e57e1f6db0f88220b81e7c86d
You are given a sequence a_1, a_2, ..., a_n consisting of n pairwise distinct positive integers. Find \left⌊ \frac n 2 \right⌋ different pairs of integers x and y such that: * x ≠ y; * x and y appear in a; * x~mod~y doesn't appear in a. Note that some x or y can belong to multiple pairs. ⌊ x ⌋ denotes t...
for _ in range(int(input())): n=int(input()) a=list(map(int, input().split())) a.sort() y=a[0] for i in range(1,n//2 + 1): print(a[i] , y)
python
code_algorithm
[ { "input": "4\n2\n1 4\n4\n2 8 3 4\n5\n3 8 5 9 7\n6\n2 7 5 3 4 8\n", "output": "4 1\n3 2\n4 2\n5 3\n7 3\n3 2\n4 2\n5 2\n" }, { "input": "1\n5\n200005 200006 200007 200008 200009\n", "output": "200006 200005\n200007 200005\n" }, { "input": "1\n2\n4 2\n", "output": "4 2\n" }, { ...
code_contests
python
0
7a181447fbe88b957d382a337e51b4a8
Monocarp is playing yet another computer game. In this game, his character has to kill a dragon. The battle with the dragon lasts 100^{500} seconds, during which Monocarp attacks the dragon with a poisoned dagger. The i-th attack is performed at the beginning of the a_i-th second from the battle start. The dagger itsel...
import math #s = input() #n= (map(int, input().split())) #(map(int, input().split())) #a, b = (map(int, input().split())) for i in range(0, int(input())): n, h =(map(int, input().split())) a = list(map(int, input().split())) dist = list() for j in range(0, len(a)-1): dist.append(a[j+1]-a[...
python
code_algorithm
[ { "input": "4\n2 5\n1 5\n3 10\n2 4 10\n5 3\n1 2 4 5 7\n4 1000\n3 25 64 1337\n", "output": "3\n4\n1\n470\n" }, { "input": "1\n2 1000000000000000000\n1 1000000000\n", "output": "999999999000000001\n" }, { "input": "1\n2 1000000000000000000\n1000000 1000000000\n", "output": "99999999900...
code_contests
python
0
c9f6ae263bdc8682251c0d4c7108f19a
You are given an array a of n integers, and another integer k such that 2k ≤ n. You have to perform exactly k operations with this array. In one operation, you have to choose two elements of the array (let them be a_i and a_j; they can be equal or different, but their positions in the array must not be the same), remo...
import math import os import sys from io import BytesIO, IOBase M = 1000000007 import random import heapq import threading import bisect import time #sys.setrecursionlimit(2*(10**5)) from functools import * from collections import * from itertools import * BUFSIZE = 8192 import array class FastIO(IOBase): newlines ...
python
code_algorithm
[ { "input": "5\n7 3\n1 1 1 2 1 3 1\n5 1\n5 5 5 5 5\n4 2\n1 3 3 7\n2 0\n4 2\n9 2\n1 10 10 1 10 2 7 10 3\n", "output": "2\n16\n0\n6\n16\n" }, { "input": "1\n6 3\n4 4 5 5 6 6\n", "output": "0\n" }, { "input": "1\n6 3\n1 1 1 1 2 2\n", "output": "1\n" }, { "input": "1\n9 3\n1 1 1 2...
code_contests
python
0
c843f5a976f762c8c026a79e8501c443
You are given two positive integers x and y. You can perform the following operation with x: write it in its binary form without leading zeros, add 0 or 1 to the right of it, reverse the binary form and turn it into a decimal number which is assigned as the new value of x. For example: * 34 can be turned into 81 v...
#import io,os #input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline from collections import deque def main(t): x, y = map(int,input().split()) sx, sy = bin(x)[2:],bin(y)[2:] dic = {} queue = deque() queue.append(sx) dic[sx] = 1 i = len(sx)-1 while i>=0 and sx[i]=='0': ...
python
code_algorithm
[ { "input": "2 8\n", "output": "NO\n" }, { "input": "7 4\n", "output": "NO\n" }, { "input": "8935891487501725 71487131900013807\n", "output": "YES\n" }, { "input": "3 3\n", "output": "YES\n" }, { "input": "34 69\n", "output": "YES\n" }, { "input": "4700...
code_contests
python
0
ee919416f7547b59f73998f57b6dcd6e
Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes: 1, 4, 8, 9, .... For a given number n, count the number of integers from 1 to n that Polycarp likes. In other words, find the number of such x that x is a square of a positive integer number or a cube of a...
for i in range(int(input())): n=int(input()) count=[0] if n==1: print(1) else: for i in range(1,n): if i*i>n: break if i*i<=n: count.append(i*i) if i*i*i<=n: count.append(i*i*i) else: pass print(len(set(count))-1)
python
code_algorithm
[ { "input": "6\n10\n1\n25\n1000000000\n999999999\n500000000\n", "output": "4\n1\n6\n32591\n32590\n23125\n" }, { "input": "2\n64\n15625\n", "output": "10\n145\n" }, { "input": "8\n64000000\n85766121\n113379904\n148035889\n191102976\n244140625\n594823321\n887503681\n", "output": "8380\n...
code_contests
python
0
6c9f898ead11fb33b5717e51cc446587
You are given a permutation p of n elements. A permutation of n elements is an array of length n containing each integer from 1 to n exactly once. For example, [1, 2, 3] and [4, 3, 5, 1, 2] are permutations, but [1, 2, 4] and [4, 3, 2, 1, 2] are not permutations. You should perform q queries. There are two types of qu...
def main(): n, q = readIntArr() p = readIntArr() for i in range(n): p[i] -= 1 # make 0-index base = int(n ** 0.5 + 1) a = [-1] * n # a[i] is i after base operations r = [-1] * n # r is reverse of p, i.e. base operations back. r[p[i]] = i for i in range(n): r[p[i]] ...
python
code_algorithm
[ { "input": "5 9\n2 3 5 1 4\n2 3 5\n2 5 5\n2 5 1\n2 5 3\n2 5 4\n1 5 4\n2 5 3\n2 2 5\n2 5 1\n", "output": "3\n5\n4\n2\n3\n3\n3\n1\n" }, { "input": "5 4\n5 3 4 2 1\n2 3 1\n2 1 2\n1 1 3\n2 1 2\n", "output": "4\n1\n2\n" }, { "input": "1 1\n1\n2 1 1\n", "output": "1\n" }, { "input"...
code_contests
python
0.8
e8a840ec24cea991b3b6d2646ecca5d8
You had n positive integers a_1, a_2, ..., a_n arranged in a circle. For each pair of neighboring numbers (a_1 and a_2, a_2 and a_3, ..., a_{n - 1} and a_n, and a_n and a_1), you wrote down: are the numbers in the pair equal or not. Unfortunately, you've lost a piece of paper with the array a. Moreover, you are afraid...
from itertools import permutations as per from math import factorial as fact from difflib import SequenceMatcher t = int(input()) # map(int,input().split()) # [int(i) for i in input().split()] for _ in range(t): s = input() print("YES") if s.count('N') != 1 else print("NO")
python
code_algorithm
[ { "input": "4\nEEE\nEN\nENNEENE\nNENN\n", "output": "YES\nNO\nYES\nYES\n" }, { "input": "1\nNEEEEEEEEEEEEEEEEEEEEEEEEEEEEENNNNEENNE\n", "output": "YES\n" }, { "input": "2\nEEEEEEN\nEEEEEEEN\n", "output": "NO\nNO\n" }, { "input": "2\nEEEEEN\nEEEEEN\n", "output": "NO\nNO\n"...
code_contests
python
0
b2054af6a0a54119a2c0860d5993b939
There are three sticks with integer lengths l_1, l_2 and l_3. You are asked to break exactly one of them into two pieces in such a way that: * both pieces have positive (strictly greater than 0) integer length; * the total length of the pieces is equal to the original length of the stick; * it's possible to ...
for _ in range(int(input())): a, b, c = map(int, input().split()) if a == b + c or b == a + c or c == a + b: print('YES') elif a == b and c % 2 == 0: print('YES') elif a == c and b % 2 == 0: print('YES') elif b == c and a % 2 == 0: print('YES') else: print...
python
code_algorithm
[ { "input": "4\n6 1 5\n2 5 2\n2 4 2\n5 5 4\n", "output": "YES\nNO\nYES\nYES\n" }, { "input": "2\n1 2 3\n2 2 4\n", "output": "YES\nYES\n" }, { "input": "1\n1 98 99\n", "output": "YES\n" }, { "input": "3\n1 1 1\n2 1 3\n5 6 7\n", "output": "NO\nYES\nNO\n" }, { "input"...
code_contests
python
0.1
2879205d306123ae9ce4dbcf776f3007
You are given an integer array a_1, a_2, ..., a_n and integer k. In one step you can * either choose some index i and decrease a_i by one (make a_i = a_i - 1); * or choose two indices i and j and set a_i equal to a_j (make a_i = a_j). What is the minimum number of steps you need to make the sum of array ∑_{...
import sys import os.path from collections import * import math import bisect import heapq as hq from fractions import Fraction from random import randint if os.path.exists("input.txt"): sys.stdin = open("input.txt", "r") sys.stdout = open("output.txt", "w") input = sys.stdin.readline #######################...
python
code_algorithm
[ { "input": "4\n1 10\n20\n2 69\n6 9\n7 8\n1 2 1 3 1 2 1\n10 1\n1 2 3 1 2 6 1 6 8 10\n", "output": "10\n0\n2\n7\n" }, { "input": "1\n84 781\n403 867 729 928 240 410 849 95 651 852 230 209 358 596 576 230 924 448 288 19 680 470 839 107 931 809 347 903 399 185 840 326 338 758 584 385 862 140 256 537 677...
code_contests
python
0
dca475f9b068aea1d370ddd66b3407af
You are given a binary string (i. e. a string consisting of characters 0 and/or 1) s of length n. You can perform the following operation with the string s at most once: choose a substring (a contiguous subsequence) of s having exactly k characters 1 in it, and shuffle it (reorder the characters in the substring as you...
from sys import stdin, stdout N = 998244353 def egcd(a, b): """return (g, x, y) such that a*x + b*y = g = gcd(a, b)""" if a == 0: return (b, 0, 1) else: g, y, x = egcd(b % a, a) return (g, x - (b // a) * y, y) def modinv(a, m = N): """return inverse of a mod m""" g, x, y =...
python
code_algorithm
[ { "input": "10 8\n0010011000\n", "output": "1\n" }, { "input": "5 0\n10010\n", "output": "1\n" }, { "input": "8 1\n10001000\n", "output": "10\n" }, { "input": "7 2\n1100110\n", "output": "16\n" }, { "input": "5 2\n00011\n", "output": "10\n" }, { "input...
code_contests
python
0
0921790b4d1ff3f65f38259f2a60ad25
End of preview. Expand in Data Studio

🤗 Hugging Face 🤖 ModelScope 🖥️ GitHub

Ring-lite-rl-data

This dataset is a curated subset of high-quality problems across mathematics and code domains designed for reinforcement learning in the Ring-lite model. This dataset contains:

  • Mathematics: Over 39,000 rigorously curated problems sourced from:
    • Open-source datasets (BigMath, DeepScaleR, DAPO, DeepMath-103K)
    • Art of Problem Solving (AoPS) contest collections
  • Code: Approximately 8,400 verified coding problems from:
    • Programming competition resources (CodeContest, TACO, APPS)
    • All problems include validated "Accepted" solutions and test cases

Note: Only a partial subset of the complete dataset is publicly released due to third-party data licensing restrictions and procurement agreements. The published portion has been carefully selected to comply with all copyright requirements while maintaining research utility.

Dataset Construction

Data Sources

  • Mathematics: Problems collected from open-source datasets, filtered through strict quality control
  • Code: Problems from open-source programming competition resources with verified solutions

Curation Pipeline

Our data undergoes a rigorous three-stage curation process:

  1. Data Cleansing:

    • Removal of problems with invalid characters, images, or multiple subquestions
    • Strict character-based and semantic-based deduplication
    • Exclusion of easily guessable problems (multiple-choice, True/False questions)
  2. Answer Verification:

    • LLM-based verification using models of different sizes
    • Human expert annotation
    • Problems failing verification are excluded
  3. Data Annotation:

    • Multi-dimensional labeling (source, educational level, domain knowledge)
    • Mathematical Subject Classification (MSC) for math problems
    • Model-aware difficulty assessment

Dataset Fields

The dataset contains the following fields for each domain:

Mathematics

  • context: The problem statement
  • groundtruth: Verified correct answer
  • type: Problem category
  • mid: Unique problem ID

Code

  • context: Detailed programming problem description
  • groundtruth: Verified correct Python solution code
  • groundtruth_language: Implementation language
  • type: Problem category
  • code_test_cases: List of validated test cases with:
    • input: Test input
    • output: Expected output
  • dataset: Source dataset
  • code_language: Programming language
  • difficulty: Problem difficulty score
  • mid: Unique problem ID

Citation Information

Please consider citing our technical report Ring-lite if you use this dataset:

@misc{ringteam2025ringlitescalablereasoningc3postabilized,
      title={Ring-lite: Scalable Reasoning via C3PO-Stabilized Reinforcement Learning for LLMs}, 
      author={Ling Team and Bin Hu and Cai Chen and Deng Zhao and Ding Liu and Dingnan Jin and Feng Zhu and Hao Dai and Hongzhi Luan and Jia Guo and Jiaming Liu and Jiewei Wu and Jun Mei and Jun Zhou and Junbo Zhao and Junwu Xiong and Kaihong Zhang and Kuan Xu and Lei Liang and Liang Jiang and Liangcheng Fu and Longfei Zheng and Qiang Gao and Qing Cui and Quan Wan and Shaomian Zheng and Shuaicheng Li and Tongkai Yang and Wang Ren and Xiaodong Yan and Xiaopei Wan and Xiaoyun Feng and Xin Zhao and Xinxing Yang and Xinyu Kong and Xuemin Yang and Yang Li and Yingting Wu and Yongkang Liu and Zhankai Xu and Zhenduo Zhang and Zhenglei Zhou and Zhenyu Huang and Zhiqiang Zhang and Zihao Wang and Zujie Wen},
      year={2025},
      eprint={2506.14731},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2506.14731}, 
}

Intended Usage

This dataset is designed for:

  • Training and evaluating LLMs on multi-domain reasoning tasks
  • Reinforcement learning applications
  • Benchmarking model performance across mathematics and code domains

Release Date

06/20/2025

Data Version

1.0

Downloads last month
64

Paper for inclusionAI/Ring-lite-rl-data