摘要:
题目链接:http://codeforces.com/contest/334/problem/A题意:有n个人,将1~n袋(第 i 袋共有 i 颗糖果,10)输出即可。可能方法有点笨,希望热心的读者可以提出些更好的方法,让我学习学习。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = 10000 + 10; 7 8 int main() 9 {10 int i, j, k, l, n, temp[maxn];11 while (scanf("%d", &n) != 阅读全文
摘要:
题目链接:http://codeforces.com/problemset/problem/331/C1 这是第一次参加codeforces比赛(ABBYY Cup 3.0 - Finals (online version))成功AC的题目(n ≤ 106),解题的突破口是:Take the magic number, subtract a digit from it (the digit must occur in the number) and get a new magic number. Repeat this operation until a magic number equal. 阅读全文