problem_id stringlengths 32 32 | name stringlengths 2 108 | problem stringlengths 202 7.98k | test_cases stringlengths 33 74M | difficulty stringclasses 29
values | language sequencelengths 1 1 | source stringclasses 15
values | num_solutions int64 1 839k | starter_code stringlengths 0 1.47k | subset stringclasses 4
values | reasoning stringlengths 1.09k 133k | deepseek_solution stringlengths 1.16k 13.3k | correctness bool 1
class | reason stringclasses 1
value | system stringclasses 1
value | conversations listlengths 2 2 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6b5d0ffc3d64d9c11ea9446977f63759 | mishtis-castle | To defend her castle Count Mishti has invented a new challenge. In this challenge, the participant goes to a room that has n corridors and each corridor has n cells. Each cell has some coins of gold in it i.e. the jth cell of the ith corridor has a[i][j] gold coins ( 1 ≤ i ≤ n && 1 ≤ j ≤ n).
The participant starts at ... | {"inputs": ["2\n2 7\n0 0\n8 0\n2 5\n0 1\n3 0\n\nSAMPLE"], "outputs": ["1\n-1"]} | 0 | [
"PYTHON3"
] | 3 | 2 | code_contests | Okay, I need to solve this programming problem. Let's read the problem carefully.
The problem is about a grid where the participant starts at [1][1] and ends at [N][N]. Each cell has some coins. The participant can move either to the right (same corridor, next cell) or down (next corridor, same cell). The goal is to c... | To solve this problem, we need to determine the maximum number of gold coins a participant can collect while moving from the top-left corner to the bottom-right corner of a grid, and then check if they can pay a specified number of coins to the guard. If they can, we output the remaining coins; otherwise, we output -1.... | true | Your role as an assistant involves thoroughly exploring questions through a systematic long thinking process before providing the final precise and accurate solutions. This requires engaging in a comprehensive cycle of analysis, summarizing, exploration, reassessment, reflection, backtracing, and iteration to develop w... | [
{
"from": "user",
"value": "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.To defend her castle Count Mishti has invented a new challenge. In this challenge, the participant g... | ||
f6de22babeca524e42bff861d0a3d9b9 | UNKNOWN | Given a string S.
You have to return another string such that even-indexed and odd-indexed characters of S are grouped and groups are space-separated (see sample below)
Note:
0 is considered to be an even index.
All input strings are valid with no spaces
input:
'CodeWars'
output
'CdWr oeas'
S[0] = 'C'
S[1] = 'o'... | {"fn_name": "sort_my_string", "inputs": [["Wolfeschlegelsteinhausenbergerdorff"], ["METHIONYLTHREONYLTHREONYGLUTAMINYLARGINYL"], ["PNEUMONOULTRAMICROSCOPICSILICOVOLCANOCONIOSIS"], ["PSEUDOPSEUDOHYPOPARATHYROIDISM"], ["FLOCCINAUCINIHILIPILIFICATION"], ["SUBDERMATOGLYPHIC"]], "outputs": [["Wleclgltihuebredrf ofsheesenasn... | INTRODUCTORY | [
"PYTHON3"
] | CODEWARS | 883 |
def sort_my_string(s):
| apps | Okay, I need to solve this problem where I have to take a string and return a new string that groups all the even-indexed characters first, followed by the odd-indexed ones, separated by a space. Let's think through this step by step.
First, let's understand the example given. The input is 'CodeWars', and the output i... | To solve this problem, we need to transform a given string into a new string where characters at even indices are grouped together followed by characters at odd indices, separated by a space.
### Approach
The key insight here is to use string slicing to efficiently separate the characters at even and odd indices. In ... | true | Your role as an assistant involves thoroughly exploring questions through a systematic long thinking process before providing the final precise and accurate solutions. This requires engaging in a comprehensive cycle of analysis, summarizing, exploration, reassessment, reflection, backtracing, and iteration to develop w... | [
{
"from": "user",
"value": "Generate an executable Python function generated from the given prompt. Return the function body without invoking it at the final solution.Given a string S.\nYou have to return another string such that even-indexed and odd-indexed characters of S are grouped and groups are space-... | |
6f33ed4c434022892392e975bb47c557 | 123_D. String | You are given a string s. Each pair of numbers l and r that fulfill the condition 1 ≤ l ≤ r ≤ |s|, correspond to a substring of the string s, starting in the position l and ending in the position r (inclusive).
Let's define the function of two strings F(x, y) like this. We'll find a list of such pairs of numbers for w... | {"inputs": ["aaaa\n", "abacabadabacaba\n", "abcdef\n", "cahdktuxuukmbuqcqactqhqdcxpkqcuumckttdpmpqxxkacpappxuqkxbuahqdphhddhquthqaapm\n", "usussubuubbbbs\n", "cwuiax\n", "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrbrrrrrrrrrrrrr... | 10 | [
"PYTHON3"
] | 2 | 2 | code_contests | Okay, let's try to figure out this problem. So, the task is to compute the sum of F(s, x) for all possible substrings x of the given string s. Hmm, right. Let's start by understanding what F(x, y) actually means here.
Wait, wait. Wait, the function F(x, y) is defined as follows: for the two strings x and y, we find al... | To solve this problem, we need to compute the sum of F(s, x) for all substrings x of the given string s, where F(s, x) is defined based on the occurrences of substring x in s. The key insight is to efficiently compute the number of occurrences of each substring and use this information to derive the final sum.
### App... | true | Your role as an assistant involves thoroughly exploring questions through a systematic long thinking process before providing the final precise and accurate solutions. This requires engaging in a comprehensive cycle of analysis, summarizing, exploration, reassessment, reflection, backtracing, and iteration to develop w... | [
{
"from": "user",
"value": "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. Each pair of numbers l and r that fulfill the condition 1 ≤ l ≤ r ≤ |s|, c... | ||
4ae641ae3e6c36fd03b31d740c84c83e | showdown | "Things are heated up between the Finance team and the Marketing team, and they decide to have one-o(...TRUNCATED) | "{\"inputs\": [\"3\\n8 5 3\\n8 5 3\\n\\nSAMPLE\", \"4\\n1 10 7 4\\n15 3 8 7\", \"4\\n1 10 7 4\\n15 3(...TRUNCATED) | 0 | [
"PYTHON3"
] | 3 | 2 | code_contests | "Okay, let's see. The problem is about matching players from the Finance team with Marketing team to(...TRUNCATED) | "To solve this problem, we need to determine the optimal way to match players from the Finance team (...TRUNCATED) | true | "Your role as an assistant involves thoroughly exploring questions through a systematic long thinkin(...TRUNCATED) | [{"from":"user","value":"Generate an executable Python function generated from the given prompt. The(...TRUNCATED) | ||
b89833198d91b282d564f47edc87bd4f | p02274 The Number of Inversions | "For a given sequence $A = \\\\{a_0, a_1, ... a_{n-1}\\\\}$, the number of pairs $(i, j)$ where $a_i(...TRUNCATED) | "{\"inputs\": [\"3\\n3 1 2\", \"5\\n3 5 2 1 4\", \"3\\n6 1 2\", \"5\\n3 10 2 1 4\", \"3\\n6 1 0\", \(...TRUNCATED) | 0 | [
"PYTHON3"
] | 6 | 2 | code_contests | "Okay, I need to solve this problem where I have to find the number of inversions in a sequence. The(...TRUNCATED) | "To solve this problem, we need to efficiently count the number of inversions in a given sequence. A(...TRUNCATED) | true | "Your role as an assistant involves thoroughly exploring questions through a systematic long thinkin(...TRUNCATED) | [{"from":"user","value":"Generate an executable Python function generated from the given prompt. The(...TRUNCATED) | ||
1e0c53ab6099c2584950aff158848a26 | p02583 AtCoder Beginner Contest 175 - Making Triangle | "We have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\n\nIn how (...TRUNCATED) | "{\"inputs\": [\"2\\n1 1\", \"10\\n9 4 6 1 9 6 10 6 6 8\", \"6\\n4 5 4 3 3 5\", \"5\\n4 4 9 7 5\", \(...TRUNCATED) | 0 | [
"PYTHON3"
] | 5 | 2 | code_contests | "Okay, let's tackle this problem. So, the task is to find the number of ways to choose three sticks (...TRUNCATED) | "To solve this problem, we need to determine the number of ways to choose three sticks with differen(...TRUNCATED) | true | "Your role as an assistant involves thoroughly exploring questions through a systematic long thinkin(...TRUNCATED) | [{"from":"user","value":"Generate an executable Python function generated from the given prompt. The(...TRUNCATED) | ||
0bf3e1886d598a3cbc1d5880285b477c | 358_B. Dima and Text Messages | "Seryozha has a very changeable character. This time he refused to leave the room to Dima and his gi(...TRUNCATED) | "{\"inputs\": [\"7\\ni\\nam\\nnot\\nmain\\nin\\nthe\\nfamily\\n<3i<>3am<3the<3<mai(...TRUNCATED) | 8 | [
"PYTHON3"
] | 2 | 2 | code_contests | "Okay, I need to solve this programming problem. Let's read the problem carefully.\n\nThe task is to(...TRUNCATED) | "To solve this problem, we need to determine if a given text message could have been generated by en(...TRUNCATED) | true | "Your role as an assistant involves thoroughly exploring questions through a systematic long thinkin(...TRUNCATED) | [{"from":"user","value":"Generate an executable Python function generated from the given prompt. The(...TRUNCATED) | ||
f39bde48dbafd4028e6d06c2827576c0 | UNKNOWN | "A palindrome is a word, phrase, number, or other sequence of characters which reads the same backwa(...TRUNCATED) | "{\"fn_name\": \"palindrome\", \"inputs\": [[2], [141221001], [1551], [13598], [\"ACCDDCCA\"], [\"15(...TRUNCATED) | INTRODUCTORY | [
"PYTHON3"
] | CODEWARS | 3,085 |
def palindrome(num):
| apps | "Okay, let's tackle this problem. So, the task is to write a Python function called palindrome that (...TRUNCATED) | "To solve this problem, we need to determine the number of numerical palindromes within a given numb(...TRUNCATED) | true | "Your role as an assistant involves thoroughly exploring questions through a systematic long thinkin(...TRUNCATED) | [{"from":"user","value":"Generate an executable Python function generated from the given prompt. Ret(...TRUNCATED) | |
23839dbdecc23474dea7445eceecb38d | UNKNOWN | "Chef has binary string A of length N. He constructs a new binary string B by concatenating M copies(...TRUNCATED) | {"inputs": ["3\n2 2\n00\n2 4\n11\n3 3\n101\n"], "outputs": ["4\n1\n2\n"]} | MEDIUM_HARD | [
"PYTHON3"
] | CODECHEF | 5,345 | taco | "Okay, I need to solve this programming problem. Let's read the problem statement carefully.\n\nThe (...TRUNCATED) | "To solve this problem, we need to determine the number of good indices in a binary string B, which (...TRUNCATED) | true | "Your role as an assistant involves thoroughly exploring questions through a systematic long thinkin(...TRUNCATED) | [{"from":"user","value":"Generate an executable Python function generated from the given prompt. The(...TRUNCATED) | ||
1694007fab7003abd4f06afe234c3603 | UNKNOWN | "At a break Vanya came to the class and saw an array of $n$ $k$-bit integers $a_1, a_2, \\ldots, a_n(...TRUNCATED) | "{\n \"inputs\": [\n \"3 2\\n1 3 0\\n\",\n \"6 3\\n1 4 4 7 3 4\\n\",\n \"1 1\\n1\\n\",\n (...TRUNCATED) | INTERVIEW | [
"PYTHON3"
] | CODEFORCES | 6,150 | apps | "Okay, let's try to figure out this problem. So, the task is to maximize the number of segments [l, (...TRUNCATED) | "To solve this problem, we need to determine the maximum number of segments in an array where the XO(...TRUNCATED) | true | "Your role as an assistant involves thoroughly exploring questions through a systematic long thinkin(...TRUNCATED) | [{"from":"user","value":"Generate an executable Python function generated from the given prompt. The(...TRUNCATED) |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 28