problem_id stringlengths 32 32 | name stringlengths 2 112 | problem stringlengths 206 13k | test_cases stringlengths 33 44.2M | difficulty stringclasses 28
values | language sequencelengths 1 1 | source stringclasses 15
values | num_solutions int64 1 1.12M | starter_code stringclasses 918
values | subset stringclasses 4
values | reasoning stringlengths 1.39k 121k | deepseek_solution stringlengths 1.06k 15k | correctness bool 2
classes | reason stringclasses 2
values | system stringclasses 1
value | conversations listlengths 2 2 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
327dbb40ce764338d44efe10a6b74c17 | none | Appleman has a tree with *n* vertices. Some of the vertices (at least one) are colored black and other vertices are colored white.
Consider a set consisting of *k* (0<=≤<=*k*<=<<=*n*) edges of Appleman's tree. If Appleman deletes these edges from the tree, then it will split into (*k*<=+<=1) parts. Note, that each ... | {"inputs": ["3\n0 0\n0 1 1", "6\n0 1 1 0 4\n1 1 0 0 1 0", "10\n0 1 2 1 4 4 4 0 8\n0 0 0 1 0 1 1 0 0 1", "5\n0 1 1 3\n0 0 0 1 1", "10\n0 1 1 2 4 3 3 3 2\n1 0 1 1 1 0 0 1 1 0", "100\n0 0 2 2 0 3 5 0 6 2 0 4 0 2 3 7 8 3 15 19 13 8 18 19 3 14 23 9 6 3 6 17 26 24 20 6 4 27 8 5 14 5 35 31 27 3 41 25 20 14 25 31 49 40 0 1 10 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces | Okay, let's try to understand this problem. So, Appleman has a tree with n vertices. Some are black, others white. We need to find the number of edge sets to delete such that each resulting subtree has exactly one black vertex. The answer needs to be modulo 1e9+7.
Hmm. Let's break down the problem. The key is that aft... | To solve this problem, we need to determine the number of ways to split a tree into components such that each component contains exactly one black vertex. The solution involves analyzing the tree structure and counting valid edges that can be cut to achieve the desired partition.
### Approach
1. **Count Black Vertices... | false | Code is incorrect. | 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.Appleman has a tree with *n* vertices. Some of the vertices (at least one) are colored black and oth... | |
f6752849cc4f9a7ea143dacb83d43a9d | UNKNOWN | You have a digit sequence S of length 4. You are wondering which of the following formats S is in:
- YYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order
- MMYY format: the two-digit representation of the month and the last tw... | {"inputs": ["1905\n", "0112\n", "1700\n", "0101\n", "1312\n", "0348\n", "9999\n", "0001\n", "0000\n", "0100\n"], "outputs": ["YYMM\n", "AMBIGUOUS\n", "NA\n", "AMBIGUOUS\n", "YYMM\n", "MMYY\n", "NA\n", "YYMM\n", "NA\n", "MMYY\n"]} | INTRODUCTORY | [
"PYTHON3"
] | ATCODER.JP | 30,485 | apps | Okay, I need to solve this problem. Let's read the problem statement carefully.
The problem is about determining the format of a 4-digit string S. The possible formats are YYMM or MMYY. The task is to check which formats are valid and output the appropriate result.
First, let's understand the two formats:
- YYMM: Th... | To solve this problem, we need to determine the format of a given 4-digit string. The possible formats are YYMM (year-month) or MMYY (month-year). The solution involves checking if the string fits either, both, or neither of these formats and then providing the appropriate result.
### Approach
1. **Input Reading**: Re... | 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 have a digit sequence S of length 4. You are wondering which of the following formats S is in:\n... | ||
3a21948de11a6c029b2327d087639bfc | 1219_H. Function Composition | "We are definitely not going to bother you with another generic story when Alice finds about an arra(...TRUNCATED) | "{\"inputs\": [\"10\\n2 3 1 5 6 4 2 10 7 7\\n5\\n10 1\\n5 7\\n10 6\\n1 1\\n10 8\\n\", \"10\\n2 3 1 5(...TRUNCATED) | 14 | [
"PYTHON3"
] | 2 | 2 | code_contests | "Okay, I need to solve this programming problem. Let's read the problem carefully.\n\nThe problem is(...TRUNCATED) | "To solve this problem, we need to determine how many indices `x` exist such that applying the funct(...TRUNCATED) | false | Code is incorrect. | "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) | |
e81bb21f59b3824a893281eef5c96d56 | UNKNOWN | "Given are three positive integers A, B, and C. Compute the following value modulo 998244353:\n\\sum(...TRUNCATED) | "{\"inputs\": [\"1 2 3\\n\", \"1000000000 987654321 123456789\\n\", \"192279221 156648747 154396385\(...TRUNCATED) | INTERVIEW | [
"PYTHON3"
] | ATCODER.JP | 19,463 | apps | "Okay, let's see. I need to compute the sum of abc for a from 1 to A, b from 1 to B, and c from 1 to(...TRUNCATED) | "To solve this problem, we need to compute the sum of the product of three indices \\(a\\), \\(b\\),(...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) | ||
df4270a084d723930aeb97b4ceadbb5e | UNKNOWN | "Due to the rise of covid-19 cases in India, this year BCCI decided to organize knock-out matches in(...TRUNCATED) | "{\"inputs\": [\"A = (3, 2)\\r\\nB = (3, 4)\\r\\nc = (2, 2)\"], \"outputs\": [\"2.000000 0.000000\"](...TRUNCATED) | MEDIUM | [
"PYTHON3"
] | PRACTICE.GEEKSFORGEEKS.ORG | 1,383 | "#User function Template for python3\n\n\n\n\n\nclass Solution:\n\n def findPoint(self, A, B, C):(...TRUNCATED) | taco | "Okay, let's tackle this problem. So, the task is to find point D such that A, B, C, D form a parall(...TRUNCATED) | "To solve this problem, we need to determine the coordinates of the fourth point D such that the fou(...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) | |
6d991d91b9a0f0d855afa3b07325e28d | UNKNOWN | "Given a set of numbers from 1 to N, each number is exactly present twice so there are N pairs. In t(...TRUNCATED) | {"inputs": ["N = 1", "N = 2"], "outputs": ["2", "3"]} | EASY | [
"PYTHON3"
] | PRACTICE.GEEKSFORGEEKS.ORG | 1,095 | class Solution:
def find (self, N):
# code here | taco | "Okay, let's see. The problem is about finding the worst-case scenario where you have to pick number(...TRUNCATED) | "To solve this problem, we need to determine the worst-case scenario for picking numbers from a set (...TRUNCATED) | false | Code is incorrect. | "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) |
40b1cc500e15e52e889b59f7c4f3f901 | p01081 Char Swap | "Problem\n\nGiven a string S of even length.\nYou can swap two adjacent characters in the string S a(...TRUNCATED) | "{\"inputs\": [\"acca\", \"acpcacpc\", \"aizu\", \"acccacpp\", \"bizu\", \"acpcaccp\", \"ffxx\", \"a(...TRUNCATED) | 0 | [
"PYTHON3"
] | 6 | 2 | code_contests | "Okay, I need to solve this problem where I have to find the minimum number of adjacent swaps to tur(...TRUNCATED) | "To solve this problem, we need to determine the minimum number of adjacent swaps required to transf(...TRUNCATED) | false | Code is incorrect. | "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) | |
19e71731c9c9c5d3ae60181f82637952 | UNKNOWN | "Given a number `n` we will define its scORe to be `0 | 1 | 2 | 3 | ... | n`, where `|` is the [bitw(...TRUNCATED) | "{\"fn_name\": \"score\", \"inputs\": [[0], [1], [49], [1000000], [10000000], [1000000000000000000]](...TRUNCATED) | INTRODUCTORY | [
"PYTHON3"
] | CODEWARS | 744 |
def score(n):
| apps | "Okay, let's tackle this problem. So, the task is to find the scORe of a number n. From the examples(...TRUNCATED) | "To solve this problem, we need to compute the scORe of a given number `n`, which is defined as the (...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) | |
97f69f6137f46480c6d6cc2922964b27 | UNKNOWN | "You are given an array $a$ consisting of $n$ positive integers. You have to choose a positive integ(...TRUNCATED) | "{\"inputs\": [\"5\\n5\\n1 2 3 4 5\\n3\\n10 5 15\\n3\\n100 10 200\\n10\\n9 8 2 6 6 2 8 6 5 4\\n2\\n1(...TRUNCATED) | EASY | [
"PYTHON3"
] | CODEFORCES | 136,375 | taco | "Okay, I need to solve this programming problem. Let's read the problem carefully.\n\nThe problem sa(...TRUNCATED) | "To solve this problem, we need to determine a positive integer \\( d \\) such that when elements of(...TRUNCATED) | false | Code is incorrect. | "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) | |
37dd0169be86cbd46d6b0f42ab3d65d6 | 1097_C. Yuhao and a Parenthesis | "One day, Yuhao came across a problem about checking if some bracket sequences are correct bracket s(...TRUNCATED) | "{\"inputs\": [\"7\\n)())\\n)\\n((\\n((\\n(\\n)\\n)\\n\", \"2\\n(())\\n()\\n\", \"4\\n(\\n((\\n(((\\(...TRUNCATED) | 9 | [
"PYTHON3"
] | 2 | 2 | code_contests | "Okay, let's see. We need to find the maximum number of pairs of bracket sequences such that when co(...TRUNCATED) | "To solve this problem, we need to determine the maximum number of pairs of bracket sequences such t(...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
- 13