测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | FAIL |
| 代码长度 | 418 字符 |
模型生成的代码 (418 字符)
def find_Odd_Pair(arr, n):
"""
Counts the number of pairs (i, j) with i < j such that arr[i] ^ arr[j] is odd.
Parameters:
arr : list of int
The input array.
n : int
Length of the array.
Returns:
int
Number of pairs with odd XOR value.
"""
odd_count = sum(1 for x in arr if x & 1)
even_count = n - odd_count
return odd_count * even_count
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1]