← 返回 apple 的题目列表Constrain an Increasing Array With Minimum Adjacent Difference
类型:online_judge
Given a randomized dynamic integer array arr, write a SystemVerilog constraint such that the array is strictly increasing and the difference between every adjacent pair is at least 2.
For every index satisfying 0 <= i < arr.size()-1:
arr[i+1] >= arr[i] + 2
The array length may be 0, 1, or larger.
Example
Input
arr={}
Output
满足约束