测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | FAIL |
| 代码长度 | 512 字符 |
模型生成的代码 (512 字符)
from collections import Counter
def count_Pairs(arr, n):
"""
Counts the number of unordered pairs from the list `arr` (of length `n`)
where the two elements are unequal.
Parameters:
arr (list): List of integers.
n (int): Length of the list.
Returns:
int: Count of unordered pairs with unequal elements.
"""
total_pairs = n * (n - 1) // 2
freq = Counter(arr)
equal_pairs = sum(v * (v - 1) // 2 for v in freq.values())
return total_pairs - equal_pairs
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 7, 6], 2]