摘要: 代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--x=x*2;/*n(1+n)/2=x*/n=(int)sqrt(x);/*a*b=c^2thena<=c<=b,son<=sqrt(2x)<=n+1*/for(;n>=... 阅读全文
posted @ 2010-09-07 00:43 断桥残雪 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 大概思路:用一个变量记录当前搜索的步数m,枚举m步内的所有组合,为了保证唯一,按降序枚举代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--voidsplitN(intn,intm){for(inti=1;i<=n;++i){if(x[m-1]&... 阅读全文
posted @ 2010-09-07 00:19 断桥残雪 阅读(229) 评论(0) 推荐(0) 编辑