名校训练1420: Strange Numbers题解 (givenonelineofn)

冷夕颜 算法基础篇 33 0
想要成为编程高手?那就来试试全网最全C++题库,让您在练习中快速成长。
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:. Then, as the description above, the second line of numbers should be:. 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.

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.

名校训练1420: Strange Numbers题解
(givenonelineofn)-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: 名校训练1420: Strange Numbers题解