context listlengths 1 1 | gen_kwargs dict | repeat_idx int64 0 4 | request_idx int64 0 510 | task_name stringclasses 6
values | metadata dict | model_outputs stringlengths 10 191k |
|---|---|---|---|---|---|---|
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There are three cards with letters $\\texttt{a}$, $\\texttt{b}$, $\\texttt{c}$ placed in a row in some order. You can ... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 0 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | def check_cards(s):
if s == "abc":
return "YES"
elif s == "bac":
return "YES"
elif s == "acb":
return "YES"
elif s == "cba":
return "YES"
else:
return "NO"
if __name__ == "__main__":
import sys
input = sys.stdin.read
data = input().split()
t... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Slavic is preparing a present for a friend's birthday. He has an array $a$ of $n$ digits and the present will be the p... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 1 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | def max_product():
import sys
input = sys.stdin.read
data = input().split()
t = int(data[0])
index = 1
for _ in range(t):
n = int(data[index])
index += 1
a = list(map(int, data[index:index + n]))
index += n
max_product = 1
for i in range(n):
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given a strip of paper $s$ that is $n$ cells long. Each cell is either black or white. In an operation you can... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 2 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
In the fourth test case you can perform the following operations: $$\texttt{B}\color{red}{\texttt{BBBBB}} \to \color{red}{\texttt{BBBBB}}\texttt{B} \to \texttt{WWWWWWWW}$$
In the fifth test case you can perform the following operations: $$\color{red}{\texttt{B}}\texttt{W}\color{red}{\texttt{B}}\texttt{W}\color{red}{... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given a string $s$ of length $n$, consisting of lowercase Latin letters, and an integer $k$.\n\nYou need to ch... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 3 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | Here's the Python function to solve the given problem:
```python
def can_form_palindrome():
import sys
input = sys.stdin.read
data = input().split()
t = int(data[0])
index = 1
for _ in range(t):
n, k = int(data[index]), int(data[index + 1])
s = data[index + 2]
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given an array of integers $a_1, a_2, \\ldots, a_n$ and a number $k$ ($2 \\leq k \\leq 5$). In one operation, ... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 4 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | To solve the given problem, we need to determine the minimum number of operations required to make the product of the array elements divisible by \(k\). Here's a step-by-step approach:
1. **Input Parsing**: Read the number of test cases, and for each test case, read the size of the array \(n\) and the divisor \(k\). ... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Vanya and Vova are playing a game. Players are given an integer $n$. On their turn, the player can add $1$ to the curr... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 5 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | To solve the given problem, we need to determine the winner based on the given rules. Here is the Python function that implements the logic for determining the winner based on the integer \( n \):
```python
def determine_winner(n):
# If n is already divisible by 3, Vanya wins immediately
if n % 3 == 0:
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Alex is participating in the filming of another video of BrMeast, and BrMeast asked Alex to prepare 250 thousand tons ... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 6 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | Here's the Python function to solve the given problem:
```python
def max_weight_difference():
import sys
input = sys.stdin.read
data = input().split()
t = int(data[0])
index = 1
results = []
for _ in range(t):
n = int(data[index])
index += 1
weights = [int... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.A subarray is a continuous part of array.\n\nYarik recently found an array $a$ of $n$ elements and became very interes... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 7 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | Here's the Python function to solve the problem as described:
```python
def max_alternating_subarray_sum():
import sys
input = sys.stdin.read
data = input().split()
t = int(data[0])
results = []
for i in range(0, t * 3, 3):
n = int(data[i + 1])
arr = list(map(int, data[i + 2:i ... |
[
{
"content": "Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Yarik is a big fan of many kinds of music. But Yarik loves not only listening to music but also writing it. He likes e... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 8 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | def count_equal_combinations():
import sys
input = sys.stdin.read
inputs = input().split()
t = int(inputs[0])
index = 1
results = []
for _ in range(t):
n = int(inputs[index])
index += 1
a = list(map(int, inputs[index:index + n]))
index += n
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed array of strings details. Each element of details provides information about a given passenger compressed into a string of length 15.... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 9 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | Here's the Python function to solve the problem:
```python
def count_passengers_over_60(details):
count = 0
for detail in details:
age = int(detail[11:13])
if age > 60:
count += 1
return count
``` |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty:\n\nFrom each row ... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 10 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def maxMatrixScore(nums):
Assistant:
```python
def maxMatrixScore(nums):
score = 0
while nums:
max_val = 0
max_row = -1
for i, row in enumerate(nums):
max_row_val = max(row)
if max_row_val > max_val:
max_val = max_row_val
max_row... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed integer array nums of length n and an integer k. In an operation, you can choose an element and multiply it by 2.\nReturn the maximum... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 11 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def maxOrAfterOperations(nums: List[int], k: int) -> int: |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed integer array nums representing the score of students in an exam. The teacher would like to form one non-empty group of students with... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 12 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
Here's the function body for the given problem:
```python
def maxStrength(nums):
# Sort the array to handle negative and positive numbers effectively
nums.sort()
# If all numbers are zero, return 0
if len(nums) == 0:
return 0
# Remove all zeros as they don't contribute to the str... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed string s and a dictionary of words dictionary. You have to break s into one or more non-overlapping substrings such that each substri... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 13 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | . def minExtraChar(s: str, dictionary: list) -> int:
n = len(s)
dp = [0] * (n + 1)
for i in range(1, n + 1):
dp[i] = dp[i - 1] + 1
for word in dictionary:
if s[i - len(word):i] == word:
dp[i] = min(dp[i], dp[i - len(word)])
return dp[n] |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given an integer array prices representing the prices of various chocolates in a store. You are also given a single integer money, which represents you... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 14 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def minMoneyLeft(prices, money): ```python
def minMoneyLeft(prices, money):
min_price1 = min(prices)
prices.remove(min_price1)
min_price2 = min(prices)
total_cost = min_price1 + min_price2
leftover = money - total_cost
return leftover if leftover >= 0 else money
``` |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given two numeric strings num1 and num2 and two integers max_sum and min_sum. We denote an integer x to be good if:\n\nnum1 <= x <= num2\nmin_sum <= di... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 15 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def countGoodIntegers(num1: str, num2: str, min_sum: int, max_sum: int) -> int:
To solve this problem, we can use a dynamic programming approach with memoization to count the number of good integers between `num1` and `num2` that satisfy the given constraints. Here's a Python function that implements this approach:... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed array nums of length n.\nThe distinct difference array of nums is an array diff of length n such that diff[i] is equal to the number ... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 16 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def distinct_difference_array(nums):
# Your implementation here
pass
def distinct_difference_array(nums):
n = len(nums)
prefix_counts = [0] * n
suffix_counts = [0] * n
prefix_unique = set()
suffix_unique = set()
for i in range(n):
prefix_unique.add(nums[i])
prefix_c... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.There is a 0-indexed array nums of length n. Initially, all elements are uncolored (has a value of 0).\nYou are given a 2D integer array queries where queries[... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 17 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def solution(n, queries):
# Your implementation here
pass
def solution(n, queries):
nums = [0] * n
answer = []
for index, color in queries:
nums[index] = color
count = 0
for i in range(n - 1):
if nums[i] == nums[i + 1] and nums[i] != 0:
coun... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed integer array nums representing the strength of some heroes. The power of a group of heroes is defined as follows:\n\nLet i_0, i_1, .... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 18 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
Here's the function body for the given problem:
```python
def sumOfPower(nums):
nums.sort()
result = 0
MOD = 10**9 + 7
prefix_sum = 0
for num in nums:
# Calculate the power of the current number as a single group
result = (result + (num**3 + num * prefix_sum) % MOD) % MOD
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed permutation of n integers nums.\nA permutation is called semi-ordered if the first number equals 1 and the last number equals n. You ... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 19 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | def min_operations_to_semi_ordered(nums):
n = len(nums)
index1, indexn = nums.index(1), nums.index(n)
# If 1 is already at the first position and n is already at the last position
if index1 == 0 and indexn == n - 1:
return 0
operations = 0
# Move 1 to the first position
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed string s that consists of digits from 0 to 9.\nA string t is called a semi-repetitive if there is at most one consecutive pair of the... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 20 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | Here's the executable Python function based on the given prompt:
```python
def longestSemiRepetitiveSubstring(s: str) -> int:
max_length = 0
start = 0
consecutive_count = 0
for end in range(len(s)):
if end > 0 and s[end] == s[end - 1]:
consecutive_count += 1
w... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwi... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 21 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def findLosers(n: int, k: int):
pass
def findLosers(n: int, k: int):
received_ball = set()
current_friend = 1
turn = 1
while current_friend not in received_ball:
received_ball.add(current_friend)
next_friend = (current_friend + turn * k) % n
if next_friend == 0:
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.A 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a binary array original of length n.\nSpecifically, f... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 22 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | . def can_form_binary_array(derived):
n = len(derived)
# XOR the entire derived array
xor_result = 0
for i in range(n):
xor_result ^= derived[i]
# If the result is 0, it means the derived array can be formed by XORing binary array
return xor_result == 0 |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a string s consisting only of uppercase English letters.\nYou can apply some operations to this string where, in one operation, you can remove an... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 23 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | def min_length(s: str) -> int:
stack = []
for char in s:
if char == 'B' and stack and stack[-1] == 'A':
stack.pop()
elif char == 'D' and stack and stack[-1] == 'C':
stack.pop()
else:
stack.append(char)
return len(stack) |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.Given a positive integer n, return the punishment number of n.\nThe punishment number of n is defined as the sum of the squares of all integers i such that:\n\... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 24 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} | To solve the given problem, we need to implement a function that calculates the punishment number of a given positive integer \( n \). The function should check for each integer \( i \) from 1 to \( n \) whether the square of \( i \) can be partitioned into contiguous substrings such that the sum of these substrings e... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given two 0-indexed integer arrays, cost and time, of size n representing the costs and the time taken to paint n different walls respectively. There a... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 25 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
def min_cost(cost, time):
"""Return the minimum amount of money required to paint the n walls."""
# Your code here
pass
def
def min_cost(cost, time):
n = len(cost)
dp = [[0] * (sum(time) + 1) for _ in range(n + 1)]
for i in range(1, n + 1):
for j in range(sum(time) + 1):
... |
[
{
"content": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.You are given a 0-indexed integer array nums of size n representing the cost of collecting different chocolates. The cost of collecting the chocolate at the in... | {
"do_sample": false,
"max_new_tokens": 32768,
"seed": 0,
"temperature": 0.7
} | 0 | 26 | LiveCodeBench | {
"expected_answer": "",
"problem_id": "",
"reference_solution": ""
} |
Assistant:
```python
def minCostToCollectChocolates(nums, x):
n = len(nums)
min_cost = float('inf')
operation_cost = 0
for i in range(n):
current_cost = operation_cost + i * x
min_val = float('inf')
for j in range(n):
min_val = min(min_val, nums[(i + j) % n])
... |
End of preview. Expand in Data Studio
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
mlfoundations-dev/REASONING_evalchemy_128shards_Qwen2.5-7B-Instruct
Precomputed model outputs for evaluation.
Evaluation Results
Summary
| Metric | AIME24 | AIME25 | AMC23 | GPQADiamond | MATH500 |
|---|---|---|---|---|---|
| Accuracy | 12.0 | 4.7 | 50.0 | 27.3 | 70.0 |
AIME24
- Average Accuracy: 12.00% ± 1.79%
- Number of Runs: 5
| Run | Accuracy | Questions Solved | Total Questions |
|---|---|---|---|
| 1 | 10.00% | 3 | 30 |
| 2 | 10.00% | 3 | 30 |
| 3 | 16.67% | 5 | 30 |
| 4 | 16.67% | 5 | 30 |
| 5 | 6.67% | 2 | 30 |
AIME25
- Average Accuracy: 4.67% ± 1.19%
- Number of Runs: 5
| Run | Accuracy | Questions Solved | Total Questions |
|---|---|---|---|
| 1 | 0.00% | 0 | 30 |
| 2 | 3.33% | 1 | 30 |
| 3 | 6.67% | 2 | 30 |
| 4 | 6.67% | 2 | 30 |
| 5 | 6.67% | 2 | 30 |
AMC23
- Average Accuracy: 50.00% ± 2.35%
- Number of Runs: 5
| Run | Accuracy | Questions Solved | Total Questions |
|---|---|---|---|
| 1 | 52.50% | 21 | 40 |
| 2 | 55.00% | 22 | 40 |
| 3 | 45.00% | 18 | 40 |
| 4 | 42.50% | 17 | 40 |
| 5 | 55.00% | 22 | 40 |
GPQADiamond
- Average Accuracy: 27.27% ± 4.19%
- Number of Runs: 3
| Run | Accuracy | Questions Solved | Total Questions |
|---|---|---|---|
| 1 | 23.74% | 47 | 198 |
| 2 | 20.71% | 41 | 198 |
| 3 | 37.37% | 74 | 198 |
MATH500
- Accuracy: 70.00%
Accuracy Questions Solved Total Questions 70.00% 350 500
- Downloads last month
- 15