benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 202e20c2-5ca2-5ada-8b6b-9d01a0cd7b37

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import itertools
import math

def task_func(x):
    """
    Find the key pair in a dictionary, x, which has the highest sum of the cosine of each of its values.

    Parameters:
    - x (dict): The dictionary of key-value pairs.

    Returns:
    - tuple: The pair of keys with the highest sum of the cosine of their values.

    Requirements:
    - itertools
    - math

    Example:
    >>> task_func({'a': 1, 'b': 2, 'c': 3})
    ('a', 'b')
    ('a', 'b')
    >>> task_func({'a': 1, 'b': 2, 'c': 3, 'd': 4})
    ('a', 'b')
    ('a', 'b')
    """

instruct prompt

Find the key pair in a dictionary, x, which has the highest sum of the cosine of each of its values.
The function should output with:
    tuple: The pair of keys with the highest sum of the cosine of their values.
You should write self-contained code starting with:

Code

import itertools
import math
def task_func(x):

code prompt

Code

import itertools
import math
def task_func(x):

entry point

task_func

libs

  • math
  • itertools

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import