Toggle navigation
拓智机器人OJ
F.A.Qs
Web Board
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Problem1115--直方图
1115: 直方图
Time Limit:
1 Sec
Memory Limit:
128 MB
Submit:
4
Solved:
4
[
Submit
] [
Status
] [
Web Board
] [Creator:
]
Description
给定一个非负整数数组,统计里面每一个数的出现次数。我们只统计到数组里最大的数。
假设 Fmax(Fmax<10000)是数组里最大的数,那么我们只统计{0,1,2.....Fmax}里每个数出现的次数。
Input
第一行n是数组的大小。1 ≤ n ≤ 10000。
紧接着一行是数组的n个元素。
Output
按顺序输出每个数的出现次数,一行一个数。如果没有出现过,则输出0。
对于例子中的数组,最大的数是3,因此我们只统计{0,1,2,3}的出现频数。
Sample Input
Copy
5 1 1 2 3 1
Sample Output
Copy
0 3 1 1
Source/Category
一维数组