SRM 636 DIV1 1000

Revision en1, by OmaeWaMouShenDeiru, 2015-08-30 02:44:49

This is the problem statement.

In My solution I precalculate the sortedness between existing values and save it in global variable sum

Then I calculate the value val[i][j] where i represent the index of a position with missing value in the given sequence and j represent the index of one of the missing values in vector want,

then I find the rest of sortedness values using TSP function, I used map because the state would be too big to fit in an array.

But the solution didn't pass.

Is there any other optimizations to be considered for my implementation.

Thanks.

Tags optimization, topcoder, dynamic programming, binary indexed tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English OmaeWaMouShenDeiru 2015-08-30 02:44:49 712 Initial revision (published)