|
|
back to boardWA:9 Who can helpme with some hint about this problem? Any right answers, any tests... I've got WA:9, and I can't find mistake Re: WA:9 Posted by breeze 18 Apr 2004 19:26 5->4 6->4 7->4 8->4 9->4 10->8 11->8 12~19->6 20~39->11 40->99->31 100~119->71 120~199->51 200~399->101 400~999->301 and so on......i use this rule and got AC. maybe it is a bad methodology...... Edited by author 18.04.2004 19:35 Re: WA:9 Why the answer is 4 when n is from 5 to 9? Re: WA:9 to breeze: thanks... you tests very helped me... Re: WA:9 But if input: 1000 - 701? 1100 - 701? 1200 - 501? 1300 - 501? 2000 - 1001? 4000 - 3001? I have WA#11 Re: WA:9 Posted by yuhch 25 Oct 2007 17:57 [deleted] Edited by author 25.10.2007 17:59 Re: WA:9 Posted by yuhch 25 Oct 2007 17:57 why the answer to n=40 is 31? Re: WA:9 Because range 1..5 has each lamp in ON and OFF states, and it appears to be the smallest range for all 5<=N<=9 My solution is checking all A..B ranges for the 1st digit. If B-A>1, then I set it as A999999999 till B00000000. If B-A=1, then I try all ranges for the 2nd digit. It appears that no more recursion is necessary, so the answer will be minimal among all BD000000... - AC9999... where A..B covers all lamp states for the 1st digit (consider their existence too and treat zero as all-off) and 0..C together with D..9 covers all lamp states for the 2nd digit. |
|
|