← 返回 apple 的题目列表Constrain Every Five Consecutive Array Elements to Be Unique
类型:online_judge
Given a randomized dynamic integer array arr, write a SystemVerilog constraint such that every consecutive window of five elements contains pairwise distinct values.
Requirements:
If the array length is less than 5, the constraint imposes no additional uniqueness restriction.
If the array length is at least 5, for every start index i, arr[i] through arr[i+4] must all be distinct.
Global uniqueness of the entire array is not required; elements at least five positions apart may be equal.
Example
Input
arr.size()=0
Output
满足约束