Akuna CapitalOA #6
Variable Tick Rounding
估计中等评测数据准备中,可先阅读题面
A Tick describes a range with [lowerBound, upperBound) and a width. A VariableTickTable has cabinetPrice and a vector of Tick ranges. For each input price:
- If
price == cabinetPrice→ no rounding needed. - Else if
priceis already tick-aligned in its range → unchanged. - Else round to nearest multiple of the range's width (ties → up).
Example: cabinet = 0.01, ticks [(0, 1, 0.01), (1, 5, 0.05), (5, 100, 0.10)], prices [0.01, 0.4, 1.07] → [0.01, 0.4, 1.05] (1.07 in range [1,5) rounds to nearest 0.05 step = 1.05).