- Code: Select all
Removed After AC
Thanx in advance.
Moderator: Board moderators
Removed After AC
1
10
3
8
1
5
10
4
9
2
7
6

RC's wrote:By the way, could you share your algorithm here ? Brute force will certainly get Time Limit Exceeded...
wahab wrote:1. Compute LIS and LDS using DP O(n^2)
wahab wrote:RC's wrote:By the way, could you share your algorithm here ? Brute force will certainly get Time Limit Exceeded...
1. Compute LIS and LDS using DP O(n^2)
2. loop and compute max(LIS[i]+LDS[i]-1) for all i
rest wrote:plz.. explain what do you mean by LIS[i] or LDS[i] ?
shiplu_1320 wrote:for the input given by rio above,
LIS[0]=4
LDS[0]=5
wahab wrote:shiplu_1320 wrote:for the input given by rio above,
LIS[0]=4
LDS[0]=5
LIS[0]=4
LDS[0]=5
so LIS[0]+LDS[0]-1= 8
but answer should be 5.for the input above
LIS ARRAY IS 3 2 3 2 1 2 1 2 1 1
LDS ARRAY IS 2 4 1 3 4 2 3 1 2 1
then the best value is at
LDS[1]+LIS[1] = 4 + 2 -1 = 5
saiful_sust wrote:LIS ARRAY [0]=3; && LDS ARRAY[0]=2.how it possible?????
CAN any expain it................
Users browsing this forum: No registered users and 1 guest