Dataset Viewer
Auto-converted to Parquet
data_source
stringclasses
1 value
prompt
listlengths
1
1
env_class
stringclasses
1 value
reward_spec
dict
extra_info
dict
codeforces
[ { "content": "You are an expert C++ competitive programmer. You will be given a competitive programming problem and need to write a correct C++ solution that passes all test cases.\n\nYour solution should:\n- Be written in C++17\n- Read input from stdin\n- Write output to stdout\n- Pass all test cases efficiently\n\nEnclose your code within delimiters as follows:\n```cpp\n// YOUR CODE HERE\n```\n\n\n### Problem:\nA. Circle of Apple Trees\n\ntime limit per test: 1 second\nmemory limit per test: 256 megabytes\n\nThere are n apple trees arranged in a circle. Each tree bears exactly one apple, and the beauty of the apple on the i-th tree is given by b_i for all 1 ≤ i ≤ n. You start in front of tree 1.\n\nAt each tree, you may choose to either eat the apple or skip it. After making your choice, you move to the next tree: from tree i, you move to tree i+1 for 1 ≤ i ≤ n-1, and from tree n, you move back to tree 1. This process continues indefinitely as you move through the trees in a cycle.\n\nHowever, you have a special condition: you may only eat an apple if its beauty is strictly greater than the beauty of the last apple you ate. For example, if b = [2,1,2,3] and you eat the apple on tree 1 (beauty 2), you cannot eat the apples on trees 2 and 3 because their beauties are not greater than 2. However, you may eat the apple on tree 4 since b_4 = 3 > 2.\n\nNote that you are allowed to skip an apple when you first encounter it, and you can choose to eat it later on a subsequent cycle.\n\nYour task is to determine the maximum number of apples you can eat if you make optimal decisions on when to eat or skip each apple.\n\nInput\nEach test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 500). The description of the test cases follows.\n\nThe first line of each test case contains a single integer n (1 ≤ n ≤ 100) — the number of apple trees.\n\nThe second line of each test case contains n integers b_1, b_2, ..., b_n (1 ≤ b_i ≤ n) — the beauty of the apples on the trees.\n\nNote that there are no constraints on the sum of n over all test cases.\n\nOutput\nFor each test case, output a single integer representing the maximum number of apples you can eat.\n\nExample\nInput:\n3\n4\n2 2 2 2\n5\n1 4 5 1 2\n6\n5 4 2 1 2 3\n\nOutput:\n1\n4\n5\n\n\n\n### Answer: (use the provided format with backticks)", "role": "user" } ]
codeforces
{ "method": "rule", "problem_id": "2159_A" }
{ "contest": "2159", "index": 0, "problem": "A", "split": "train" }
codeforces
[ { "content": "You are an expert C++ competitive programmer. You will be given a competitive programming problem and need to write a correct C++ solution that passes all test cases.\n\nYour solution should:\n- Be written in C++17\n- Read input from stdin\n- Write output to stdout\n- Pass all test cases efficiently\n\nEnclose your code within delimiters as follows:\n```cpp\n// YOUR CODE HERE\n```\n\n\n### Problem:\nEASY. Sum of Two Numbers\n\ntime limit per test: 1 second\nmemory limit per test: 256 megabytes\n\nGiven two integers a and b, output their sum.\n\nInput\nEach test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 100).\n\nEach test case contains two integers a and b (1 ≤ a, b ≤ 1000).\n\nOutput\nFor each test case, output a single integer representing a + b.\n\nExample\nInput:\n3\n1 2\n5 7\n100 200\n\nOutput:\n3\n12\n300\n\n\n\n### Answer: (use the provided format with backticks)", "role": "user" } ]
codeforces
{ "method": "rule", "problem_id": "2159_EASY" }
{ "contest": "2159", "index": 1, "problem": "EASY", "split": "train" }
README.md exists but content is empty.
Downloads last month
18