|
|
back to boardShow all messages Hide all messagesany hint as to how binary search technique can be used for this problem? Yua can do bs over a1, recalc sequence on each step and check either last element of new sequence greater An+1 or less Do you mean to say i should choose a random number as a[1] and based on that value calculate a[n]. Then in the subsequent steps adjust the value of a[1] depending on how close the previous value of a[n] calculated was to the given value of a[n]. Is this the idea? Do you mean to say i should choose a random number as a[1] and based on that value calculate a[n]. Then in the subsequent steps adjust the value of a[1] depending on how close the previous value of a[n] calculated was to the given value of a[n]. Is this the idea? it's another approximation method you can do bs of a[1] on range l:=-1000 to r:=1000 mid=(l+r)/2 a[1]=mid then calc new a'[n] if a'[n] > a[n](wich is given) then r=mid else l=mid that's all |
|
|