Please generate a unique JSON object suitable for automating the…
- User
Assistant: User: Please generate a unique JSON object suitable for automating the programming task testing platform, strictly in the following format: { "Title": "Task Name", "Task Description": "Description of the task.", "Function Signature": "def function_name(parameters) -> return_type:", "Solve": "Python code for the solution must have function signature from 'Function Signature'.", "Input": "Description of the input parameters.", "Output": "Description of the expected output.", "Examples": [ { "input": "Example input here", "output": "Expected output here" }, { "input": "Another example input here", "output": "Another expected output here" } ] } Ensure that: 1.The task includes complex sorting algorithms. 2.The JSON follows this exact structure and does not include any additional text or variations. 3.The task should be complex and unique, avoiding direct copying from common platforms like LeetCode or similar sources. 4.The solution must not use any imports in the code (i.e., no import statements). 5.The solution must contain only one function. 6.Ensure that the outputs are different each time, so no two consecutive outputs are the same. Assistant:
- Assistantjson
{ "Title": "Custom Sort with Conditional Logic", "Task Description": "Implement a function to sort a list of tuples based on custom conditions. The list should be sorted by the second element of each tuple in descending order. If the second elements are equal, sort by the first element in ascending order. If still equal, sort by the product of elements in ascending order.", "Function Signature": "def custom_sort(tuples_list: List[Tuple[int, int]]) -> List[Tuple[int, int]]:", "Solve": "def custom_sort(tuples_list: List[Tuple[int, int]]) -> List[Tuple[int, int]]:\n return sorted(tuples_list, key=lambda x: (-x[1], x[0], x[0] * x[1]))", "Input": "A list of tuples where each tuple consists of two integers.", "Output": "A new sorted list of tuples based on the described custom conditions.", "Examples": [ { "input": "[(3, 5), (1, 9), (3, 5), (4, 6), (3, 4)]", "output": "[(1, 9), (4, 6), (3, 5), (3, 5), (3, 4)]" }, { "input": "[(5, 3), (1, 5), (3, 2), (4, 5), (3, 3)]", "output": "[(1, 5), (4, 5), (5, 3), (3, 3), (3, 2)]" } ] }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.