直方图

Luogu
IDLGB2096
Time1000ms
Memory128MB
DifficultyP1
数组
给定一个非负整数数组,统计里面每一个数的出现次数。我们只统计到数组里最大的数。 假设 $Fmax(Fmax \le 100000)$是数组里最大的数,那么我们只统计 $\{0,1,2 \ldots Fmax \}$ 里每个数出现的次数。 ## Input 第一行 $n$ 是数组的大小。$1 \le n \le 100000$。 紧接着一行是数组的 $n$ 个元素。 ## Output 按顺序输出每个数的出现次数,一行一个数。如果没有出现过,则输出 $0$。 对于例子中的数组,最大的数是 $3$,因此我们只统计 $\{0,1,2,3\}$ 的出现频数。 [samples]
Samples
Input #1
5
1 1 2 3 1
Output #1
0
3
1 
1
API Response (JSON)
{
  "problem": {
    "name": "直方图",
    "description": {
      "content": "给定一个非负整数数组,统计里面每一个数的出现次数。我们只统计到数组里最大的数。 假设 $Fmax(Fmax \\le 100000)$是数组里最大的数,那么我们只统计 $\\{0,1,2 \\ldots Fmax \\}$ 里每个数出现的次数。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB2096"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "给定一个非负整数数组,统计里面每一个数的出现次数。我们只统计到数组里最大的数。\n\n假设 $Fmax(Fmax \\le 100000)$是数组里最大的数,那么我们只统计 $\\{0,1,2 \\ldots Fmax \\}$ 里每个数出现的次数。\n\n## Input\n\n第一行 $n$ 是数组的大小。$1 \\le n \\le 100000$。\n\n紧接着一行是数组的 $n$ 个元素。\n\n## Output\n\n...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments