DP with dynamic cycle array