摘要: Start from the baseline number, which ranges from 0 to 9, giving a baseline number B, and digit sequence N(i) 1<=i<=n, I generate another digit sequence D(i), whose elements are B - N(i).Sorting D(i), then the first K digit can sum the minimun result of prize.But when there is equal minimun pr 阅读全文
posted @ 2011-10-09 21:30 DOF_KL 阅读(184) 评论(0) 推荐(0) 编辑
摘要: It seems the problem is easy. Using 2 arrays, one to hold the original input string, and copy chars to the other according to the rules.In order to make code more tidy, I don't do all the thing within a single loop, instead, I will do the upper to lower work in the first loop, here I like the tr 阅读全文
posted @ 2011-10-09 10:11 DOF_KL 阅读(339) 评论(0) 推荐(0) 编辑
摘要: The rule is simple. First determin the number of rows to print, then for every row follow the rule.Total rows = 2n + 1.The ith row has 2i + 1 digits to print, from 0 to i then to 0.The ith row skip 2n - 2i spaces.Accepted.#include <stdio.h>#include <string.h>int main() { int n; scanf(&qu 阅读全文
posted @ 2011-10-09 10:09 DOF_KL 阅读(287) 评论(0) 推荐(0) 编辑