Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我的思路生成方法: 5 = 2+3; 6 = 2+4; 7 = 3+4; 8 = 3+5; 9 = 2+3+4; . . . //以5 = 2+3为基础生成6,考虑将1加到哪个数字上, 1. 因为不能重复所以每次就找相差为二的数(6=2+4,加到2上), 2. 如果找不到就加到最大那个数上(5=2+3,加到3上), 3. 再者如果最小的数是3,且找到的相差为二的数是最大的更次大的,则将最大的减1,末尾补个2(如:8=3+5,9=2+3+4)。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator