Dataset Viewer
Auto-converted to Parquet Duplicate
question
stringclasses
548 values
response1
stringlengths
580
9.26k
response2
stringlengths
563
11.2k
gt
int64
0
3
answer
listlengths
2
2
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered red, green, or blue and any number from 1 to 9. Each player...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered red, green, or blue and any number from 1 to 9. Each player...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered red, green, or blue and any number from 1 to 9. Each player...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
2
[ 0, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered red, green, or blue and any number from 1 to 9. Each player...
\n```python\nimport sys\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == ...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
2
[ 0, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered red, green, or blue and any number from 1 to 9. Each player...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
3
[ 1, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered red, green, or blue and any number from 1 to 9. Each player...
\n```python\n# YOUR CODE HERE\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[...
\n```python\nimport itertools\n\ndef is_valid_set(combo):\n colors = [c for (n, c) in combo]\n numbers = [n for (n, c) in combo]\n if len(set(colors)) != 1:\n return False\n if len(set(numbers)) == 1:\n return True\n sorted_numbers = sorted(numbers)\n if sorted_numbers[1] == sorted_numbe...
0
[ 0, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSagheer is playing a game with his best friend Soliman. He brought a tree with n nodes numbered from 1 to n and rooted at node 1. The i-th node has a_{i} apples. This...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap the apples of two nodes in a tree such that he will win the game against Soliman, given both play optimally. The tree has a special property where all paths from the root to any leaf have the same parity (either all even or all odd). \n\n...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap the apples of two nodes in a tree such that he will win the game against Soliman, assuming both play optimally. The game involves moving apples from nodes to their children or eating them if they are at leaves, and the winner is determine...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSagheer is playing a game with his best friend Soliman. He brought a tree with n nodes numbered from 1 to n and rooted at node 1. The i-th node has a_{i} apples. This...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap two nodes\' apples such that he will win the game against Soliman if both play optimally. The game is played on a tree with specific properties, and the solution involves understanding combinatorial game theory concepts, particularly the ...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap apples between two nodes such that he will win the game against Soliman, assuming both play optimally. The solution involves analyzing the tree structure and using game theory concepts to determine the optimal moves.\n\n### Approach\n1. *...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSagheer is playing a game with his best friend Soliman. He brought a tree with n nodes numbered from 1 to n and rooted at node 1. The i-th node has a_{i} apples. This...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap the apples of two nodes in a tree such that he will win the game if both players play optimally. The tree has a special property that all paths from the root to any leaf have the same parity. \n\n### Approach\n1. **Tree Construction and D...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap apples between two nodes in a tree such that he will win the game against Soliman, assuming both play optimally. The tree has a special property where all paths from the root to any leaf have the same parity (either all even or all odd).\...
2
[ 0, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSagheer is playing a game with his best friend Soliman. He brought a tree with n nodes numbered from 1 to n and rooted at node 1. The i-th node has a_{i} apples. This...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap the apples of two nodes in a tree such that he will win the game if both players play optimally. The tree has a special property that all paths from the root to any leaf have the same parity. \n\n### Approach\n1. **Tree Construction and D...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap apples between two nodes in a tree such that he will win the game against Soliman, assuming both play optimally. The tree has a special property where all paths from the root to any leaf have the same parity (either all even or all odd).\...
2
[ 0, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSagheer is playing a game with his best friend Soliman. He brought a tree with n nodes numbered from 1 to n and rooted at node 1. The i-th node has a_{i} apples. This...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap apples between two nodes in a tree such that he will win the game against Soliman, assuming both play optimally. The tree has a special property where all paths from the root to any leaf have the same parity (either all even or all odd).\...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap the apples of two nodes in a tree such that he will win the game against Soliman, given both play optimally. The tree has a special property where all paths from the root to any leaf have the same parity (either all even or all odd). \n\n...
3
[ 1, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSagheer is playing a game with his best friend Soliman. He brought a tree with n nodes numbered from 1 to n and rooted at node 1. The i-th node has a_{i} apples. This...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap the apples of two nodes in a tree such that he will win the game if both players play optimally. The tree has a special property that all paths from the root to any leaf have the same parity. \n\n### Approach\n1. **Tree Construction and D...
\nTo solve this problem, we need to determine the number of ways Sagheer can swap the apples of two nodes in a tree such that he will win the game against Soliman, assuming both play optimally. The game involves moving apples from nodes to their children or eating them if they are at leaves, and the winner is determine...
0
[ 0, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently personal training sessions have finished in the Berland State University Olympiad Programmer Training Centre. By the results of these training sessions teams...
\nTo solve this problem, we need to determine the lexicographically smallest priority list for a given student `k` based on the results of personal training sessions and the teams formed. The teams are formed by selecting the best remaining student as the captain, who then chooses their teammates based on their priorit...
\nTo solve the problem of determining the lexicographically smallest priority list for a given student `k`, we need to simulate the formation of teams and reconstruct the priority list based on the given team formation rules and the order of results.\n\n---\n\n### ✅ **Approach Overview**\n\n1. **Input Parsing**:\n - ...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently personal training sessions have finished in the Berland State University Olympiad Programmer Training Centre. By the results of these training sessions teams...
\n```python\nimport sys\n\ndef main():\n input = sys.stdin.read().split()\n ptr = 0\n n = int(input[ptr])\n ptr += 1\n res = list(map(int, input[ptr:ptr+3*n]))\n ptr += 3*n\n \n pos = {student: i for i, student in enumerate(res)}\n \n teams = []\n for _ in range(n):\n team = list...
\n```python\n# YOUR CODE HERE\nimport sys\n\ndef main():\n import sys\n input = sys.stdin.read().split()\n ptr = 0\n n = int(input[ptr])\n ptr += 1\n res = list(map(int, input[ptr:ptr+3*n]))\n ptr += 3*n\n\n pos = {student: i for i, student in enumerate(res)}\n \n teams = []\n for _ in ...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently personal training sessions have finished in the Berland State University Olympiad Programmer Training Centre. By the results of these training sessions teams...
\nTo solve this problem, we need to determine the lexicographically smallest priority list for a given student `k` based on the results of personal training sessions and the teams formed. The teams are formed by selecting the best remaining student as the captain, who then chooses two teammates from the remaining stude...
\n```python\n# YOUR CODE HERE\nimport sys\n\ndef main():\n input = sys.stdin.read().split()\n ptr = 0\n n = int(input[ptr])\n ptr += 1\n res = list(map(int, input[ptr:ptr+3*n]))\n ptr += 3*n\n \n pos = {student: i for i, student in enumerate(res)}\n \n teams = []\n for _ in range(n):\n ...
2
[ 0, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently personal training sessions have finished in the Berland State University Olympiad Programmer Training Centre. By the results of these training sessions teams...
\n```python\n# YOUR CODE HERE\nimport sys\n\ndef main():\n input = sys.stdin.read().split()\n ptr = 0\n n = int(input[ptr])\n ptr += 1\n res = list(map(int, input[ptr:ptr+3*n]))\n ptr += 3*n\n\n pos = {student: i for i, student in enumerate(res)}\n \n teams = []\n for _ in range(n):\n ...
\nTo solve this problem, we need to determine the lexicographically smallest priority list for a given student `k` based on the results of personal training sessions and the teams formed. The teams are formed by selecting the best remaining student as the captain, who then chooses their teammates based on their priorit...
2
[ 0, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently personal training sessions have finished in the Berland State University Olympiad Programmer Training Centre. By the results of these training sessions teams...
\nTo solve this problem, we need to determine the lexicographically smallest priority list for a given student `k` based on the results of personal training sessions and the teams formed. The teams are formed by selecting the best remaining student as the captain, who then chooses their teammates based on their priorit...
\n```python\nimport sys\n\ndef main():\n input = sys.stdin.read().split()\n ptr = 0\n n = int(input[ptr])\n ptr += 1\n res = list(map(int, input[ptr:ptr+3*n]))\n ptr += 3*n\n \n pos = {student: i for i, student in enumerate(res)}\n \n teams = []\n for _ in range(n):\n team = list...
3
[ 1, 1 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently personal training sessions have finished in the Berland State University Olympiad Programmer Training Centre. By the results of these training sessions teams...
\nTo solve the problem of determining the lexicographically smallest priority list for a given student `k`, we need to simulate the formation of teams and reconstruct the priority list based on the given team formation rules and the order of results.\n\n---\n\n### ✅ **Approach Overview**\n\n1. **Input Parsing**:\n - ...
\n```python\n# YOUR CODE HERE\nimport sys\n\ndef main():\n input = sys.stdin.read().split()\n ptr = 0\n n = int(input[ptr])\n ptr += 1\n res = list(map(int, input[ptr:ptr+3*n]))\n ptr += 3*n\n\n pos = {student: i for i, student in enumerate(res)}\n\n teams = []\n for _ in range(n):\n t...
0
[ 0, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJohnny has a pool in his garden. There are several islands in the pool. Some islands are connected by bridges. Any bridge can be removed. Every day Johnny removes som...
\nTo solve this problem, we need to determine the number of unique days Johnny can be happy by creating different configurations of bridges on his pool. Each configuration must form a spanning tree that includes all favorite bridges. The solution involves checking for cycles, forming components, and using the Matrix Tr...
\n```python\nimport sys\nfrom collections import deque\n\nclass DSU:\n def __init__(self, size):\n self.parent = list(range(size + 1)) # 1-based indexing\n\n def find(self, x):\n if self.parent[x] != x:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n de...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJohnny has a pool in his garden. There are several islands in the pool. Some islands are connected by bridges. Any bridge can be removed. Every day Johnny removes som...
\nTo solve this problem, we need to determine the number of unique days Johnny can be happy by creating different configurations of bridges on his pool. Each configuration must form a spanning tree that includes all favorite bridges. The solution involves checking for cycles, forming components, and using the Matrix Tr...
\n```python\nimport sys\nfrom collections import deque\n\nclass DSU:\n def __init__(self, size):\n self.parent = list(range(size + 1)) # 1-based indexing\n\n def find(self, x):\n if self.parent[x] != x:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n de...
1
[ 1, 0 ]
\nYou will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJohnny has a pool in his garden. There are several islands in the pool. Some islands are connected by bridges. Any bridge can be removed. Every day Johnny removes som...
\n```python\nimport sys\nfrom collections import deque\n\nclass DSU:\n def __init__(self, size):\n self.parent = list(range(size + 1)) # 1-based indexing\n\n def find(self, x):\n if self.parent[x] != x:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n de...
\n```python\nimport sys\nfrom collections import deque\n\nclass DSU:\n def __init__(self, size):\n self.parent = list(range(size + 1)) # 1-based indexing\n\n def find(self, x):\n if self.parent[x] != x:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n de...
2
[ 0, 1 ]
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
9