摘要: DIV1 250 && DIV2 500:1- N之内的数,按照字典序排序,取前最多50个。eg; N = 11, ans = 1, 10, 11, 2, 3, 4, ..., 9这道题只能模拟,从1开始,往下加0, 一直加到溢出为止, 回退, 再加1, 直到加到末位是0为止:View Code 1 long long tmp = val * 10;2 if (tmp <= n) dfs(tmp);3 else4 {5 tmp = val + 1;6 if (tmp <= n && tmp % 10 != 0) dfs(tmp);7 ... 阅读全文
posted @ 2013-05-04 22:24 kaitian 阅读(358) 评论(0) 推荐(0) 编辑