Dotcpp  >  编程题库  >  Strange Numbers
题目 1420:

Strange Numbers

时间限制: 2s 内存限制: 192MB 提交: 106 解决: 18

题目描述

Given one line of N consecutive natural numbers starts from 0 called A[N], and the target is to give another line of N numbers called B[N], and B[i] is the times that A[i] appears in B[N].
For example, when N=10.the first line of number is:
A: 0 1 2 3 4 5 6 7 8 9
Then, as the description above, the second line of numbers should be:
B: 6 2 1 0 0 0 1 0 0 0
Which B[0]=6 means, A[0] appears 6 times in B,
B[1]=2 means, A[1] appears 2 times in the second line, ... , and so on.
Your task is to give the second line of number B, for each given A.

输入格式

The input contains nulti cases, each case consists only one number N (7<N<1000)

输出格式

For each test case, output the n numbers in B.

样例输入

10

样例输出

6 2 1 0 0 0 1 0 0 0

提示

零基础同学可以先学习视频课程,包含C/C++、Python、百练、蓝桥杯辅导、算法数据结构等课程,提供视频讲解以及配套习题,还有老师答疑,点击这里了解课程详情
标签