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.
看不懂最后一句话可以划过下面的黑线,英语太蹩脚了!!!
请你计算,每个英雄可以成为多少英雄的战斗导师。
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,)
just one line, n integers, represents the number of heros each hero can serve as a instructor.
4 2 10 4 10 15 1 2 4 3
0 0 1 2