Ask instructor

TimeLimit:1000MS  MemoryLimit:128MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description

Dalstar has n powerful junior heros, number 1 to n.

The fighting force of the ith hero is ri.

Hero a can be Hero b's combat instructor when and only if ra > rb and there is no contradiction between the two.

Given the combat effectiveness value of each hero and the k-pair contradiction between the heros.

Please calculate how many heros each hero can become a instructor.

看不懂最后一句话可以划过下面的黑线,英语太蹩脚了!!!

请你计算,每个英雄可以成为多少英雄的战斗导师。

Input

The first line contains two integers n and k.

The second row contains n integers r1, r2,...,rn.

The next k line, each of which contains two integer x,y, indicates a contradiction between Hero x and Hero y. The same pair of contradictions is not given repeatedly in the input, after x,y appears, x, y or y,x does not appear again.

(2≤n≤2×105 ,0≤k≤min(2×105, n(n−1)/2),1≤ri≤109,1≤x,y≤n,)

Output

just one line, n integers, represents the number of heros each hero can serve as a instructor.

SampleInput
4 2
10 4 10 15
1 2
4 3
SampleOutput
0 0 1 2
Submit
题目统计信息详细
总AC数9
通过人数6
尝试人数20
总提交量37
AC率16.22%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
作者

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: