Mbpp/556

⚠️ 仅 Base 通过 Base: PASS Plus: FAIL
测试评估
指标结果
Base 测试PASS
Plus 测试FAIL
代码长度362 字符
模型生成的代码 (362 字符)
def find_Odd_Pair(arr, n):
    """
    Count the number of pairs (i, j) in arr such that arr[i] ^ arr[j] is odd.
    Since XOR is odd iff the two numbers have different parity,
    the answer is (#odd) * (#even).
    """
    odd_count = sum(1 for x in arr if x % 2 != 0)
    even_count = n - odd_count  # or len(arr) - odd_count
    return odd_count * even_count
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1]