DP : segfault on bigger inputs