|
|
Show all threads Hide all threads Show all messages Hide all messages | is this algo correct?? | Shen Yang | 1967. Programmer Casino | 16 Nov 2017 11:21 | 3 | initially let result sequence to be 10* 10* 10* 0* means zero or more zeroes. every time choose two number and if we merge them produce a smaller number then we merge them. the procedure stops until we can't merge to get a smaller number is it correct?? seems to be.. Edited by author 16.11.2017 07:10 we should modify this algo: every time choose right most two number that we merge them can get a smaller number then we merge them,.... we must merge numbers from right to left.... seems to be more correct | How to prove? | bsu.mmf.team | 1967. Programmer Casino | 30 Aug 2016 11:24 | 4 | I've just brute-forced answers for N = 2...500 and found the trick. But how to prove it is always correct or, at least, for the given binary sequences? Yes, there is a proof. Your e-mail, please. Brute force answers for N = 2.. 500 is a vary good hint for this problem ). Thank you. |
|
|
|