problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02689
u072284094
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['count, way = list(map(int, input().split()))\nheight = list(map(int, input().split()))\nisGood = [True] * count\n\nfor i in range(way):\n obs_a, obs_b = list(map(lambda x: int(x) - 1, input().split()))\n if(height[obs_a] > height[obs_b]):\n isGood[obs_b] = False\n else:\n isGood[obs_a] = False\...
['Wrong Answer', 'Accepted']
['s903261882', 's435619222']
[20056.0, 20128.0]
[271.0, 270.0]
[323, 450]
p02689
u078276601
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['h_list = list(map(int, input().split()))\nnewlist = list(h_list)\nfor i in range(m):\n a, b = map(int, input().split())\n if h_list[a-1] < h_list[b-1]:\n newlist[a-1] = 0\n elif h_list[a-1] > h_list[b-1]:\n newlistlist[b-1] = 0\n else:\n newlist[a-1] = 0\n newlist[b-1] = 0\npri...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s731967093', 's896167393', 's971693996', 's542437791']
[9156.0, 9140.0, 9168.0, 20112.0]
[24.0, 25.0, 29.0, 250.0]
[341, 389, 393, 411]
p02689
u082978753
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nlisH = list(map(int, input().split()))\n\nlisN = [[] for i in range(N)]\nfor i in range(M):\n inlis = list(map(int, input().split()))\n lisN[max(inlis)-1].append(lisH[min(inlis)-1])\n\nans = 0\nfor i in range(N):\n if len(lisN[i])>0:\n if lisH[i] > max(lisN[i]):\n ...
['Wrong Answer', 'Accepted']
['s814915663', 's495922236']
[22028.0, 37604.0]
[362.0, 516.0]
[361, 443]
p02689
u086138398
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['temp = input().split(" ")\nN = int(temp[0])\nM = int(temp[1])\nH = input().split(" ")\ngood = [1] * N\nfor i in range(M):\n root = input().split(" ")\n a = int(root[0])-1\n b = int(root[1])-1\n if H[a]=>H[b]:\n good[b] = 0\n if H[a]<H[b]:\n good[a] = 0\n\nprint(sum(good))', 'temp = input(...
['Runtime Error', 'Accepted']
['s229052105', 's080721808']
[9048.0, 18340.0]
[23.0, 682.0]
[287, 308]
p02689
u086624329
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M=map(int,input().split())\n\nheight=list(map(int,input().split()))\n\ntower=[0]*N\n\n\n\nfor i in range(M):\n A,B=map(int,input().split())\n if height[A-1]<height[B-1]:\n tower[A-1]=1\n else:\n tower[B-1]=1\n \n print(tower)\n \nprint(tower.count(0))\n ', 'N,M=map(int,inp...
['Wrong Answer', 'Accepted']
['s760433750', 's249282546']
[137316.0, 20116.0]
[3045.0, 251.0]
[281, 320]
p02689
u091307273
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['def main():\n n, m = (int(i) for i in input().split())\n h = [int(i) for i in input().split()]\n roads = [(int(i) for i in input().split()) for _ in range(m)]\n\n nbors = [[] for _ in range(n)]\n for a, b in roads:\n nbors[a-1].append(b-1)\n nbors[b-1].append(a-1)\n\n ngood = 0\n fo...
['Wrong Answer', 'Accepted']
['s677878252', 's959286670']
[110344.0, 110416.0]
[653.0, 656.0]
[422, 418]
p02689
u091489347
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['l = list(map(int, input().split()))\nli = list(map(int, input().split()))\n\ng = []\nfor i in range(l[1]):\n a, b = map(int, input().split())\n if li[a-1] == li[b-1]:\n g += [a, b]\n if li[a-1] >= li[b-1]:\n g += [b]\n else:\n g += [a]\n print(g)\n\ng = set(g)\nprint(l[0] - len(g)...
['Runtime Error', 'Accepted']
['s755653879', 's856426110']
[141228.0, 20112.0]
[1590.0, 260.0]
[304, 296]
p02689
u095384238
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy as np\nN, M = map(int, input().split())\nH = list(map(int, input().split()))\nyoi = np.ones(M)\nfor i in range(M):\n A, B = map(int, input().split())\n if H[A-1] > H[B-1]:\n yoi[B-1] = 0\n elif H[B-1] > H[A-1]:\n yoi[A-1] = 0\n elif H[A-1]==H[B-1]:\n yoi[A-1] = 0\n ...
['Runtime Error', 'Accepted']
['s860655518', 's671161071']
[38620.0, 38592.0]
[364.0, 349.0]
[343, 343]
p02689
u101785141
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh_array = list(map(int, input().split()))\nab = []\nsum = 0\n\nfor i in range(m):\n ab.append(list(map(int, input().split())))\n\nprint(ab)\n\nfor i in range(1, n + 1):\n array = [element for element in ab if element[0] == i or element[1] == i]\n array.sort()\n result = True\n p...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s156949789', 's223624559', 's450638233']
[35064.0, 31472.0, 31992.0]
[2206.0, 2206.0, 339.0]
[570, 559, 412]
p02689
u102367647
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["from sys import stdin\nimport numpy as np\n\n\ndef main():\n n, m = list(map(int, stdin.readline().split()))\n hList = list(map(int, stdin.readline().split()))\n ABList = [list(map(int, stdin.readline().split())) for _ in range(m)]\n hRelations = np.zeros((n, n))\n '''\n for a, b in ABList:\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s397484398', 's428940629', 's441355848', 's682005285', 's187039498']
[49808.0, 49724.0, 49684.0, 49808.0, 49692.0]
[239.0, 226.0, 225.0, 230.0, 387.0]
[633, 633, 617, 613, 638]
p02689
u103341055
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M = map(int,input().split())\nH = [int(h) for h in input().split()]\n\nd = {}\n\nfor i in range(N):\n d[i+1] = H[i]\n\nfor _ in range(M):\n A,B = map(int,input().split())\n\n if H[B-1] > H[A]:\n d[A] = 0\n\n elif H[B-1] < H[A]:\n d[B] = 0\n\n elif H[B-1] == H[A]:\n d[A] = 0\n ...
['Runtime Error', 'Accepted']
['s478185917', 's186563729']
[24472.0, 24492.0]
[283.0, 334.0]
[350, 293]
p02689
u105290050
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m=map(int, input().split())\nh=list(map(int,input().split()))\nl = [[] for _ in range(n)]\n#print(l)\n#print(h)\nfor i in range(m):\n a, b=map(int, input().split())\n l[a-1].append(b)\n l[b-1].append(a)\nans=0\nprint(l)\nfor x in range(n):\n for y in range(len(l[x])):\n if h[x]<=h[l[x][y]-1]:\n break\n...
['Wrong Answer', 'Accepted']
['s535740345', 's209157405']
[33268.0, 29352.0]
[414.0, 364.0]
[390, 379]
p02689
u111652094
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M=map(int,input().split())\nH=list(map(int,input().split()))\n\nans_list=list(range(1,N+1))\n\nfor i in range(M):\n a,b=map(int,input().split())\n if H[a-1]<H[b-1]:\n if a in ans_list:\n ans_list.remove(a)\n if H[a-1]>H[b-1]:\n if b in ans_list:\n ans_list.remove(b)\n ...
['Wrong Answer', 'Accepted']
['s390602877', 's589727332']
[20060.0, 20036.0]
[2206.0, 294.0]
[482, 316]
p02689
u115110170
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = map(int,input().split())\nh= list(map(int,input().split()))\nans = [1]*n\n\nfor i in range(m):\n a,b = map(int,input().split())\n if h[a]>=h[b]:\n ans[b-1]=0\n if h[a]<=h[b]:\n ans[a-1]=0\nprint(sum(ans))\n \n\n \n ', 'n,m = map(int,input().split())\nh= list(map(int,input().split()))\nans = [1]*n\n\...
['Runtime Error', 'Accepted']
['s500161758', 's282427997']
[20104.0, 20104.0]
[243.0, 260.0]
[219, 219]
p02689
u116038906
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['\nimport sys\ninput = sys.stdin.readline\nN,M = (int(x) for x in input().split())\nH = [-1]+list(map(int, input().split()))\n\n\nobserv_H ={}\nconnction ={i:set() for i in range(1,N+1)}\n\n\nfor i in range(1,M+1):\n a,b = (int(x) for x in input().split())\n connction[a].add(b)\n connction[b].add(a)\n \n\n...
['Runtime Error', 'Accepted']
['s555567316', 's635982160']
[65944.0, 66092.0]
[448.0, 467.0]
[742, 766]
p02689
u119012830
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\n\nh = list(int, input())\na = [0]*m\nb = [0]*m\nfor i in range(m):\n a[i], b[i] = map(int, input().split())\nlist = []\nfor i in range(m):\n if h[a[i]-1] > h[b[i]-1]:\n list.append(a[i])\n elif h[a[i]-1] == h[b[i]-1]:\n list.append(a[i])\n list.append(b[...
['Runtime Error', 'Accepted']
['s161956925', 's892963059']
[10976.0, 23104.0]
[22.0, 393.0]
[543, 408]
p02689
u119982001
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['X=int(input())\n\nfor i in range(0, 1000):\n for j in range(-1000,0):\n if X == (i**5-j**5):\n print(i, j)\n exit()\n', 'X=int(input())\n\nfor i in range(0, 1000):\n for j in range(-1000,0):\n if X == (i**5-j**5):\n print(i, j)\n exit()\n', 'N,M=map(int,...
['Runtime Error', 'Runtime Error', 'Accepted']
['s016395328', 's403044492', 's643553643']
[9068.0, 9172.0, 20144.0]
[26.0, 23.0, 262.0]
[142, 142, 303]
p02689
u126146165
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nhigh = list(map(int, input().split()))\n\njudge = ["ok" for i in range(n)]\n\nfor i in range(m):\n a, b = [int(s) - 1 for i in input().split()]\n\n if high[a] < high[b]:\n judge[a] = "ng"\n elif high[a] > high[b]:\n judge[b] = "ng"\n else:\n judge[a] ...
['Runtime Error', 'Accepted']
['s040423675', 's302304171']
[20080.0, 20100.0]
[49.0, 249.0]
[362, 362]
p02689
u129749062
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int,input().split())\nAB = list()\ngood = [0]*N\ncount = 0\nH = list(map(int,input().split()))\nfor _ in range(M):\n ab = list(map(int,input().split()))\n AB.append(ab)\nprint(AB)\nfor i in range(M):\n if H[AB[i][0]-1] > H[AB[i][1]-1]:\n good[AB[i][1]-1] = -1\n elif H[AB[i][0]-1] < H[AB[i][1]-1]:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s098515382', 's181668750', 's221937077']
[35892.0, 35868.0, 31928.0]
[389.0, 363.0, 345.0]
[503, 433, 481]
p02689
u131411061
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M = map(int,input().split())\nH = list(map(int,input().split()))\n\nd = []\nfor i in range(M):\n A,B = map(int,input().split())\n d.append((A-1,B-1))\n\ncnt = 0\n#res = {}\n\n# res[i] = False\nflag = {}\nfor i in range(N):\n flag[i] = True\n\nfor i in d:\n A = i[0]\n B = i[1]\n #print("H[A] > H...
['Runtime Error', 'Accepted']
['s253795163', 's035298615']
[8996.0, 38024.0]
[22.0, 369.0]
[650, 424]
p02689
u133174241
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nL = [0]*N\nfor i in range(N):\n L[i] = [1]\nprint(L)\nfor i in range(M):\n A, B = map(int, input().split())\n if H[A-1] > H[B-1]:\n L[B-1].append(0)\n elif H[A-1] < H[B-1]:\n L[A-1].append(0)\n else:\n L[A-1].ap...
['Wrong Answer', 'Accepted']
['s904264797', 's370658468']
[25416.0, 24496.0]
[369.0, 326.0]
[464, 455]
p02689
u135116520
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M=map(int,input().split())\nH=list(map(int,input().split()))\na=[0]*N \nfor i in range(M):\n A,B=map(int,input().split())\n a[A-1]=max(a{A-1],H[B-1])\n a[B-1]=max(a[B-1],H[A-1])\ns=0\nfor i in range(M):\n if H[i]>A[i]:\n s+=1\nprint(s)\n ', 'N,M=map(int,input().split())\nH=list(map(int,input().split()))\nA=...
['Runtime Error', 'Accepted']
['s149105080', 's474395193']
[9020.0, 20040.0]
[20.0, 331.0]
[271, 246]
p02689
u135961419
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = list(map(int,input().split()))\nh = list(map(int,input().split()))\na = []\nb = []\nfor i in range(m):\n a0, b0 = list(map(int,input().split()))\n a.append(a0)\n b.append(b0)\n \ncount = [0] * n\n\nfor i in range(m):\n if h[a[i] - 1] <= h[b[i] - 1]:\n count[a[i] - 1] = 1\n if h[a[i] - 1] >= h[b[i] - 1...
['Runtime Error', 'Accepted']
['s393806529', 's337365061']
[9072.0, 22240.0]
[24.0, 300.0]
[356, 359]
p02689
u137226361
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['from itertools import chain\n\nn, m = map(int, input().split())\nH = list(map(int, input().split()))\n\nab = []\nfor i in range(m):\n ab.append(list(map(int, input().split())))\n\ncount = 0\n\nfor i in range(1, n+1):\n\n c= []\n e= []\n for j in ab:\n if i in j:\n c.append(j)\n d =lis...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s239813119', 's472293066', 's149240909']
[8912.0, 31392.0, 31092.0]
[22.0, 2206.0, 388.0]
[464, 613, 365]
p02689
u138045722
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['a=input().split()\nN=int(a[0])\nM=int(a[1])\nH=[int(x) for x in input().split()]\nway=[]\nfor i in range(M):\n way.append([int(x) for x in input().split()])\nprint(way)\ndic={}\nfor i in range(N):\n dic[i]=set()\n\nfor h in way:\n dic[h[0]-1].add(h[1]-1)\n dic[h[1]-1].add(h[0]-1)\n print(dic)\n\nprint(...
['Wrong Answer', 'Accepted']
['s282440722', 's473867253']
[157748.0, 70532.0]
[2611.0, 540.0]
[358, 338]
p02689
u139940813
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M= map(int,input().split())\n\nh = [int(i) for i in input().split()]\njudge = [True]*N\n\nfor i in range (M):\n a,b= map(int,input().split())\n if h[a - 1] > h[b - 1]:\n judge[b-1] = False\n if h[a - 1] < h[b - 1]:\n judge[a - 1] = False\n if h[a - 1] == h[b - 1]:\n judge[b-1] = Fal...
['Runtime Error', 'Accepted']
['s767595164', 's450826353']
[20124.0, 20104.0]
[286.0, 286.0]
[363, 363]
p02689
u140191608
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import itertools\nN , M = (map(int , input().split()))\nH = list(map(int , input().split()))\nAB = [list(map(int, input().split())) for i in range(M)]\nHH = {i+1 : H[i] for i in range(len(H))}\ncount = []\nfor i in AB:\n if HH[i[1]] > HH[i[0]]:\n count.append(i[1])\nfor i in HH:\n if i in CC:\n pa...
['Runtime Error', 'Accepted']
['s189726644', 's490419673']
[42816.0, 52740.0]
[328.0, 355.0]
[372, 449]
p02689
u146597538
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\n\nab = [list(map(lambda x: x -1, list(map(int, input().split())))) for _ in range(m)]\nprint(ab)\n\n\nans = 0\nfor i in range(n):\n cnt_flag = True\n for j in ab:\n if i in j:\n if h[i] <= h[list(((set(j))^{i}))[0]]:\n ...
['Wrong Answer', 'Accepted']
['s694466309', 's897555170']
[35128.0, 31996.0]
[2207.0, 353.0]
[427, 458]
p02689
u153846982
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = map(int,input().split())\nheight = list(map(int,input().split()))\n# print(height)\nbridge = [[] for i in range(n)]\n\nfor i in range(m):\n\ta,b = map(int,input().split())\n\tbridge[a-1].append(b-1)\n\tbridge[b-1].append(a-1)\n\n# print(bridge)\ngood = [None for i in range(n)]\n# print(good)\n\nflag = True\nfor...
['Wrong Answer', 'Accepted']
['s092468258', 's432473226']
[31548.0, 30364.0]
[381.0, 440.0]
[776, 778]
p02689
u161164709
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nAB = [list(map(int, input().split())) for i in range(M)]\n\ntf_array = [0]*N\n\nfor a, b in AB:\n print(a,b)\n if H[a-1] > H[b-1]:\n tf_array[b-1] += 1\n elif H[a-1] == H[b-1]:\n tf_array[a-1] += 1\n tf_array[b-1] += ...
['Wrong Answer', 'Accepted']
['s406346476', 's978368631']
[32272.0, 31980.0]
[374.0, 295.0]
[370, 356]
p02689
u161537170
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['number_of_observatory, number_of_road = map(int, input().split())\nheight_list = [0] \nheight_list.extend(list(map(int, input().split())))\n\nroad_list = []\nfor i in range(number_of_road):\n li = list(map(int, input().split()))\n road_list.append(li) \ncounta = 0\n\nnot_good_list = []\n\nfor road in road_lis...
['Wrong Answer', 'Accepted']
['s797199638', 's034328775']
[44716.0, 44408.0]
[324.0, 329.0]
[791, 793]
p02689
u162893962
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['# from collections import defaultdict\n\nn, m = map(int, input().split())\nhigh = [int(i) for i in input().split()]\n\n\nhigh_d = {}\nfor i in range(n):\n \n high_d[i+1] = high[i]\nprint(high_d)\n\nd = {}\nfor _ in range(m):\n a, b = map(int, input().split())\n if a not in d:\n d[a] = [b] \n el...
['Wrong Answer', 'Accepted']
['s276904912', 's042790667']
[43532.0, 41540.0]
[555.0, 432.0]
[791, 795]
p02689
u163783894
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m=map(int,input().split())\narr=[0]+list(map(int,input().split()))\ng=[[] for _ in range(n+1)]\nfor _ in range(m):\n a,b=map(int,input().split())\n g[a].append(b)\n g[b].append(a)\nans=0\nfor v in range(1,n+1):\n for u in g[v]: \n if arr[u]>=arr[v]:\n break\n else: \n ...
['Wrong Answer', 'Accepted']
['s718563690', 's879552296']
[29332.0, 29476.0]
[372.0, 342.0]
[539, 531]
p02689
u167647458
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\n\nx = [set() for _ in range(n)]\nfor a, b in ab:\n x[a-1].add(b-1)\n x[b-1].add(a-1)\nprint(x) \nans = 0\nfor i, xx in enumerate(x):\n for xxx in xx:\n if h[i] <= h[xxx]:...
['Wrong Answer', 'Accepted']
['s990605843', 's614886350']
[68224.0, 63512.0]
[564.0, 472.0]
[371, 363]
p02689
u171328579
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = (int(x) for x in input().split())\nH = list(map(int, input().split()))\n\nGT = [1 for i in range(N)]\n\nfor i in range(M):\n A, B = (int(x) for x in input().split())\n if H[A-1] != H[B-1]:\n L = min(H[A-1], H[B-1])\n GT[H.index(L)] = 0\n else:\n GT[A-1] = 0\n GT[B-1] = 0\n ...
['Wrong Answer', 'Accepted']
['s520605185', 's840469107']
[20124.0, 20128.0]
[2206.0, 352.0]
[318, 314]
p02689
u174181999
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nC = [list(map(int, input().split())) for i in range(M)]\nl = list()\nm = list()\ncnt = 0\nfor i in range(N):\n for j in range(M):\n if i+1 in C[j]:\n l = l + [H[C[j][0]-1], H[C[j][1]-1]]\n else:\n pass\n print(l)\n if len(l) == ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s828372414', 's952014821', 's933825804']
[8988.0, 31264.0, 19980.0]
[23.0, 2206.0, 250.0]
[440, 491, 229]
p02689
u175746978
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import copy\n\nn,m=map(int,input().split())\nh=list(map(int,input().split()))\nl=[]\nfor i in range(m):\n a,b=map(int,input().split())\n l.append([a,b])\n\nll=[0]*n\n\nfor j in l:\n if h[j[0]-1]>h[j[1]-1]:\n ll[j[1]-1]+=1\n elif h[j[0]-1]==h[j[1]-1]:\n ll[j[1]-1]+=1\n ll[j[0]-1]+=1\n ...
['Wrong Answer', 'Accepted']
['s320806538', 's609929954']
[29112.0, 29240.0]
[309.0, 306.0]
[390, 390]
p02689
u178465329
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['\nn, m = list(map(int, input().split(" ")))\nh = list(map(int, input().split(" ")))\n\nans = [1] * n\n\nfor i in range(m):\n a, b = list(map(int, input().split(" ")))\n a,b = a-1,b-1\n\n if h[a] < h[b]:\n ans[a] = 0\n elif h[b] < h[a]:\n ans[b] = 0\n else:\n ans[a] = 0\n ans...
['Wrong Answer', 'Accepted']
['s211684497', 's324780998']
[20116.0, 20116.0]
[269.0, 267.0]
[324, 333]
p02689
u179304833
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['from collections import Counter\nn=int(input())\nalist=list(map(int,input().split()))\na1=[]\na2=[]\nfor i,a in enumerate(alist):\n a2.append(i-a)\n a1.append(i+a)\naa=Counter(a2)\ncount=0\nfor k in a1:\n count+=aa.get(k,0)\nprint(count)', 'import numpy as np\nn,m=map(int,input().split())\nhlist = list(map(int,inp...
['Runtime Error', 'Accepted']
['s939102550', 's722714374']
[9368.0, 61380.0]
[23.0, 420.0]
[228, 440]
p02689
u181159654
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nnum = [0]*n\nchk = [0]*n\nfor _ in range(m):\n a, b = map(int, input().split())\n num[a-1] += 1\n num[b-1] += 1\n if h[a-1]>h[b-1]:\n chk[a-1] += 1\n elif h[b-1]>h[a-1]:\n chk[b-1] += 1\nans = 0\nfor i in range(m):\n ...
['Runtime Error', 'Accepted']
['s573162747', 's566096641']
[20136.0, 20116.0]
[301.0, 333.0]
[352, 281]
p02689
u185297444
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['#ABC166d\nN, M = map(int,input().split())\nH = list(map(int, input().split()))\ncount=[0]*M\nA = [0]*M\nB = [0]*M\n\nfor i in range(M):\n A[i], B[i] = map(int, input().split())\n\nans = [1]*N\n\nfor i in range(N):\n if H[A[i]-1] == H[B[i]-1]:\n ans[A[i]-1] = 0\n ans[B[i]-1] = 0\n elif H[A[i]-1]...
['Runtime Error', 'Runtime Error', 'Accepted']
['s226909098', 's653134660', 's033422699']
[22456.0, 22476.0, 22576.0]
[293.0, 297.0, 292.0]
[412, 412, 412]
p02689
u185393907
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nheight = input().split()\narea = [[] for i in range(N)]\nfor i in range(M):\n road = input().split()\n for place in road:\n area[int(road[0])-1].append(int(height[int(road[1])-1]))\n area[int(road[1])-1].append(int(height[int(road[0])-1]))\ncounter = 0\nfor i in r...
['Wrong Answer', 'Accepted']
['s760211857', 's379426747']
[50752.0, 40176.0]
[731.0, 607.0]
[456, 444]
p02689
u185405877
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = list(map(int, input().split()))\ni = list(map(int, input().split()))\nk=i\nans=0\nfor j in range(m):\n a,b = list(map(int, input().split()))\n if i[a-1]==i[b-1]:\n k[a-1]=0\n k[b-1]=0\n else:\n if i[b-1]>i[a-1]:\n k[a-1]=0\n else:\n k[b-1]=0\n ...
['Wrong Answer', 'Accepted']
['s552555146', 's818930038']
[19996.0, 20136.0]
[298.0, 278.0]
[376, 390]
p02689
u194472175
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M = map(int,input().split())\nH=list(map(int,input().split()))\nl = [[]*i for i in range(N)]\nprint(l)\nfor i in range(M):\n A,B=map(int,input().split())\n l[A-1].append(B)\n l[B-1].append(A)\nans=0\nfor j in range(N):\n if all(H[elem-1] < H[j] for elem in l[j])==True:\n ans +=1\nprint(ans)', 'N,...
['Wrong Answer', 'Accepted']
['s236790719', 's226419121']
[30176.0, 29468.0]
[415.0, 409.0]
[300, 291]
p02689
u199941968
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M=map(int,input().split())\nhigh_list=list(map(int,input().split()))\npathlist=[]\nfor i in range(M):\n pathlist.append(list(map(int,input().split())))\nwaylist=[0]*N\nans=0\n\nfor n in range(1,N+1):\n for m in pathlist:\n if(n in m):\n if(m[0]==n):\n if(high_list[n-1]>high_li...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s352800483', 's412255078', 's701383162', 's320049994']
[32028.0, 50992.0, 8940.0, 20052.0]
[2206.0, 2207.0, 23.0, 252.0]
[601, 905, 296, 295]
p02689
u202406075
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy as np\n\nn,m = map(int, input().split())\nh = np.array(list(map(int, input().split())))\n\nhigh = np.array([0]*n)\ncnt = np.array([0]*n)\n\nfor _ in range(m):\n a,b = map(int, input().split())\n if h[a-1] > h[b-1]:\n h[a-1] += 1\n \n elif h[a-1] < h[b-1]:\n h[b-1] += 1\n cnt[...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s622626938', 's768806682', 's345884369']
[38500.0, 38620.0, 38576.0]
[518.0, 506.0, 396.0]
[401, 401, 428]
p02689
u208309047
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\npreH = [0 for i in range(N)]\n\nfor i in range(M):\n preH.append(list(map(int, input().split())))\nans = [True]*n\n\nfor i in range(M):\n A,B = preH[i] \n\n if(H[A-1]>=H[B-1]):\n ans[A-1] = False\n if(H[B-1]>=H[A-1]):\n a...
['Runtime Error', 'Runtime Error', 'Accepted']
['s558353039', 's884867075', 's501361355']
[32892.0, 32884.0, 32032.0]
[250.0, 253.0, 337.0]
[362, 362, 322]
p02689
u213299590
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M=map(int,input().split())\nH=list(map(int,input().split()))\nAB=(map(int,input().split()) for _ in range(M))\nA,B=(list(i) for i in zip(*AB))\nimport numpy as np\nC=np.ones(N)\nd=0\ndef m(a,b):\n if H[b-1]>H[a-1]:\n return [a,a]\n if H[a-1]>H[b-1]:\n return [b,b]\n if H[b-1]==H[a-1]:\n return [a,b]\nfo...
['Wrong Answer', 'Accepted']
['s513161421', 's813679457']
[66076.0, 66120.0]
[633.0, 695.0]
[423, 414]
p02689
u213401801
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['def ma(li):\n \n max_num = 0\n for i in li:\n if max_num < i:\n max_num = i\n return max_num\n\ndef appen(li,yousa):\n li.append(yousa)\n return li\n \ndef main():\n res=0\n n,m=map(int,input().split())\n h=list(map(int,input().split()))\n \n a=[list(map(int,input...
['Wrong Answer', 'Accepted']
['s663135748', 's557871931']
[9176.0, 44120.0]
[25.0, 412.0]
[685, 724]
p02689
u214515556
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N = int(input())\nW = [int(input()) for _ in range(N)]\nD = [W[0]]\n\nfor i in range ( 1 , N ):\n b = W[i]\n if max(D) < b:\n D.append(b)\n else:\n for j in range ( len ( D )):\n if D[j] >= b:\n D[j] = b\n break\n\nprint ( len ( D ))', 'import math...
['Runtime Error', 'Runtime Error', 'Accepted']
['s118725285', 's180139648', 's408309101']
[9204.0, 9196.0, 29800.0]
[21.0, 25.0, 274.0]
[289, 191, 324]
p02689
u216752093
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m=map(int,input().split())\nh=list(map(int,input().split()))\nll=[]\nfor i in range(m):\n a,b=map(int,input().split())\n if h[a-1]<h[b-1]:\n lose=[a]\n elif h[a-1]>h[b-1]:\n lose=[b]\n else:\n lose=[a,b]\n ll += lose\nprint(ll)\nimport collections\nc=collections.Counter(ll)\nprin...
['Wrong Answer', 'Accepted']
['s055380281', 's374301355']
[22432.0, 22160.0]
[257.0, 278.0]
[314, 305]
p02689
u218757284
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nl = [1 for _ in range(n)]\n\nfor i in range(m):\n a, b = map(int, input().split())\n if h[a-1] > h[b-1]:\n l[b - 1] = 0\n elif:\n l[a - 1] = 0\n else:\n l[a - 1] = 0\n l[b - 1] = 0\n\ncnt = 0\nfor i in l:\n if i == 1:\n cnt += ...
['Runtime Error', 'Accepted']
['s509400715', 's406897529']
[8972.0, 20064.0]
[23.0, 266.0]
[314, 330]
p02689
u218834617
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import sys\nN,M=map(int,input().split())\nH=list(map(int,input().split()))\n\nprint(N,M,H)\n\nbad=set()\nfor ln in sys.stdin:\n A,B=map(int,ln.split())\n x,y=H[A-1],H[B-1]\n if x>y:\n bad.add(y)\n elif x<y:\n bad.add(x)\n else:\n bad.add(x)\n bad.add(y)\n\nprint(N-len(bad))\...
['Wrong Answer', 'Accepted']
['s782500793', 's170431758']
[20032.0, 19656.0]
[156.0, 164.0]
[300, 301]
p02689
u220499476
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m =map(int,input().split())\ns = list(map(int,input().split()))\na = []*m\nb = []*m\nans = 0\nfor __ in range(m):\n _= list(map(int, input().split()))\n a.append(_)\n if s[_[0]-1] > s[_[1]-1]:\n b.append(_[0])\n elif s[_[0]-1] < s[_[1]-1]:\n b.append(_[1])\n else:\n b.append(0)\nfor i in range(n):\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s415873990', 's617874832', 's736034363']
[33492.0, 29448.0, 20016.0]
[2206.0, 346.0, 263.0]
[459, 511, 251]
p02689
u222668979
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import sys\ninput = sys.stdin.readline\n\nn, m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\n\nh_max = [0 for _ in range(n)]\nfor a, b in ab:\n h_max[a-1] = max(h_max[a-1], h[b-1])\n h_max[b-1] = max(h_max[b-1], h[a-1])\n\ncnt = 0\nfo...
['Runtime Error', 'Accepted']
['s397473413', 's686504287']
[31924.0, 31896.0]
[257.0, 261.0]
[371, 374]
p02689
u224119985
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m=map(int,input().split())\nh=list(map(int,input().split()))\na = [0] * m\nb = [0] * m\nl=[0]*n\ncount=0\nfor i in range(m):\n a[i], b[i]=map(int, input().split())\n l[a-1]=max(l[a-1],h[b-1])\n l[b-1]=max(l[b-1],h[a-1])\nfor i in range(n):\n if h[i]>l[i]:\n count=count+1\nprint(count)', 'n, m = m...
['Runtime Error', 'Accepted']
['s367281900', 's745116066']
[20072.0, 20080.0]
[43.0, 316.0]
[293, 287]
p02689
u224554402
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = list(map(int, input().split()))\nheight_list = list(map(int, input().split()))\nroads = [list(map(int, input().split())) for _ in range(m)]\ncount = 0\nfor i in range(n):\n neibor_list =[]\n for i_road, road in enumerate(roads):\n if i == road[0]:\n neibor_list.append(road[1])\n e...
['Wrong Answer', 'Accepted']
['s456556255', 's285476249']
[31388.0, 20108.0]
[2207.0, 253.0]
[597, 320]
p02689
u227085629
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = map(int,input().split())\nh = list(map(int,input().split()))\nx = [list(map(int,input().split())) for nesya in range(m)]\nk = [1]*n\nfor route in x:\n h1 = route[0]-1\n h2 = route[1]-1\n if h[h1] < h[h2]:\n k[h1] = 0\n elif h[h1] > h[h2]\n k[h2] = 0\nprint(sum(k))', 'n,m = map(int,input().split())\nh ...
['Runtime Error', 'Accepted']
['s510354576', 's098440143']
[9044.0, 32004.0]
[21.0, 302.0]
[269, 306]
p02689
u228232845
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["from collections import deque\nimport numpy as np\n\nclass Graph:\n def __init__(self, n, directed=False):\n self.graph = [deque([]) for _ in range(n)]\n self.directed = directed\n\n def add_edge(self, u, v):\n self.graph[u].append(v)\n if not self.directed: self.graph[v].append(u)\n...
['Wrong Answer', 'Accepted']
['s389056714', 's577810040']
[103416.0, 39648.0]
[589.0, 410.0]
[1388, 594]
p02689
u233183615
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy as np\n\nN,M=map(int,input().split())\nH=list(map(int,input().split()))\nA=[list(map(int,input().split())) for i in range(M)]\n\nok=np.ones(N)\nfor i in range(M):\n if H[A[i][0]-1]>H[A[i][1]-1]:\n ok[A[i][0]-1]=1\n ok[A[i][1]-1]=0\n elif H[A[i][0]-1]==H[A[i][1]-1]:\n ok[A[i][0]...
['Wrong Answer', 'Accepted']
['s146504916', 's204101825']
[50736.0, 50164.0]
[2207.0, 412.0]
[430, 368]
p02689
u236795403
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['a = input().split(" ")\nN = eval(a[0])\nM = eval(a[1])\nb = input().split(" ")\nhight_lst = list(map(eval, b))\nlst = []\nfor i in range(N):\n lst.append([])\n\nfor i in range(M):\n c = input().split(" ")\n lst[eval(c[0])-1].append(eval(c[1])-1)\n lst[eval(c[1])-1].append(eval(c[0])-1)\n \ncount = 0\nf...
['Wrong Answer', 'Accepted']
['s608135587', 's810641029']
[36360.0, 20904.0]
[2023.0, 1283.0]
[502, 486]
p02689
u238084414
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nAB = []\ncnt = 0\nfor i in range(M):\n a, b = map(int, input().split())\n ab = sorted([a, b])\n if AB.count(ab) == 0:\n AB.append(ab)\nprint(AB)\nfor i in range(1, N+1):\n flag = True\n for ab in AB:\n if ab[0] == i:\n x = ab[1]\n ...
['Wrong Answer', 'Accepted']
['s557889325', 's674058937']
[20124.0, 20096.0]
[2206.0, 330.0]
[534, 293]
p02689
u241348301
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m=map(int,input().split())\nh=list(map(int,input().split()))\nfinal=[0]*n\nfor i in range(m):\n a,b=map(int,input().split())\n if h[a-1]<h[b-1]:\n final[a-1]=0\n elif h[a-1]>h[b-1]:\n final[b-1]= 0\n else:\n final[a-1]=0\n final[b-1]=0\n\nprint(sum(final))\n', 'n,m=map(int,...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s201169886', 's540595261', 's640876377', 's578296789']
[8952.0, 9048.0, 8960.0, 20048.0]
[26.0, 26.0, 23.0, 252.0]
[288, 287, 288, 281]
p02689
u242580186
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["import sys\nimport time\nimport math\nimport itertools as it\ndef inpl():\n return list(map(int, input().split()))\nst = time.perf_counter()\n# ------------------------------\n\nN, M = inpl()\nH = inpl()\ndp = [True] * M\nfor _ in range(M):\n A, B = inpl()\n if H[A-1] > H[B-1]:\n dp[B-1] = False\n ...
['Runtime Error', 'Accepted']
['s433623448', 's018737626']
[20232.0, 20108.0]
[275.0, 276.0]
[571, 563]
p02689
u246907970
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy\n\ninp=input().split(" ")\nn=int(inp[0])\nm=int(inp[1])\ninh=input().split(" ")\nfor i in range(len(inh)):\n inh[i]=int(inh[i])\npairs=numpy.zeros(2*m,dtype=">i4").reshape(-1,2)\nfor i in range(m):\n a=input().split(" ")\n pairs[i][0]=int(a[0])\n pairs[i][1]=int(a[1])\nlists=[[] for i in range(n+1)]\...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s127045568', 's131578234', 's189833693', 's565802456', 's432257254']
[50856.0, 66652.0, 50856.0, 50772.0, 50744.0]
[1488.0, 989.0, 1098.0, 1506.0, 1446.0]
[729, 690, 701, 701, 701]
p02689
u247830763
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = map(int,input().split())\nls = list(map(int,input().split()))\ndir = [list(map(int,input().split())) for _ in range(m)]\nk = 0\np = 0\nfor i in range(1,n+1):\n new = [e for e in dir if i in e]\n print(new)\n if new == []:\n k += 1\n else:\n for j in range(len(new)):\n if new...
['Wrong Answer', 'Accepted']
['s883986659', 's861834310']
[31152.0, 19940.0]
[2207.0, 250.0]
[575, 298]
p02689
u252964975
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M=map(int, input().split())\nyoi = []\nfor i in range(N):\n yoi.append(True)\nH=list(map(int, input().split()))\nfor i in ranage(M):\n A,B=map(int, input().split())\n if H[A-1]<=H[B-1]: yoi[A-1]=False\n if H[B-1]<=H[A-1]: yoi[B-1]=False \nprint(len([1 for x in yoi if x==True]))', 'N,M=map(int, input().split())\...
['Runtime Error', 'Accepted']
['s772762087', 's997924583']
[20876.0, 20800.0]
[50.0, 270.0]
[275, 274]
p02689
u257265865
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m=map(int,input().split())\nh=list(map(int,input().split()))\ncount=[1]*m\nfor i in range(m):\n a,b=map(int,input().split())\n if h[a-1]>h[b-1]:\n count[b-1]=0\n elif h[a-1]==h[b-1]:\n count[a-1]=0\n count[b-1]=0\n else:\n count[b-1]=0\nprint(sum(count))\n ', 'n,m=map(int,input().split())\nh=list...
['Runtime Error', 'Accepted']
['s222509945', 's856769005']
[19932.0, 20060.0]
[251.0, 241.0]
[265, 266]
p02689
u260036763
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nma = [0]*(N+1)\ncnt = 0\nfor _ in range(M):\n a, b = map(int, input().split())\n ma[a] = max(ma[a], H[b-1])\n ma[b] = max(H[a-1], ma[b])\nfor i in range(1, N+1):\n if H[i] > ma[i]:\n cnt += 1\nprint(cnt)', 'N, M = map(int, input...
['Runtime Error', 'Accepted']
['s563334519', 's002875926']
[20124.0, 25924.0]
[322.0, 391.0]
[282, 289]
p02689
u262065571
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\na = list(range(1,N+1))\nfor i in range(M):\n ai, bi = map(int, input().split())\n if H[ai+1] < H[bi+1] :\n a.remove(ai)\n else:\n a.remove(bi)\nprint(len(a)) \n ', 'N, M = map(int, input().split())\nH = list(map(int, input().split()))...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s033201668', 's136748696', 's463649110', 's735023431', 's788467982', 's935795137']
[20000.0, 19976.0, 20096.0, 20092.0, 20124.0, 20156.0]
[417.0, 426.0, 323.0, 358.0, 325.0, 261.0]
[235, 255, 253, 244, 235, 251]
p02689
u264113350
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy as np\n\nN,M = [int(i) for i in input().split(" ")]\nH = [int(i) for i in input().split(" ")]\nmh = np.zeros([N])\nfor i in range(M):\n a,b = [int(i)-1 for i in input().split(" ")]\n mh[a] = max(mh[a],h[b])\n mh[b] = max(mh[b],h[a])\n\nans = 0\nfor i in range(N):\n if mh[i] < h[i]:\n a...
['Runtime Error', 'Accepted']
['s402634282', 's380497909']
[38484.0, 38684.0]
[144.0, 498.0]
[324, 324]
p02689
u264281836
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['height=list(map(int,input().strip().split()) )\nlst=[1]*h\n\nfor i in range(m):\n a,b=map(int,input().strip().split())\n if height[a-1]>height[b-1]:\n lst[a-1]=1\n lst[b-1]=0\n elif height[a-1]<height[b-1]:\n lst[b-1]=1\n lst[a-1]=0\n else:\n lst[b - 1] = 0\n lst[...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s080286258', 's977215612', 's887602085']
[9216.0, 20124.0, 19980.0]
[24.0, 265.0, 252.0]
[335, 348, 338]
p02689
u266014018
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy as np\nN,M = map(int,input().split())\nH = np.array([0] + list(map(int,input().split())))\nA , B = [0]*M,[0]*M\nfor i in range(M):\n A[i],B[i] = map(int,input().split())\nadj = [[] for _ in range(N+1)]\n\nfor a,b in zip(A,B):\n adj[a] += [b]\n adj[b] += [a]\n\n# stack = [1]\n# while stack:\n# ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s020905881', 's709119454', 's815361858']
[47672.0, 20120.0, 19920.0]
[2207.0, 328.0, 198.0]
[648, 265, 485]
p02689
u268183312
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy as np\n\nn, m = map(int, input().split())\nhlist = np.array(list(map(int, input().split()))).astype(np.int64)\nab = [list(map(int, input().split())) for _ in range(m)]\n', 'import numpy as np\n\nn, m = map(int, input().split())\nhlist = np.array(list(map(int, input().split()))).astype(np.int64)\nab = [li...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s223629071', 's889548796', 's964239530', 's770931782']
[46632.0, 46700.0, 46680.0, 31896.0]
[337.0, 330.0, 327.0, 359.0]
[177, 219, 388, 317]
p02689
u268724304
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['# -*- coding: utf-8 -*-\n\nN, M = map(int, input().split())\nH = list(map(int, input().split()))\nC = [0]*N\n\nfor i in range(M):\n A, B = map(int, input().split())\n if H[A-1] > H[B-1]:\n C[B-1]=1\n H[B-1]=H[A-1]\n if H[A-1] < H[B-1]:\n C[A-1]=1\n H[A-1]=H[B-1]\n if H[A-1] == ...
['Wrong Answer', 'Accepted']
['s685122481', 's742626523']
[20068.0, 20028.0]
[318.0, 274.0]
[432, 400]
p02689
u274758786
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int(input().split()))\nh = list(map(int, input().split()))\np = [1]*n\nmax = 0\nfor i in range(m):\n a, b = map(int(input().split()))\n if h[a-1] <= h[b-1]:\n p[a-1] = 0\n if h[a-1] >= h[b-1]:\n p[b-1] = 0\nprint(sum(p))', 'n, m = map(int, (input().split()))\nh = list(map(int, input(...
['Runtime Error', 'Accepted']
['s484439755', 's946964969']
[9128.0, 20076.0]
[23.0, 273.0]
[244, 249]
p02689
u277104886
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nx = []\nfor j in range(m):\n a = list(map(int, input().split()))\n s = a[0] - 1\n t = a[1] - 1\n if h[s] <= h[t]:\n x.append(t)\n else\n x.append(s)\n\nprint(len(set(x))) \n\n ', 'n, m = map(int, input().spli...
['Runtime Error', 'Accepted']
['s184729911', 's309298251']
[8852.0, 20032.0]
[24.0, 281.0]
[272, 339]
p02689
u282652245
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["\n\ndef main():\n NM = list(map(int,input().split()))\n H = list(map(int,input().split()))\n\n \n\n Judge = [True] * NM[0]\n\n for i in range(NM[1]):\n ABi = list(map(int,input().split()))\n\n\n if H[ABi[0]-1] > H[ABi[1]-1]:\n if Judge[ABi[0]-1]:\n Judge[ABi[0]-1...
['Wrong Answer', 'Accepted']
['s844653425', 's267955135']
[20112.0, 20140.0]
[278.0, 273.0]
[749, 751]
p02689
u285265363
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\nans = [1]*n\nfor i in range(m):\n if h[ab[i][0]-1] == h[ab[i][1]-1]:\n ans[ab[i][0]-1] = 0\n ans[ab[i][1]-1] = 0\n elif h[ab[i][0]-1] > h[ab[i][1]]:\n ans[ab[i][1...
['Runtime Error', 'Accepted']
['s090148564', 's473246876']
[31848.0, 31952.0]
[328.0, 320.0]
[372, 374]
p02689
u294700660
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M=map(int, input().split())\npeaks=list(map(int, input().split()))\nflag=[1]*N\na=0\nb=0\nfor i in range(M):\n a,b=map(int,input().split())\n a-=1\n b-=1\n if peaks[a]<=peaks[b]:\n flag[a]=0\n if peaks[a]>=peaks[b]:\n flag[a]=0\nans=0\nfor i in flag:\n ans+=flag[i]\nprint(ans)', 'N,M=map(int, input()....
['Wrong Answer', 'Accepted']
['s929354416', 's237272609']
[20128.0, 20048.0]
[273.0, 269.0]
[277, 271]
p02689
u306060982
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = map(int,input().split())\nh = [int(i) for i in input().split()]\nnn = [1]*n\nfor _ in range(m):\n a,b\t= map(int,input().split())\n\n if h[a-1] <\th[b-1]:\n\t\tnn[a-1]=0\n else:\n\t\tnn[b-1]=0\n\nprint(sum(nn))', 'n,m = map(int,input().split())\nh = [int(i) for i in input().split()]\nnn = [[-1]]*n\n\nf...
['Runtime Error', 'Runtime Error', 'Accepted']
['s097211185', 's635731247', 's415306719']
[8852.0, 9052.0, 20116.0]
[26.0, 23.0, 259.0]
[208, 321, 281]
p02689
u306718299
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["# -*- coding: utf-8 -*-\nimport numpy as np\n\nn, m = map(int, input().split())\nh = np.array(input().split(), dtype='int')\nbad_tower = []\n\nfor i in range(m):\n a, b = map(int, input().split())\n ha = h[a-1]\n hb = h[b-1]\n\n if ha > hb:\n bad_tower.append(b)\n elif ha < hb:\n bad_towe...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s132659123', 's209153595', 's729248957']
[40160.0, 40040.0, 40256.0]
[366.0, 2206.0, 376.0]
[465, 661, 461]
p02689
u307615746
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['import numpy as np\nimport copy\n\ndef main():\n N, M = list(map(int, input().split()))\n H = list(map(int, input().split()))\n maxH = np.zeros(N)\n\n for itr in range(M):\n A, B = list(map(int, input().split()))\n if H[A- 1] == H[B- 1] :\n maxH[A- 1] = -1\n maxH[...
['Wrong Answer', 'Accepted']
['s159101768', 's279625764']
[38680.0, 38604.0]
[478.0, 554.0]
[753, 962]
p02689
u313555680
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = input().split()\nheight = input().split()\nable = []\nfor n in range(int(N)):\n able.append([])\nfor m in range(int(M)):\n con = input().split()\n con[0] = int(con[0])\n con[1] = int(con[1])\n able[con[0]-1].append(con[1])\n able[con[1]-1].append(con[0])\ngood = []\nfor n in range(int(N)):\n if len(able...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s211191898', 's536567423', 's692332887']
[39248.0, 8880.0, 35584.0]
[475.0, 23.0, 447.0]
[512, 438, 449]
p02689
u314837274
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m=map(int,input().split())\nh_list=list(map(int,input().split))\ncol_list=[[0]*n for _ in range(n)]\ncount=0\nfor _ in range(m):\n a,b=map(int,input().split)\n col_list[a-1][b-1]+=1\n\nfor i in range(n):\n for j in range(n):\n if col_list[i][j]>=1 and h_list[i]<=h_list[j]:\n count+=1\n break\nprint(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s129394946', 's883830157', 's104260853']
[10984.0, 10980.0, 20016.0]
[20.0, 23.0, 265.0]
[314, 298, 240]
p02689
u316649390
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N,M = map(int,input().split())\nH = list(map(int,input().split()))\nH = [0] + H\nTree = [0] + [1]*N\nfor _ in range(M):\n A,B = map(int,input().split())\n if H[A] >= H[B]:\n Tree[B] = 0\n else:\n Tree[A] = 0\nprint(sum(H))', 'N,M = map(int,input().split())\nH = list(map(int,input().split()))\nH = [0] + H\nTr...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s458512177', 's525406671', 's580407404', 's713256624']
[20148.0, 8988.0, 20076.0, 20144.0]
[230.0, 23.0, 2206.0, 233.0]
[221, 271, 246, 272]
p02689
u316733945
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\nprint(h)\nprint(ab)\n\na = []\nfor i in ab:\n if h[i[0]-1] > h[i[1]-1]:\n a.append(h[i[0]-1])\n else:\n a.append(h[i[1]-1])\nprint(len(set(a)))', 'n, m = map(int, input().split())\n...
['Wrong Answer', 'Accepted']
['s768943947', 's190510265']
[35176.0, 31920.0]
[349.0, 305.0]
[268, 339]
p02689
u325149030
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nH_val = [H[i] for i in range(N)]\nfor _ in range(M):\n A, B = map(int, input().split())\n A, B = A-1, B-1\n if H[A] > H[B]:\n H_val[B] = 0\n \n elif H[B] > H[A]:\n H_val[A] = 0\n \n else:\n H_val[A...
['Runtime Error', 'Accepted']
['s476621819', 's987536336']
[141748.0, 20064.0]
[1948.0, 260.0]
[429, 408]
p02689
u331330867
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m=map(int,input().split())\nH=list(map(int,input().split()))\nlb=[True]*n\nfor r in range(m):\n a,b=input().split()\n a,b=int(a)-1,int(b)-1\n if H[a]>H[b]:\n lb[b]=False\n elif H[a]<H[b]:\n lb[a]=False\n else:\n lb[a]=False\n lb[b]=False\nlb.count(True)', 'n,m=map(int,inpu...
['Wrong Answer', 'Accepted']
['s578915153', 's780948254']
[20116.0, 19964.0]
[242.0, 253.0]
[285, 292]
p02689
u331997680
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nC = [1]*(N)\nfor i in range(M):\n a, b = map(int, input().split())\n if H[a-1] >= H[b-1]:\n H[b-1] = 0\n if H[b-1] >= H[a-1]:\n H[a-1] = 0\nprint(sum(C))', 'N, M = map(int, input().split())\nH = list(map(int, input().split()))\nC = [1]*(N...
['Wrong Answer', 'Accepted']
['s160278270', 's338658338']
[20096.0, 20064.0]
[260.0, 253.0]
[224, 224]
p02689
u332926534
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['\nN, M = map(int, input().split())\nH = list(map(int, input().split()))\n\nAB = [list(map(int, input().split())) for _ in range(M)]\n\ncheck = [True] * N\n\nfor ab in AB:\n \n print(ab, "left: ", H[ab[0]-1], "right: ", H[ab[1]-1]) \n if H[ab[0]-1] < H[ab[1] - 1]:\n check[ab[0]-1] = False\n elif H[a...
['Runtime Error', 'Accepted']
['s176187574', 's367825967']
[158672.0, 32012.0]
[2678.0, 294.0]
[462, 415]
p02689
u344888046
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\nA_B = [""] * M\n\nfor c in range(M):\n A_B[c] = list(map(int, input().split()))\n\nhd = {}\n\nfor co in range(N):\n hd[co + 1] = H[co]\n\nprint(hd)\nprint("a")', 'N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\nA_B...
['Wrong Answer', 'Accepted']
['s631330898', 's672960464']
[42896.0, 29500.0]
[290.0, 370.0]
[224, 390]
p02689
u345621867
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [0] * m\nfor i in range(m):\n ab[i] = list(map(int, input().split()))\ncheck = [1] * n\n\nfor i in range(m):\n \n if h[ab[i][0]-1] = h[ab[i][1]-1]:\n check[ab[i][0]-1] = 0\n check[ab[i][1] - 1] = 0\n elif h[ab[i][0] ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s133746837', 's846634668', 's416688992']
[9040.0, 35144.0, 32012.0]
[22.0, 379.0, 333.0]
[480, 394, 481]
p02689
u347134705
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N , M = map(int,input().split())\n \nH = list(map(int,input().split()))\n \nA = [0]*M\nB = [0]*M\nfor i in range(M):\n A[i] ,B[i] = map(int,input().split())\n \n\nS=[1]*N\n\n \nfor m in range(M)\n if H[A[m]-1] == H[B[m]-1]:\n S[A[m]-1] = 0\n S[B[m]-1] = 0\n elif H[A[m]-1] <= H[B[m]-1]:\n S[A[m]-1] = 0\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s200828530', 's438324119', 's448328014', 's454798001']
[8868.0, 21056.0, 20996.0, 21848.0]
[23.0, 2206.0, 285.0, 292.0]
[364, 424, 608, 369]
p02689
u350578302
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['N, M = map(int,input().split())\nH = list(map(int,input().split()))\n\nA = []\nB = []\ncmb = {}\ncnt = 0\nflag = 1\n\nfor i in range(1, M+1):\n\tcmb.setdefault(i, [])\n\n\nfor i in range(M):\n\ta,b = map(int,input().split())\n\n\tcmb.setdefault(a, []).append(b)\n\tcmb.setdefault(b, []).append(a)\n\nfor j in range(1,N...
['Runtime Error', 'Runtime Error', 'Accepted']
['s093103468', 's565676358', 's941482243']
[39720.0, 39492.0, 38616.0]
[581.0, 538.0, 540.0]
[503, 491, 596]
p02689
u353519457
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n, m = map(int, input().split())\nh = list(map(int, input().split()))\ng = [[] for _ in range(n+1)]\nfor i in range(m):\n a, b = map(int, input().split())\n g[a].append(b)\n g[b].append(a)\n\ncnt = 0\nfor i in range(1, n+1):\n if len(g[i]) == 0:\n continue\n for j in g[i]:\n print(i, j)\n...
['Wrong Answer', 'Accepted']
['s226451466', 's587315655']
[29444.0, 29336.0]
[572.0, 393.0]
[419, 329]
p02689
u354862173
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["import sys\nimport numpy as np\nfrom math import ceil as C, floor as F, sqrt\nfrom collections import defaultdict as D, Counter as CNT\nfrom functools import reduce as R\n \nALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nalp = 'abcdefghijklmnopqrstuvwxyz'\ndef _X(): return sys.stdin.readline().rstrip().split(' ')\ndef _S(ss): r...
['Runtime Error', 'Accepted']
['s708096324', 's510633003']
[88412.0, 87628.0]
[705.0, 693.0]
[1009, 1011]
p02689
u357751375
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
['n,m = map(int,input().split())\nh = list(map(int,input().split()))\nl = [list(map(int,input().split())) for i in range(m)]\na,b = [list(i) for i in zip(*l)]\nz = [1] * n\n\nfor i in range(m):\n x = a[i] - 1\n y = b[i] - 1\n if h[x] < h[y]:\n z[x] = 0\n else:\n z[y] = 0\n\nprint(z)\nprint(n -...
['Wrong Answer', 'Accepted']
['s851822400', 's245710648']
[39828.0, 39740.0]
[314.0, 305.0]
[315, 362]
p02689
u361631791
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["from collections import defaultdict\n\nvisited = [False for _ in range(100001)]\n\n\ndef dfs(p: int, n: int, h: list, ways: dict, result: dict):\n if visited[p]:\n return\n \n visited[p] = True\n result[h[p-1]] += 1\n\n for w in ways[p]:\n dfs(w, n, h, ways, result)\n\n\ndef main():\n ...
['Runtime Error', 'Accepted']
['s476023009', 's776357171']
[51368.0, 51944.0]
[462.0, 462.0]
[853, 617]
p02689
u362255558
2,000
1,048,576
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r...
["N, M = [ int(i) for i in input().strip().split(' ') ]\nH = [ int(i) for i in input().strip().split(' ') ]\npaths = []\nfor _m in range(M):\n path = input().strip().split(' ')\n path = int(path[0]), int(path[1])\n path = path if path[0] < path[1] else (path[1], path[0])\n if path not in paths:\n ...
['Wrong Answer', 'Accepted']
['s050199325', 's813856032']
[20076.0, 20144.0]
[2206.0, 334.0]
[880, 491]