Saturday, 24 August 2013

LinearKingdomParkingLot of TopCoder solution in C++

LinearKingdomParkingLot of TopCoder solution in C++

about the answer
http://community.topcoder.com/stat?c=problem_solution&rm=305511&rd=14283&pm=10982&cr=19849563
I am just wondering why int t1=solve(d+1,min(p1,a[d]),p2)+(int)(a[d]>p1);?
if the 'd' stands for the dth element of vi,why t1++ when
a[d]>p1,shouldn't it be < here , what the meaning of this sentence, I
think it is when insert the dth element of vi into the parking lot on
condition that the element after dth have been inserted into the lot?Is
that right?

No comments:

Post a Comment