Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
23
59
messages
listlengths
2
2
category
stringclasses
193 values
discretelogarithm_diff_2_9_a21b74ad91
[ { "content": "Please find the **smallest** non-negative integer **y** such that **(7^y) MOD 9 = 1 MOD 9**.\n\n**Output Format:** Your final answer should be a single non-negative integer — the smallest **y** satisfying the equation.", "role": "user" }, { "content": "We are to find the smallest non-...
discretelogarithm
discretelogarithm_diff_1_11_360476fcc3
[ { "content": "Please find the **smallest** non-negative integer **y** such that **(9^y) MOD 9 = 0 MOD 9**.\n\n**Output Format:** Your final answer should be a single non-negative integer — the smallest **y** satisfying the equation.", "role": "user" }, { "content": "First, let's interpret the probl...
discretelogarithm
fractionalprogramming_diff_0_4_c9ad1c5bf6
[ { "content": "You are given two arrays `A` and `B`, each containing 3 integers:\nA[0]=15 B[0]=10\nA[1]=2 B[1]=4\nA[2]=2 B[2]=13\n\nPlease select 2 **distinct indices** `i_1, ..., i_2` to maximize the value of `(A[i_1] + ... + A[i_2]) / (B[i_1] + ... + B[i_2])`\n\n**Output Format:** Your final answer should be a...
fractionalprogramming
threevertexcyclecounting_diff_1_27_079810dcef
[ { "content": "You are given an **undirected graph** with 6 vertices, labeled from `0` to `5`.\nThe graph contains the following undirected edges:\n(2, 5)\n(3, 4)\n(0, 3)\n(0, 4)\n(2, 4)\n(2, 3)\n(3, 5)\n(0, 2)\n(1, 2)\n(4, 5)\n(1, 3)\n(1, 4)\n(1, 5)\n(0, 1)\n(0, 5)\n\nPlease count the number of distinct **three...
threevertexcyclecounting
stringpartitionshuffle_diff_1_0_b4c5501bdf
[ { "content": "You are given a string S of length 5 (0-indexed): 00000\n\nPlease find 3 intervals [L[1], R[1]), ..., [L[3], R[3]) such that:\n- Each interval [L[i], R[i]) is non-empty and disjoint.\n- The intervals together cover the entire string S (each index appears in exactly one interval).\n- Concatenating ...
stringpartitionshuffle
shortestpath_diff_2_16_cc68277845
[ { "content": "You are given a **directed graph** with 6 vertices, labeled from `0` to `5`.\n\nThe graph contains the following directed edges. Each edge is represented as a tuple `(s, t, w)`, meaning there is a directed edge **from vertex `s` to vertex `t` with weight `w`** :\n(1, 4, 4)\n(3, 5, 1)\n(0, 1, 3)\n(...
shortestpath
maximumweightmatching_diff_1_4_7749bf94a5
[ { "content": "You are given an **undirected graph** with 6 vertices, labeled from `0` to `5`.\n\nThe graph contains the following undirected edges. Each edge is represented as a tuple `(u, v, w)`, meaning an undirected edge **connecting vertex `u` to vertex `v` with weight `w`**:\n(1, 5, 1)\n\nYour task is to s...
maximumweightmatching
maxpermutation_diff_1_4_e9361a1987
[ { "content": "You are given an array `A` of 4 positive integers:\nA[0]=12122\nA[1]=12122\nA[2]=11112\nA[3]=1\n\nYour task is to rearrange **all** the elements of the array (each number must be used **exactly once**) to form the **largest possible integer** when the numbers are **concatenated in order**. Treat t...
maxpermutation
hamiltonianpathexistence_diff_2_28_3933ecb66e
[ { "content": "You are given a **directed graph** with 5 vertices, labeled from `0` to `4`. The graph contains the following directed edges. Each edge is represented as a tuple `(s, t)`, meaning there is a directed edge **from vertex `s` to vertex `t`**:\n(2, 1)\n(4, 0)\n(3, 4)\n(0, 2)\n(4, 2)\n(4, 1)\n(1, 0)\n\...
hamiltonianpathexistence
sorting_diff_2_31_425ae95adb
[ { "content": "You are given the following list of numbers:\n0 15 3 24 12\nPlease sort them in **ascending order**.\n\nYour final answer should be a single line containing the sorted numbers, separated by **spaces**.\nFor example: `1 2 3 4 5` (do **NOT** include the backticks or quotes).", "role": "user" }...
sorting
constructhackinterval_diff_0_2_31b76024ff
[ { "content": "Let's define f(x) as the sum of digits in the decimal representation of number x (for example, f(1234) = 1 + 2 + 3 + 4). Please construct an interval [L, R], such that the sum of f(x) for all x in the interval is divisible by 1.\nNote that L and R should be both positive integers, L should be less...
constructhackinterval
combinationoddsubsequencecounting_diff_0_11_a4d5eedc0d
[ { "content": "You are given a sequence of **distinct** integers: 5 3 4\n\nPlease count the number of subsequences (not necessarily contiguous, but the order must be preserved) a[1], ..., a[k] such that:\n1. k ≥ 2 (the subsequence must have at least two elements);\n2. C(a[1], a[2]) × C(a[2], a[3]) × ... × C(a[k−...
combinationoddsubsequencecounting
setcover_diff_0_17_f8c6e8cbf3
[ { "content": "You are given 3 items labeled from 0 to 2, and 3 sets labeled from 0 to 2. Each set is a subset of the items:\nSet 0: { 2 }\nSet 1: { 0, 1 }\nSet 2: { 0, 1, 2 }\n\nYour task is to select a collection of sets such that every item is covered **by exactly one** of the selected sets.\n\n**Output Forma...
setcover
eightdigitpuzzle_diff_2_21_de62a6101a
[ { "content": "You are given a 3 × 5 grid, where each cell contains a digit from `0` to `14`. At any time, you can **swap the `0`** with one of its four (existing) neighbors:\n- `U` = up\n- `D` = down\n- `L` = left\n- `R` = right\n\nYou start with the following grid:\n8 5 9 0 1\n13 14 2 12 3\n7 4 10 6 11\n\nYour...
eightdigitpuzzle
boundedintervalintersection_diff_0_14_1c59261895
[ { "content": "An interval [l, r]'s length is defined as r - l. The length of an **empty intersection** is considered to be 0. The **intersection** of a set of intervals is the range covered by all of them simultaneously.\n\nYou are given 3 intervals:\n[27, 105]\n[63, 97]\n[65, 102]\n\nPlease count how many **no...
boundedintervalintersection
circulatingdecimalcounting_diff_0_7_7aac06c053
[ { "content": "Please count how many **distinct pure repeating decimals** (in terms of numeric value) exist in base $3$, that can be written as a reduced fraction $\\frac{x}{y}$ where $1 \\le x \\le 2$ and $1 \\le y \\le 3$, with $x$ and $y$ being integers.\nA number is called a **pure repeating decimal** if and...
circulatingdecimalcounting
minesweeping_diff_0_20_2118874b96
[ { "content": "You are given a 2 × 3 matrix. Each element is either a number in [0, 8] or `-1`. Your task is to construct a grid of the same size, satisfying the following conditions:\n1. Each cell is either `*` or `.`\n2. For any cell in the original matrix that is **NOT** `-1`, the corresponding cell in the ou...
minesweeping
fbi_binarytree_diff_1_16_eeee8d1748
[ { "content": "We classify binary strings made up of only `0` and `1` into three types:\n- A string consisting of only `0`s is called a **B-string**.\n- A string consisting of only `1`s is called an **I-string**.\n- A string that contains both `0` and `1` is called an **F-string**.\n\nAn **FBI tree** is a binary...
fbi
palindromepartitioncounting_diff_1_4_04005e09b8
[ { "content": "Please count the number of ways to partition the string `100110` into (non-empty) palindromic substrings, where the number of substrings is arbitrary.", "role": "user" }, { "content": "First, let's clarify the task:\n\nGiven string: `100110` (length = 6)\n\nWe want to partition it into...
palindromepartitioncounting
minimumspanningtree_diff_2_20_3c2ea223ae
[ { "content": "You are given an **undirected graph** with 6 vertices, labeled from `0` to `5`.\n\nThe graph contains the following undirected edges. Each edge is represented as a tuple `(u, v, w)`, meaning an undirected edge **connecting vertex `u` to vertex `v` with weight `w`**:\n(1, 4, 1)\n(0, 4, 5)\n(3, 5, 2...
minimumspanningtree
maximumweightmatching_diff_0_26_60215a1068
[ { "content": "You are given an **undirected graph** with 5 vertices, labeled from `0` to `4`.\n\nThe graph contains the following undirected edges. Each edge is represented as a tuple `(u, v, w)`, meaning an undirected edge **connecting vertex `u` to vertex `v` with weight `w`**:\n(0, 3, 4)\n(2, 4, 1)\n(1, 4, 2...
maximumweightmatching
maximum_subsequencenum_diff_1_3_ab9957b07a
[ { "content": "We want to obtain a sequence of length 3 + 3 = 6 from an initial sequence of length 3 by appending 3 integers, each in [0, 2). The initial sequence of length 3: 0 1 0\n\nTry your best to maximize the number of essentially different subsequences of the final sequence.\nSubsequence: picking some (>=...
maximum
gridbfs_diff_1_24_289cd53e1c
[ { "content": "You are given a 5 × 3 grid. Each cell contains `0`, `1`, or `X`. For each cell, compute its **shortest distance** to any cell containing `1`, where distance is defined as the minimum number of steps required to move from one cell to another under the following rules:\n1. You may move **up**, **dow...
gridbfs
polynomialfactorization_diff_2_7_6116d874cd
[ { "content": "You are given a degree-5 polynomial: (x - a_1)...(x - a_5) = (75) * x^1 + (-50) * x^2 + (-28) * x^3 + (2) * x^4 + (1) * x^5\n\nYour task is to find any valid set of integers `a_1, ..., a_5` (not necessarily distinct) such that the product of the linear factors on the left expands to match the give...
polynomialfactorization
longest_matchingsubsequence_diff_2_17_9304b3d82b
[ { "content": "You are given an array `A` of length 5, indexed from 0 to 4. The array is as follows:\nA[0]=5\nA[1]=3\nA[2]=1\nA[3]=4\nA[4]=3\n\nYour task is to select a **strictly increasing sequence of indices** `i_1, i_2, ..., i_k` (0 ≤ i_1 < i_2 < ... < i_k < 5) such that:\n- Let B[1] = A[i_1], B[2] = A[i_2],...
longest
numberpartitioncounting_diff_2_0_9fa1c270ba
[ { "content": "You are given a positive integer 13. Your task is to divide it into exactly 13 **non-empty** positive integers such that:\n\n- The **sum** of the 13 parts is exactly 13,\n- The **order does not matter** — that is, two partitions are considered the same if they contain the same numbers, regardless ...
numberpartitioncounting
path_nogoingback_counting_diff_0_1_cf4d4e6a17
[ { "content": "You are given an **undirected graph** with 6 vertices labeled from `0` to `5`. The graph contains the following undirected edges (no repeated edges): \n(1, 3)\n(0, 2)\n(4, 5)\n(1, 5)\n(0, 3)\n\nPlease count the number of paths from vertex `0` to vertex `5` that satisfy the following conditions:\n...
path
axis_kcenter_diff_0_0_2b5b3e7a40
[ { "content": "You are given 4 points on a line, labeled from 0 to 3. Their positions (from left to right) are: 1 8 13 16\n\nPlease select a set of 2 distinct points. Try your best to minimize the total distance from all points to their nearest selected point (the distance is the absolute difference between posi...
axis
prefixconcatenation_diff_0_31_c8f1b072d7
[ { "content": "Define $Concatenate(n)$ as the number formed by concatenating all positive integers from $1$ to $n$ in order. For example, when $n = 12$, $Concatenate(12) = 123456789101112$\n\nYour task is to compute $Concatenate(2) \\bmod 492391$.\n\n**Output Format:** Your final answer should be a **single inte...
prefixconcatenation
bezoutidentity_diff_2_25_98cd627626
[ { "content": "You are given an array of length 4, denoted as A[1], ..., A[4]. Please find **integers** X[1], ..., X[4] such that the value of S = A[1] * X[1] + ... + A[4] * X[4] satisfies the condition: **S > 0**. Try your best to **minimize the value of S** while meeting this condition.\n\nA: -62, -74, -98, 50...
bezoutidentity
maximum_independentset_tree_diff_1_28_2349fd6d6b
[ { "content": "You are given a **tree** (i.e., a connected undirected graph with no cycles) with 5 vertices, labeled from `0` to `4`.\n\nThe tree contains the following 5 - 1 = 4 undirected edges. Each edge is represented as a tuple `(u, v)`, meaning there is an undirected edge **connecting vertex `u` to vertex ...
maximum
coloringcounting_diff_0_13_c541400b6a
[ { "content": "You are given an **undirected graph** with 4 vertices, labeled from `0` to `3`. The graph contains the following undirected edges:\n(2, 3)\n(0, 3)\n(0, 2)\n\nYou are also given an array `R` of length 4, where `R[u]` denotes the **maximum allowed color** for vertex `u`:\nR[0]=4\nR[1]=0\nR[2]=2\nR[3...
coloringcounting
circulatingdecimalcounting_diff_2_7_9900e17c23
[ { "content": "Please count how many **distinct pure repeating decimals** (in terms of numeric value) exist in base $5$, that can be written as a reduced fraction $\\frac{x}{y}$ where $1 \\le x \\le 6$ and $1 \\le y \\le 3$, with $x$ and $y$ being integers.\nA number is called a **pure repeating decimal** if and...
circulatingdecimalcounting
pairmoreonecounting_diff_0_25_5d16600e72
[ { "content": "Please count the number of pairs of binary strings (S, T) such that:\n- The length of S is 9 = 4 + 5, and the length of T is 4.\n- The number of 1s in S is strictly greater than the number of 1s in T.\n\nPlease output the result modulo 10^2.", "role": "user" }, { "content": "<think> \...
pairmoreonecounting
divisorflipexpectation_diff_1_24_0a1afaa0bd
[ { "content": "You are given 4 lights labeled from 1 to 4, each in an initial state: `1` (on) or `0` (off). The initial state is:\nLight 1: 1\nLight 2: 1\nLight 3: 0\nLight 4: 0\n\nEach light can be toggled by pressing switches. There are 4 switches, and pressing switch `i` will **toggle the state** of all light...
divisorflipexpectation
weightedbinarytree_diff_0_1_641aa16977
[ { "content": "You are given a binary tree with 3 nodes, labeled from 0 to 2.\nThe **in-order traversal** of the tree is: `0, 1, ..., 2` — that is, the in-order sequence is fixed in increasing order of node labels.\n\nEach node `i` has an associated score `d_i` (where `0 ≤ i < 3`), given as:\nd_0=2\nd_1=5\nd_2=1...
weightedbinarytree
vertex_kcenter_diff_0_0_1453b75a08
[ { "content": "You are given an **undirected connected graph** with 4 vertices, labeled from `0` to `3`.\n\nThe graph contains the following undirected edges. Each edge is represented as a tuple `(u, v, w)`, meaning an undirected edge **connecting vertex `u` to vertex `v` with weight `w`**:\n(1, 3, 5)\n(1, 2, 4)...
vertex
countdownequal_diff_2_14_7c13112817
[ { "content": "You are given the following numbers: 4 5 5 5 2\nYour task is to create a valid mathematical expression that evaluates to the target number: **13**.\n\nConstraints:\n- Use **each number exactly once**\n- Only these basic arithmetic operations are allowed: +, -, *, /\n- You may use **parentheses** t...
countdownequal
nextpalindromic_diff_1_25_0608962611
[ { "content": "Please find the **smallest palindromic number** that is greater than 387.", "role": "user" }, { "content": "First, I need to understand what a palindromic number is. A palindromic number reads the same forwards and backwards (like 121, 777, etc.). \n\nThe user wants the smallest palind...
nextpalindromic
boundedintervalintersection_diff_0_20_b5fa564d64
[ { "content": "An interval [l, r]'s length is defined as r - l. The length of an **empty intersection** is considered to be 0. The **intersection** of a set of intervals is the range covered by all of them simultaneously.\n\nYou are given 3 intervals:\n[38, 71]\n[25, 66]\n[43, 46]\n\nPlease count how many **non-...
boundedintervalintersection
crt_diff_1_12_dfbb464bcf
[ { "content": "You are given a system of 2 modular congruences:\nx ≡ 1 (mod 5)\nx ≡ 2 (mod 4)\n\nYour task is to find **any non-negative integer x** that satisfies all of the above congruences.\n\n**Output Format:** Your output should be a **single integer x** that satisfies all the equations.", "role": "use...
crt
longestpath_diff_1_2_3616b0a045
[ { "content": "You are given a **directed graph** with 5 vertices, labeled from `0` to `4`.\n\nThe graph contains the following directed edges. Each edge is represented as a tuple `(s, t, w)`, meaning there is a directed edge **from vertex `s` to vertex `t` with weight `w`** :\n(1, 2, 6)\n\nYour task is to find ...
longestpath
kingsorting_diff_2_30_dbec9c4847
[ { "content": "You are given `5 + 1 = 6` pairs of integers: `(A[0], B[0])`, `(a[1], b[1])`, `(a[2], b[2])`, ..., `(a[5], b[5])`\n(A[0], B[0]) = (9, 5)\n(a[1], b[1]) = (10, 1)\n(a[2], b[2]) = (10, 4)\n(a[3], b[3]) = (5, 1)\n(a[4], b[4]) = (7, 7)\n(a[5], b[5]) = (3, 2)\n\nYour task is to **rearrange the 5 pairs** ...
kingsorting
maximumweightmatching_diff_0_29_02f82bc1bf
[ { "content": "You are given an **undirected graph** with 5 vertices, labeled from `0` to `4`.\n\nThe graph contains the following undirected edges. Each edge is represented as a tuple `(u, v, w)`, meaning an undirected edge **connecting vertex `u` to vertex `v` with weight `w`**:\n(0, 1, 5)\n(1, 4, 1)\n(2, 4, 3...
maximumweightmatching
treedynamic_xorzeropath_diff_2_8_ad462dfd9a
[ { "content": "You are given a **tree** (i.e., a connected undirected graph with no cycles) with 5 vertices labeled from `0` to `4`.\n\nThe tree has the following 4 undirected edges. Each edge is represented as a tuple `(u, v, w)`, meaning there is an undirected edge between vertex `u` and vertex `v` with weight...
treedynamic
minimum_maxslicer_diff_1_18_50719055a1
[ { "content": "You are given an array A of length 5. The values are as follows (indexing starts at 0):\nA[0]=4\nA[1]=15\nA[2]=11\nA[3]=8\nA[4]=7\n\nYou may divide these items (in order) into 3 **consecutive batches**. Let end[1], end[2], ..., end[3] (0 <= end[1] < end[2] < ... < end[3] = 5 - 1 = 4) represent the...
minimum
pcppermutation_diff_2_8_6a6c5669b6
[ { "content": "You are given two arrays of strings, `A` and `B`, each containing 5 strings:\nA[0]=a B[0]=bb\nA[1]=b B[1]=aab\nA[2]=abbb B[2]=a\nA[3]=a B[3]=b\nA[4]=a B[4]=a\n\nFind a permutation p_0, ..., p_4 of the indices `0` to `4` such that: `A[p_0] + ... + A[p_4]` is equal to `B[p_0] + ... + B[p_4]` (here, ...
pcppermutation
threevertexcyclecounting_diff_2_0_cf48679c3b
[ { "content": "You are given an **undirected graph** with 7 vertices, labeled from `0` to `6`.\nThe graph contains the following undirected edges:\n(1, 4)\n(5, 6)\n(0, 3)\n(1, 5)\n(1, 2)\n(3, 4)\n(2, 4)\n(0, 6)\n(2, 3)\n(0, 5)\n(3, 5)\n(1, 3)\n(2, 5)\n(0, 4)\n(0, 2)\n\nPlease count the number of distinct **three...
threevertexcyclecounting
minimum_maxslicer_diff_0_11_dd289969a3
[ { "content": "You are given an array A of length 4. The values are as follows (indexing starts at 0):\nA[0]=18\nA[1]=15\nA[2]=15\nA[3]=17\n\nYou may divide these items (in order) into 3 **consecutive batches**. Let end[1], end[2], ..., end[3] (0 <= end[1] < end[2] < ... < end[3] = 4 - 1 = 3) represent the last ...
minimum
salesmanfatigue_diff_2_23_be11f090e7
[ { "content": "You are given 5 pairs of integers `(S[i], A[i])` for `0 <= i < 5`, provided as:\nS[0]=1 A[0]=7\nS[1]=1 A[1]=7\nS[2]=3 A[2]=9\nS[3]=3 A[3]=6\nS[4]=5 A[4]=3\n\n**Note:** The array `S` is sorted in non-decreasing order: `S[0] <= S[1] <= ... <= S[4]`\n\nPlease select k distinct pairs `i_1, i_2, ..., i...
salesmanfatigue
pairmoreonecounting_diff_2_26_20b3b7b3fc
[ { "content": "Please count the number of pairs of binary strings (S, T) such that:\n- The length of S is 16 = 13 + 3, and the length of T is 13.\n- The number of 1s in S is strictly greater than the number of 1s in T.\n\nPlease output the result modulo 10^4.", "role": "user" }, { "content": "Let's i...
pairmoreonecounting
fbi_binarytree_diff_2_7_0d4866c49b
[ { "content": "We classify binary strings made up of only `0` and `1` into three types:\n- A string consisting of only `0`s is called a **B-string**.\n- A string consisting of only `1`s is called an **I-string**.\n- A string that contains both `0` and `1` is called an **F-string**.\n\nAn **FBI tree** is a binary...
fbi
axis_kcenter_diff_0_30_c2f8dbf3d2
[ { "content": "You are given 4 points on a line, labeled from 0 to 3. Their positions (from left to right) are: 0 6 9 19\n\nPlease select a set of 3 distinct points. Try your best to minimize the total distance from all points to their nearest selected point (the distance is the absolute difference between posit...
axis
treedynamic_xorzeropath_diff_1_5_35c3887ea7
[ { "content": "You are given a **tree** (i.e., a connected undirected graph with no cycles) with 4 vertices labeled from `0` to `3`.\n\nThe tree has the following 3 undirected edges. Each edge is represented as a tuple `(u, v, w)`, meaning there is an undirected edge between vertex `u` and vertex `v` with weight...
treedynamic
gridbfs_diff_1_21_b03b1b9325
[ { "content": "You are given a 3 × 5 grid. Each cell contains `0`, `1`, or `X`. For each cell, compute its **shortest distance** to any cell containing `1`, where distance is defined as the minimum number of steps required to move from one cell to another under the following rules:\n1. You may move **up**, **dow...
gridbfs
weightedbinarytree_diff_2_20_2f68444981
[ { "content": "You are given a binary tree with 5 nodes, labeled from 0 to 4.\nThe **in-order traversal** of the tree is: `0, 1, ..., 4` — that is, the in-order sequence is fixed in increasing order of node labels.\n\nEach node `i` has an associated score `d_i` (where `0 ≤ i < 5`), given as:\nd_0=2\nd_1=3\nd_2=1...
weightedbinarytree
futoshikipuzzle_diff_2_29_1bc3c31340
[ { "content": "You are given a 5 × 5 matrix. Some cells are already filled with integers in the range [0, 4], and the rest are empty (denoted by `-1`). Please fill the empty cells with integers in the same range such that:\n- Each **row** and each **column** contains all integers from `0` to `4` **exactly once**...
futoshikipuzzle
stringpartitionshuffle_diff_1_10_f6a9c668f0
[ { "content": "You are given a string S of length 5 (0-indexed): 11010\n\nPlease find 3 intervals [L[1], R[1]), ..., [L[3], R[3]) such that:\n- Each interval [L[i], R[i]) is non-empty and disjoint.\n- The intervals together cover the entire string S (each index appears in exactly one interval).\n- Concatenating ...
stringpartitionshuffle
randomrangemaxexpectation_diff_0_11_d78e73b6d7
[ { "content": "You are given an array of 3 integers: 3 3 1\n\nYou will perform 2 operations in order. In each operation, you uniformly select a subarray (a contiguous segment of the array) at random from all 3 × (3 + 1) / 2 possible subarrays. Then, all elements in that subarray are changed to the **maximum** va...
randomrangemaxexpectation
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
5