Dataset Viewer
Auto-converted to Parquet Duplicate
problem_id
int64
0
5k
question
stringlengths
152
6.72k
solutions
stringlengths
0
1.12M
input_output
stringlengths
53
74M
difficulty
stringclasses
3 values
url
stringlengths
34
88
starter_code
stringclasses
54 values
reasoning
stringlengths
1.19k
125k
deepseek_solution
stringlengths
1.06k
12k
correctness
bool
2 classes
reason
stringclasses
2 values
matched_dataset
stringclasses
1 value
matched_text
stringclasses
1 value
match_score
float64
0
0
0
An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code $091$), a colon (ASCII code $058$), some (possibly zero) vertical line characters (ASCII code $124$), another colon, ...
["s = input()\nn = len(s)\nind = -1\nf = False\nfor i in range(n):\n if s[i] == '[':\n f = True\n elif s[i] == ':':\n if f:\n ind = i\n break\nbind = -1\nf = False\nfor i in range(n-1,-1,-1):\n if s[i] == ']':\n f = True\n elif s[i] == ':':\n if f:\n ...
{ "inputs": [ "|[a:b:|]\n", "|]:[|:]\n", ":][:\n", ":[]:\n", "[[:]]\n", "[::]\n", "]:|:[\n", ":::::]\n", "::::]\n", "::[]\n", "[]\n", "[a|[::]\n", "dsfdsfds\n", ":[||]:\n", "::]\n", ":::]\n", "[||]\n", ":[[[:]]]:\n", "::]::[:]::[::\n", "[...
interview
https://codeforces.com/problemset/problem/1101/B
Okay, I need to solve this problem where I have to find the maximum possible length of an accordion that can be formed by deleting some characters from the given string. Let's see. First, let's understand what an accordion is. From the description, an accordion is a string that starts with '[', followed by a ':', the...
To solve this problem, we need to determine if we can transform a given string into an accordion by removing some characters, and if so, find the maximum possible length of the resulting accordion. An accordion is defined as a string that starts with '[', followed by a colon ':', some vertical lines '|', another colon ...
false
Code is incorrect.
0
1
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits. Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the biggest of them. -----Input----- The first line contains the positive inte...
["num = list(map(int, input()))\nbest = num[:]\nfor i in range(-1, -len(num) - 1, -1):\n if num[i] == 0:\n continue\n num[i] -= 1\n for j in range(i + 1, 0):\n num[j] = 9\n if sum(num) > sum(best):\n best = num[:]\ns = ''.join(map(str, best)).lstrip('0')\nprint(s)\n", "s_num = input()\n...
{ "inputs": [ "100\n", "48\n", "521\n", "1\n", "2\n", "3\n", "39188\n", "5\n", "6\n", "7\n", "8\n", "9\n", "10\n", "59999154\n", "1000\n", "10000\n", "100000\n", "1000000\n", "10000000\n", "100000000\n", "1000000000\n", "100000000...
interview
https://codeforces.com/problemset/problem/770/B
Okay, let's see. I need to find the largest number ≤ x that has the maximum sum of digits. Hmm. So, the problem is to find the best candidate between 1 and x (inclusive) where the sum of the digits is the highest possible. And if there are multiple, pick the largest one. Let's think about some examples. Like the first...
To solve this problem, we need to find the largest positive integer that does not exceed a given number \( x \) and has the maximum sum of its digits. If there are multiple such integers, we should select the largest one among them. ### Approach 1. **Generate Candidates**: We generate potential candidates by consideri...
true
0
2
Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 12, 3001 and 12345 are not. You are given current year in Berland. Your task is to find how long...
["def main():\n s = input()\n n = len(s)\n t = int(str(int(s[0]) + 1) + '0' * (n - 1))\n\n print(t - int(s))\n\nmain()\n", "s = input()\nx = int(s)\ny = int(str(int(s[0]) + 1) + '0' * (len(s) - 1))\nprint(y - x)", "n = int(input())\n\nfor i in range(0,11):\n for j in range(1,10):\n m = j*10**i\n ...
{ "inputs": [ "4\n", "201\n", "4000\n", "9\n", "10\n", "1\n", "100000000\n", "900000000\n", "999999999\n", "1000000000\n", "9999999\n", "100000001\n", "3660\n", "21\n", "900000001\n", "62911\n", "11\n", "940302010\n", "91\n", "101\n", ...
interview
https://codeforces.com/problemset/problem/808/A
Okay, let's see. The problem is to find the next lucky year after a given current year. A lucky year is one that has no more than one non-zero digit. So like 5 is lucky because there's only one non-zero (5). 100 is lucky because the non-zero digits are just 1. But 12 has two, so it's not. So the input is n, and we nee...
To solve this problem, we need to determine the next lucky year after a given current year in Berland. A lucky year is defined as a year that contains no more than one non-zero digit. The solution involves finding the smallest year greater than the current year that meets this criterion. ### Approach 1. **Identify Can...
false
Code is incorrect.
0
3
"You have a long fence which consists of $n$ sections. Unfortunately, it is not painted, so you deci(...TRUNCATED)
"[\"from collections import defaultdict as dd\\nimport math\\ndef nn():\\n\\treturn int(input())\\n\(...TRUNCATED)
"{\n \"inputs\": [\n \"7 5\\n1 4\\n4 5\\n5 6\\n6 7\\n3 5\\n\",\n \"4 3\\n1 1\\n2 2\\n3 4\\n\"(...TRUNCATED)
interview
https://codeforces.com/problemset/problem/1132/C
"Okay, I need to solve this programming problem. Let's read the problem carefully.\n\nSo, the proble(...TRUNCATED)
"To solve this problem, we need to determine the maximum number of painted sections of a fence when (...TRUNCATED)
true
0
4
"Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he h(...TRUNCATED)
"[\"x=int(input())\\nh,m=list(map(int,input().split()))\\ndef ok(mm):\\n while mm<0: mm+=1440\\n h(...TRUNCATED)
"{\n \"inputs\": [\n \"3\\n11 23\\n\",\n \"5\\n01 07\\n\",\n \"34\\n09 24\\n\",\n \"2\\(...TRUNCATED)
interview
https://codeforces.com/problemset/problem/916/A
"Okay, I need to solve this problem where Jamie wants to set an alarm such that the alarm time is a (...TRUNCATED)
"To solve this problem, we need to determine the minimum number of times Jamie needs to press the sn(...TRUNCATED)
true
0
5
"Luba is surfing the Internet. She currently has n opened tabs in her browser, indexed from 1 to n f(...TRUNCATED)
"[\"n, pos, l, r = map(int, input().split())\\n\\nif l > 1 and r < n:\\n if l <= pos and pos <= r(...TRUNCATED)
"{\n \"inputs\": [\n \"6 3 2 4\\n\",\n \"6 3 1 3\\n\",\n \"5 2 1 5\\n\",\n \"100 1 1 99(...TRUNCATED)
interview
https://codeforces.com/problemset/problem/915/B
"Okay, let's see. The problem is about Luba closing tabs so that only those from l to r remain. We n(...TRUNCATED)
"To solve this problem, we need to determine the minimum number of seconds Luba needs to spend closi(...TRUNCATED)
true
0
6
"You are fighting with Zmei Gorynich — a ferocious monster from Slavic myths, a huge dragon-like r(...TRUNCATED)
"[\"for _ in range(int(input())):\\n n, x = list(map(int, input().split()))\\n A = []\\n fo(...TRUNCATED)
"{\n \"inputs\": [\n \"3\\n3 10\\n6 3\\n8 2\\n1 4\\n4 10\\n4 1\\n3 2\\n2 6\\n1 100\\n2 15\\n10 1(...TRUNCATED)
interview
https://codeforces.com/problemset/problem/1217/B
"Okay, let's see. I need to solve this problem where I have to find the minimum number of blows to d(...TRUNCATED)
"To solve this problem, we need to determine the minimum number of blows required to defeat Zmei Gor(...TRUNCATED)
false
Code is incorrect.
0
7
"Anton likes to listen to fairy tales, especially when Danik, Anton's best friend, tells them. Right(...TRUNCATED)
"[\"n, m = map(int, input().split())\\nif (m >= n): print(n)\\nelse:\\n c = n - m\\n l = 0\\n (...TRUNCATED)
"{\n \"inputs\": [\n \"5 2\\n\",\n \"8 1\\n\",\n \"32 5\\n\",\n \"1024 1024\\n\",\n (...TRUNCATED)
interview
https://codeforces.com/problemset/problem/785/C
"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 the first day when the barn becomes empty after a serie(...TRUNCATED)
true
0
8
"Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in(...TRUNCATED)
"[\"cards=list(input().split())\\nlm=[0]*9\\nlp=[0]*9\\nls=[0]*9\\nfor item in cards:\\n if item[(...TRUNCATED)
"{\n \"inputs\": [\n \"1s 2s 3s\\n\",\n \"9m 9m 9m\\n\",\n \"3p 9m 2p\\n\",\n \"8p 2s 9(...TRUNCATED)
interview
https://codeforces.com/problemset/problem/1191/B
"Okay, let's see. The problem is to find the minimum number of tiles Tokitsukaze needs to draw so th(...TRUNCATED)
"To solve this problem, we need to determine the minimum number of extra tiles Tokitsukaze needs to (...TRUNCATED)
true
0
9
"Yet another round on DecoForces is coming! Grandpa Maks wanted to participate in it but someone has(...TRUNCATED)
"[\"from sys import stdin, stdout\\n\\nk = int(stdin.readline())\\nn, m = map(int, stdin.readline().(...TRUNCATED)
"{\n \"inputs\": [\n \"2\\n3 2\\n3 1 3 2\\n1 2 2 2\\n1 0 0 1\\n\",\n \"3\\n10 10\\n1 2 1 1\\n(...TRUNCATED)
interview
https://codeforces.com/problemset/problem/818/C
"Okay, let's try to figure out how to solve this problem. The task is to find the sofa that has exac(...TRUNCATED)
"To solve this problem, we need to identify the specific sofa in a storehouse that meets given condi(...TRUNCATED)
true
0
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
4