question stringlengths 716 2.93k | options listlengths 4 8 | answer stringclasses 8
values | id stringlengths 24 24 | source_question_id stringlengths 30 30 | num_choices int64 4 8 |
|---|---|---|---|---|---|
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"circles.append((-r, idx))\ncircles.sort()\nselected = [circle[1] for circle in circles[-k:]]",
"circles.append((r * r, idx))\ncircles.sort()\nselected = [circle[1] for circle in circles[:k]]",
"circles.append((-r, idx))\ncircles.sort(reverse=True)\nselected = [circle[1] for circle in circles[:k]]",
"circles.... | D | code-272411-6ddfc9406b0c | code-question-92ea54979a348d36 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"comb = fact[M] * inv_fact[K] % MOD\ncomb = comb * inv_fact[M - K] % MOD\nans = comb * fact[E] % MOD\nans = ans * fact[O] % MOD\nprint(ans)",
"comb = fact[M] * inv_fact[X] % MOD\ncomb = comb * inv_fact[M - X] % MOD\nans = comb * fact[E] % MOD\nans = ans * fact[O] % MOD\nprint(ans)",
"comb = fact[M] * inv_fact[X... | B | code-069498-008d954fecaa | code-question-15f5fb07195e5eb5 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if task in seen:\n seen.remove(task)\n if len(dq) > k:\n old_task = dq.pop()\n seen.discard(old_task)\n dq.appendleft(task)",
"if task not in seen and len(dq) >= k:\n dq.popleft()\n if task not in seen:\n dq.appendleft(task)\n see... | E | code-194204-1ec6a36dfa0e | code-question-c765aba4156836db | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"x = rem - b\n idx = bisect.bisect_left(s_list, x) - 1\n if idx >= 0:\n c = s_list[idx]\n sum_bc = b + c\n if sum_bc > current_max:\n current_max = sum_bc",
"x = rem - b\n idx = bisect.bisect_left(s_list, x)\n ... | C | code-231570-ee670eadb767 | code-question-b0c17a01304f0559 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for i in range(n):\n flipped = 1 - int(s[i])\n current = 1\n if i > 0 and int(s[i-1]) != flipped:\n current += left[i-1]\n if i < n-1 and int(s[i+1]) != flipped:\n current += right[i+1]\n if current > max_len:\n max_len = current",
"for i in range(n):\n flipped = 1 - int(s[... | A | code-063932-407f8c59b02e | code-question-230ab0f4dc304acf | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"prefix = [0]\n total = 0\n for delta in deltas:\n total -= delta\n prefix.append(total)\n idx = bisect.bisect_right(times, time)\n print(prefix[idx])",
"prefix = [0]\n current = 0\n for delta in deltas:\n current += delta\n prefix.append(current)\n idx = bisect.bi... | D | code-134940-7f1cdd2c0bca | code-question-f5cfccf3ce979ed6 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for i in range(2, sqrt_n + 1):\n if n % i == 0:\n sum_div += i\n other = n // i\n if other != i:\n sum_div += other",
"for i in range(2, sqrt_n + 1):\n if i % n == 0:\n sum_div += i\n other = n // i\n if other != i:\n ... | A | code-268636-ab3a9eef4a16 | code-question-44d6b4549c4fc984 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for i in range(1, n):\n if a[i] < a[i + 1]:\n current += 1\n else:\n current = 1\n if current > max_len:\n max_len = current",
"for i in range(1, n):\n if a[i] < a[i - 1]:\n current = 2\n else:\n current = 1\n if current > max_len:\n max_len = current",... | C | code-014791-13a55389b875 | code-question-d876c135e706c7d3 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if n <= m:\n starting = 'R'\n other = 'B'\nelse:\n starting = 'B'\n other = 'R'",
"if n > m:\n starting = 'B'\n other = 'R'\nelse:\n starting = 'R'\n other = 'B'",
"if n < m:\n starting = 'R'\n other = 'B'\nelse:\n starting = 'B'\n other = 'R'",
"if m > n:\n starting = ... | F | code-231952-ca7e49958661 | code-question-1c7201065b42c76c | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"current = a\n while current <= r:\n if current >= l:\n count += 1\n if current > r // 3:\n break\n current *= 5",
"current = 1\n while current * a <= r:\n if current * a > l:\n count += 1\n if current >= r // 5:\n break\n ... | D | code-070232-0c2e59495bc2 | code-question-1781ba454a8baf64 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"total = 0\n for child in range(2, n + 1):\n s = size[child]\n other = n - s\n term1 = s * (s - 1) // 2\n term2 = other * (other - 1) // 2\n total += 2 * term1 * term2\n print(total)",
"total = 0\n for child in range(2, n + 1):\n s = size[child]\n other = ... | A | code-248276-91eca5cd3c3a | code-question-e783e45986bb1d2e | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"while current_sum > max_height and left < right:\n current_sum -= h[left]\n left += 1\n window_length = right - left + 1\n if window_length >= max_len:\n max_len = window_length",
"while current_sum > max_height:\n current_sum -= h[right]\n right -= 1\n window_length =... | C | code-182856-7d2b09c232ed | code-question-65d042556fdf36d7 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"fib = [0, 1]\nfor i in range(2, 200):\n fib.append(fib[i-1] + fib[i-2])",
"fib = [0, 1]\nfor i in range(201):\n fib.append(fib[i-1] + fib[i-2])",
"fib = [0, 1]\nfor i in range(2, 201):\n fib.append(fib[i-1] + fib[i-2])",
"fib = [0, 1]\nfor i in range(1, 201):\n fib.append(fib[i-1] + fib[i-2])",
... | C | code-066288-af9e76d7263a | code-question-30736789ad9a884a | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"titles = set()\nfor _ in range(m):\n title = input().strip()\n titles.add(title)\nsorted_titles = sorted(title)",
"titles = set()\nfor _ in range(m):\n title = input().strip()\n titles.add(title)\nsorted_titles = sorted(titles, key=len)",
"titles = {}\nfor _ in range(m):\n title = input().strip(... | G | code-188359-d22ad550fc97 | code-question-a32384c53125e6de | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if count == 0:\n print(q)\nelse:\n print(min(count * q, (count - 1) * p))",
"if count == 0:\n print(0)\nelse:\n cost1 = (count + 1) * p + q\n cost2 = count * q\n print(min(cost1, cost2))",
"if count == 0:\n print(q)\nelse:\n cost = min(q, p) * count\n print(cost)",
"if count <= 1:\... | E | code-238968-da07e1d0b0db | code-question-9ed3424a348293e9 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"result = 0\n for d in digits:\n result = (result * 2 + d) % MOD\n print(result)",
"result = digits[0] if digits else 0\n for d in digits:\n result = (result * 3 + d) % MOD\n print(result)",
"result = 0\n for d in reversed(digits):\n result = (result * 3 + d) % MOD\n print... | E | code-086958-de1ee28f52b5 | code-question-cee6248de3e70845 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if i + 3 <= n:\n substr3 = s_lower[i:i+3]\n if substr3 == 'cat':\n print(\"Alice\")\n break\n elif substr3 == 'dog':\n print(\"Bob\")\n break\n if i + 4 <= n:\n substr4 = s_lower[i:i+4]\n if substr4 == 'fish':\n print(\"Ch... | F | code-174256-8a8f48eb8b55 | code-question-aa317a18ea460000 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"current_sum_mod = 0\n seen = set()\n ans = 0\n for num in A:\n current_sum_mod = (current_sum_mod + num) % X\n if current_sum_mod in seen:\n ans += 1\n else:\n seen.add(current_sum_mod)\n print(ans)",
"current_sum_mod = 0\... | F | code-177759-310e56181dc7 | code-question-d18b51e77b6834b0 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"count = 0\nfor i in range(n):\n for j in range(m):\n if grid[i][j] == 0:\n directions = 0\n if has_left[i][j]:\n directions += 1\n if has_right[i][j]:\n directions += 1\n if has_up[i][j]:\n directions += 1\n ... | A | code-155479-6d1847ec61a2 | code-question-9115beac6f65f10d | 4 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"required = c[i] - 1\nif c[i-1] <= required:\n continue\ndelta = c[i-1] - required\nm = (delta + k - 1) // k\nsteps += m\nc[i-1] -= m * k",
"required = c[i-1] - 1\nif c[i] <= required:\n continue\ndelta = required - c[i]\nm = (delta + k - 1) // k\nsteps += m\nc[i] -= m * k",
"required = c[i-1] - 1\nif c[i... | D | code-166245-920824583028 | code-question-2f962129301f3963 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"required = set(chr(ord('a') + i) for i in range(k))\ncount = 0\nfor _ in range(n):\n s = input().strip()\n s_chars = set(s)\n if s_chars.issubset(required):\n count += 1",
"required = set(chr(ord('a') + i) for i in range(k+1))\ncount = 0\nfor _ in range(n):\n s = input().strip()\n s_chars =... | D | code-101555-3f423c620573 | code-question-07677a53872ffb68 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"total = S0 * k\nnumerator_part = (n - 1) * total\ndenominator = n - 1\ng = math.gcd(numerator_part, denominator)\nnumerator = numerator_part // g",
"numerator_part = (n - 1) * (k * S0 - (k - 1) // 2)\ndenominator = n\ng = math.gcd(numerator_part, denominator)\nnumerator = numerator_part // g",
"numerator_part ... | F | code-271622-14614a7904db | code-question-3daad0336d66a8ff | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if n % i == 0:\n exponent = 0\n while n % i == 0:\n exponent += 1\n n = n // i\n total *= (i ** (exponent + 1) + 1) // (i + 1)",
"if n % i == 0:\n exponent = 0\n while n % i == 0:\n exponent += 1\n ... | F | code-134789-6efcb05bff24 | code-question-b587d31074cf9756 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if count_odds == 0:\n print(total)\nelse:\n if total % 2 == 1:\n print(0)\n else:\n print(total - min_odd)",
"if count_odds == 0:\n print(0)\nelse:\n if total % 2 == 1:\n print(total - min_odd)\n else:\n print(total)",
"if count_odds == 0:\n print(0)\nelse:\n ... | D | code-078202-f8c1e9cbd4b2 | code-question-ca22100ea42386b0 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"dp[i] = (dp[i] + dp[i-1]) % MOD\n min_split[i] = min(min_split[i], min_split[j])\n current_length = 1\n if current_length > max_len:\n max_len = current_length",
"dp[i] = dp[j] % MOD\n min_split[i] = min_split[j] + 1\n current_length = i - j\n if current_lengt... | F | code-061509-d6a06e48ff51 | code-question-2ef44f1d2c8f50c0 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for num in schedule:\n if num == 0 and found:\n break\n if num == 1:\n current += 1",
"for num in schedule:\n if num == 1:\n current += 1\n found = True\n else:\n break",
"for num in schedule:\n if num == 0:\n if found:\n current = 0\n ... | D | code-044440-3fccf43d80ab | code-question-28402188791537b1 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"c_even = n // 2\nc_odd = n - c_even\nr_even = m // 2\nr_odd = m - r_even\npossible_pairs = min(c_even, r_even) + min(c_odd, r_odd)\nprint(possible_pairs)",
"c_even = sum(1 for num in c if num % 2 == 0)\nc_odd = n - c_even\nr_even = sum(1 for num in r if num % 2 == 0)\nr_odd = m - r_even\npossible_pairs = min(c_e... | G | code-229848-93dd268e42af | code-question-95cd492057a6ec85 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"result = []\nfor c in s:\n if c in lower_letters and c in upper_letters:\n result.append(c)",
"result = []\nfor c in s:\n base = c.lower()\n if base not in lower_letters or base.upper() not in upper_letters:\n result.append(c)",
"result = []\nfor c in s:\n base = c.lower()\n if bas... | G | code-272765-7f38875f165e | code-question-e9e07016042f5087 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for i in range(1, n):\n current_val = a[i]\n prev = adjusted[i-1]\n new_val = max(current_val, prev)\n adjusted[i] = new_val\n total += new_val - a[i]",
"for i in range(1, n):\n current_val = a[i]\n prev = adjusted[i-1]\n new_val = min(current_val, prev)\n ... | D | code-064062-4bec1fb39e1e | code-question-06b74ce34896696b | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if n <= 1:\n return False\n if n == 2:\n return True\n if n % 2 == 0:\n return False\n max_divisor = int(n ** 0.5) + 1\n for d in range(3, max_divisor, 2):\n if n % d == 0:\n return False",
"if n <= 1:\n return False\n if n == 2:\n return True\n... | A | code-158789-8b1ede5bc5ff | code-question-deb79dc69b3f08e5 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"max_sum = column_sums[0]\ncolumn = 0\nfor i in range(1, n):\n if column_sums[i] < max_sum:\n max_sum = column_sums[i]\n column = i",
"max_sum = column_sums[-1]\ncolumn = n - 1\nfor i in range(n - 2, -1, -1):\n if column_sums[i] > max_sum:\n max_sum = column_sums[i]\n column = i"... | D | code-087214-011f261e42f5 | code-question-ef2fb94084a86a7c | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"x_max = min(a, d)\nfor x in range(x_max + 1):\n remaining_laptops = d - x\n y_max = min(b, c, remaining_laptops)\n total = e * y_max + f * x\n if total > max_total:\n max_total = total",
"x_max = min(a, d)\nfor x in range(1, x_max + 1):\n remaining_laptops = d - x\n y_max = min(b, c, rem... | E | code-033092-7e18dcdb8141 | code-question-f03bc28e445bae2b | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"i = j = count = 0\n while i < len(boxes) and j < len(bags):\n if boxes[i] <= bags[j]:\n count += 1\n j += 1\n else:\n i += 1\n return count",
"i = j = count = 0\n while i < len(boxes) and j < len(bags):\n if bags[j] <= boxes[i]:\n count +=... | C | code-072596-bd744a126195 | code-question-cf449aeb8316ed5f | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for freq in count.values():\n if freq % 2 != 0:\n continue\n odd_count += 1",
"for freq in count.values():\n if freq % 2 != 0:\n odd_count += 1",
"for freq in count.values():\n if freq % 2 != 0:\n odd_count += 1\n break",
"for freq in count.values():\n if (freq & 1)... | B | code-272810-9d5c8cf949f3 | code-question-ebae722d8f4966f8 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if (i, j) in blocked:\n dp[i][j] = 0\n else:\n val = 0\n if i > 0 and j > 0:\n val = dp[i-1][j] or dp[i][j-1]\n elif i > 0:\n val = dp[i-1][j]\n elif j > 0:\n val = dp[i][j... | E | code-117661-8732355ae4df | code-question-05aec5c5111b2784 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"vertical = True\n for c in range(n):\n col = [matrix[r][c] for r in range(n)]\n if col != col[::-1]:\n vertical = False\n break",
"vertical = True\n for r in range(n):\n if matrix[r][0] != matrix[r][n-1]:\n vertical = Fal... | G | code-261387-d9fa24ee9da8 | code-question-a7641e034827b967 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if N > 0:\n if N % 2 == 0:\n print(\"Odd Number!\")\n else:\n print(\"Even Number!\")\n else:\n print(\"Invalid Number!\")",
"if N >= 2:\n if N % 2 == 0:\n print(\"Even Number!\")\n else:\n print(\"Odd Number!\")\n else:\n ... | D | code-268549-1c3cf2733a73 | code-question-658c143de322ccd6 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"sorted_participants = sorted(participants, key=lambda x: (-x[1], x[0]))\nfor p in sorted_participants:\n print(p[1])",
"sorted_participants = sorted(participants, key=lambda x: (-x[1], -x[0]))\nfor p in sorted_participants:\n print(p[0])",
"sorted_participants = sorted(set(participants), key=lambda x: (-... | F | code-110858-9443d752ee5e | code-question-90fa910dc8a68a01 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"seminars.sort(key=lambda x: x[1])\ncount = 0\nprev_end = 0\nfor s, e in seminars:\n if s >= prev_end:\n count += 1\n prev_end = e",
"seminars.sort(key=lambda x: x[1])\ncount = 0\nprev_end = 0\nfor s, e in seminars:\n if s >= prev_end:\n count += 1\n prev_end = s",
"seminars.so... | A | code-250343-855151296a3e | code-question-c4f4aea27ea5767a | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"binary = bin(N)[2:]\n return 0 if '00' in binary or '11' in binary else 1",
"binary = bin(N)[2:]\n return 1 if '00' in binary or '11' in binary else 0",
"binary = bin(N)[2:]\n return 1 if len(set(binary)) == 2 else 0",
"binary = bin(N)[2:]\n return 0 if '01' in binary or '10' in binary else 1",
... | A | code-014250-16141e187d27 | code-question-fe2d822a865fe3ab | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"s = 2 * h_i - 1\n if k_i % s != 0:\n print(\"NO\")\n else:\n h_candidate = k_i // s\n if 1 <= h_candidate <= h_i:\n print(f\"YES {h_candidate}\")\n else:\n print(\"NO\")",
"s = h_i * h_i\n if k_i != s:\n print(\"NO\")\n else:\n h_candida... | A | code-132111-d883bdbca761 | code-question-7b7a85e516f605fd | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"angle = math.pi / (2 * n)\nsin_angle = math.sin(angle)\nR = (r * sin_angle) / (1 + sin_angle)",
"angle = math.pi / n\nsin_angle = math.sin(angle)\nR = (r * (1 - sin_angle)) / sin_angle",
"angle = math.pi / n\nsin_angle = math.sin(angle / 2)\nR = (r * sin_angle) / (1 - sin_angle)",
"angle = math.pi / n\ntan_a... | F | code-007577-57fef86be044 | code-question-8b0a014f5c9be2d1 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if x > 0:\n x -= 1\n elif y > 0:\n y -= 1\n s += 1\n elif s > 0:\n y -= 1\n else:\n denied += 1",
"if x > 0:\n x -= 1\n elif s > 0:\n s -= 1\n elif y > 0:\n y -= 1\n s += 1\n ... | F | code-118588-8230d46663e1 | code-question-281644c7fb21a3e5 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"m = 0\n for num in arr:\n if num % k != 0:\n m += 1\n count = (1 << m) - 1\n print(count)",
"m = 0\n for num in arr:\n if num % k == 0:\n m += 1\n count = (1 << m)\n print(count)",
"m = 0\n for num in arr:\n ... | G | code-166295-f220eae5807a | code-question-a5ea609d433c2912 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for i in range(m):\n total = sum(matrix[i][j] * b[j] for j in range(n))\n print(total)",
"for row in matrix:\n total = sum(x * y for x, y in zip(b, b))\n print(total)",
"for row in matrix:\n total = sum(x + y for x, y in zip(row, b))\n print(total)",
"for row in matrix:\n total = sum(row... | G | code-148240-456cac68e4e2 | code-question-dc6a1299c387a063 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"count = sum(1 for distance in distances if distance == d)\nprint(count)",
"count = sum(1 for i in range(p) if i >= d)\nprint(count)",
"count = sum(1 for distance in distances if distance >= p)\nprint(count)",
"count = sum(1 for distance in distances if distance >= d - 1)\nprint(count)",
"count = 1 if sum(d... | F | code-116116-e111df1bf703 | code-question-eaebd1cab19c7aed | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if current_sum + word_len + (1 if current_line else 0) > M:\n lines.append(' '.join(current_line))\n current_line = [word]\n current_sum = word_len\nelse:\n current_line.append(word)\n current_sum += word_len + 1",
"if current_sum < M - word_len:\n current_line.append(word)\n current_sum += ... | C | code-038815-a15d4ab49819 | code-question-ca0c8c47e27d377d | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"a = end[i-1][j] if i > 0 else 0\n b = end[i][j-1] if j > 0 else 0\n start = a + b\n end[i][j] = start + times[i][j]",
"a = end[i-1][j] if i > 0 else 0\n b = 0\n start = max(a, b)\n end[i][j] = start + times[i][j]",
"a = end[i-1][j] if i > 0 else... | D | code-025353-9e9ad59cbd02 | code-question-51043904a5bca8d3 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for row in a:\n candidate = [total_xor[j] ^ row[j] for j in range(m)]\n if any(c == 1 for c in candidate):\n print(\"YES\")\n exit()\nprint(\"NO\")",
"for row in a:\n candidate = [total_xor[j] ^ row[j] for j in range(m)]\n if candidate == total_xor:\n print(\"YES\")\n exit... | E | code-186861-53f05ff34c6e | code-question-eb6730bfca8a2800 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"count = 0\n for p in positions:\n if a < p < b:\n count += 1",
"count = 0\n for p in range(n):\n if a <= p <= b:\n count += 1",
"count = 0\n for p in positions:\n if a <= p <= b:\n count += 1",
"count = 0\n for p in positions:\n if a <=... | C | code-254520-2cb62a8e017b | code-question-8bafe616b81f298d | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"ones = s.count('1')\nkey = ones\nif key not in groups:\n groups[key] = []\ngroups[key].append(idx)",
"ones = [j for j, c in enumerate(s) if c == '1']\nkey = tuple(set(ones))\nif key not in groups:\n groups[key] = []\ngroups[key].append(idx)",
"ones = [j for j, c in enumerate(s) if c == '0']\nones.sort()\... | F | code-156592-a97c38739987 | code-question-a01489f44ce9b34d | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for x in range(N, 0, -1):\n if not has_digit(N, D):\n print(N)\n break",
"x = N\n while x >= 0:\n if has_digit(x, D):\n print(x)\n break",
"for x in range(N, 0, -1):\n if has_digit(x, D):\n print(x)\n break",
"for x in ... | F | code-247761-9a83bdfb98ef | code-question-931b4059ecbd4ab1 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"count = 0\nfor string in strings:\n for c in string:\n if c not in emma_chars:\n count += 1\n break",
"count = 0\nfor string in strings:\n if string in s:\n count += 1",
"count = 0\nfor string in strings:\n for c in string:\n if c in emma_chars:\n ... | F | code-257203-038a56fde9bd | code-question-acc5053fdaba834b | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"if i >= 1:\n alice_ways[i] += alice_ways[i - 1]\n if i >= 2:\n alice_ways[i] += alice_ways[i - 3]\n if i >= 4:\n alice_ways[i] += alice_ways[i - 4]",
"if i >= 0:\n alice_ways[i] += alice_ways[i]\n if i >= 1:\n alice_ways[i] += alice_ways... | E | code-252604-bb79e14a1384 | code-question-ccb1b28a5bd6d2eb | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for j in range(n_i - 1):\n p = (j + 1) % k\n gp = g[p]\n next_r = (r + gp) % m\n if r >= next_r:\n count += 1\n r = next_r",
"for j in range(n_i - 1):\n p = j % k\n gp = g[p]\n current_sum += gp\n next_r = current_sum % m\n if r > next_r:\n count += 1\n r = current_... | H | code-203632-a9f77501ec59 | code-question-72ca19486283f619 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"pair_count = [0] * k\n for r1 in range(k):\n for r2 in range(k):\n s = (r1 - r2) % k\n pair_count[s] = (pair_count[s] + cnt[r1] * cnt[r2]) % MOD\n triplet_count = 0\n for s in range(k):\n r3 = s % k\n triplet_count = (triplet_count + pair_count[s] * cnt[r3]) % MO... | D | code-185333-f51cc0cd1a44 | code-question-92b41c1b1d20fae3 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"count1 = b // q1 - (a - 1) // q1\n count2 = b // q2 - (a - 1) // q2\n count_both = b // lcm_val - (a - 1) // lcm_val\n total = count1 + count2 - count_both\n total_numbers = b - a\n percentage = (total / total_numbers) * 100",
"count1 = b // q1 - (a - 1) // q1\n count2 =... | F | code-274977-5c31eeae5f26 | code-question-2e83cc373bf05623 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"all_chests = set(range(1, total + 1))\nnonA = list(all_chests - set(a))\nresult = []\nfor i in range(n):\n result.append(a[i])\n result.append(nonA[i])",
"all_chests = set(range(1, total + 1))\nnonA = sorted(all_chests - set(a))\nresult = []\nfor i in range(n):\n result.append(nonA[i])\n result.appen... | E | code-252785-d91ac0839a26 | code-question-2846ac5dbde30c4e | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"for i in range(m):\n start = i * 3\n group = windows[start:start+3]\n if '1' in windows:\n total += 1",
"for i in range(m):\n start = i * 3\n group = windows[start:start+3]\n if group.count('1') == 3:\n total += 1",
"for i in range(m):\n st... | D | code-110475-9eb4f9967f95 | code-question-88436cc0deb1fd12 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"prefix_sum = [0] * (n + 1)\n for i in range(1, n+1):\n prefix_sum[i] = prefix_sum[i-1] + (1 if s[i-1] == '0' else 0)\n for __ in range(q):\n l = int(data[ptr])\n r = int(data[ptr+1])\n ptr += 2\n total = prefix_sum[r] - prefix_sum[l-1]\n ... | G | code-000381-007cd502f43a | code-question-549c51c8f09454f7 | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"sorted_T = sorted(T)\nfor combo in itertools.permutations(sorted_T, m):\n print(''.join(combo))",
"sorted_T = T\nfor combo in itertools.combinations(sorted_T, m):\n print(''.join(combo))",
"sorted_T = sorted(T, reverse=True)\nfor combo in itertools.combinations(sorted_T, m):\n print(''.join(combo))",
... | D | code-171484-bab9521dcbd7 | code-question-ff584870c627f414 | 7 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"unique_titles = set(titles)\nsorted_titles = sorted(unique_titles, key=len)\nprint(len(sorted_titles))\nfor title in sorted_titles:\n print(title)",
"unique_titles = set(titles)\nsorted_titles = sorted(titles)\nprint(len(sorted_titles))\nfor title in sorted_titles:\n print(title)",
"unique_titles = list(... | E | code-073765-e8f8611560bb | code-question-2b23997051532fdb | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"placed = False\n for i in range(len(stacks)):\n if stacks[i][-1] == num:\n placed = True\n break\n if stacks[i][-1] < num:\n stacks[i].append(num)\n placed = True\n break\n if not placed:\n stacks.append([num])",
"placed = False\n ... | G | code-054282-00b88f53f380 | code-question-8f3f272aea3ab8fc | 8 |
You are given a coding problem and its solution, with some parts of the solution replaced by [MASK]. Several candidate options are provided for the missing code. Carefully analyze the programming context and select the option that best fills in the [MASK]. Output the letter of the correct option in \boxed{}.
**Questio... | [
"sum_i = (r - l + 1) * (l + r) // 2\n sum_sq = (r * (r + 1) * (2 * r + 1) // 6) - (\n l * (l + 1) * (2 * l + 1) // 6\n )\n term2 = (sum_i + sum_sq) // 2\n total = term1 + term2",
"sum_i = ((l - 1) * l // 2) - (r * (r + 1) // 2)\n sum_sq = (\n (l - 1) * l * ... | F | code-223210-a2fd3f43d081 | code-question-d956689ad1e137b1 | 8 |
Xent GooseReason 0.7M
This is a reproducibly shuffled and benchmark-decontaminated derivative of
nvidia/Nemotron-Research-GooseReason-0.7M.
Splits
Each source subset has a training split plus validation and test splits containing
500 rows each. Holdouts are stratified by num_choices with largest-remainder
allocation, then every split is deterministically shuffled with seed 42.
| Source subset | Original | Raw exact | Added by normalization | Invalid/mask removed | Retained |
|---|---|---|---|---|---|
| math | 235,836 | 165 | 526 | 28,289 | 206,856 |
| code | 281,793 | 0 | 0 | 336 | 281,457 |
| stem | 155,496 | 0 | 0 | 11,535 | 143,961 |
Published splits are math_train, math_val, math_test, code_train, code_val,
code_test, stem_train, stem_val, and stem_test.
Rows preserve question, options, and answer and add a stable row id, a
source_question_id, and num_choices. All rows derived from the same normalized source
question remain together. Validation and test are selected from singleton source-question
groups, while repeated-question groups remain in training.
Only rows containing exactly one [MASK] after the **Solution:** marker are retained.
Rows with no solution mask or multiple solution masks are recorded in
removed_invalid.jsonl and excluded before the stratified split is created.
Contamination policy
Every source question was extracted from the **Question:** section and compared against
all published splits of:
openai/gsm8k(train,test)hendrydong/hendrycks_math(train,test,math500)
Only exact equality after conservative presentation normalization is used. The normalizer applies Unicode NFKC, removes whitespace and punctuation through tokenization, drops presentation-only LaTeX commands, and folds ordinary prose words to lowercase. Numbers, operators, single-letter variable case, uppercase symbolic names, and content-bearing LaTeX commands are preserved. There is no fuzzy retrieval or similarity-based removal.
contamination_report.json contains aggregate results and
removed_contamination.jsonl records every removal and its matched benchmark rows.
removed_invalid.jsonl records malformed source rows removed before split assignment.
Reproduction
The preparation script lives in the associated project repository and uses source row
order plus seed 42. Source dataset revisions and library versions are recorded in
contamination_report.json.
License
The source dataset is licensed CC BY-NC 4.0. This derivative retains that license.
- Downloads last month
- 68