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
u624613992
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 = 0\nlist1 = [1] * (n)\nfor i in range(m):\n a, b = map(int, input().split())\n if h[a - 1] > h[b - 1]:\n list1[a - 1] = 0\n if h[a - 1] < h[b - 1]::\n list1[b - 1] = 0\nprint(sum(list1))', 'n, m = map(int, input().split...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s210669035', 's461919096', 's814235704', 's489406137']
[9052.0, 9044.0, 17060.0, 20112.0]
[23.0, 22.0, 31.0, 273.0]
[275, 254, 268, 266]
p02689
u625007136
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\ndef ppp(n,m,h,ab):\n g = [1] * n\n for l,r in ab:\n if h[l-1] >= h[r-1]:\n g[r-1] = 0\n if h[l-1] <= h[r-1]:\n g[l-1] = 0\n print(sum(g))\nif __name__ == "__main__":\n n,m = map(int,input().split())\n h = list(map(int,input()...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s165848824', 's824334993', 's134846210']
[31152.0, 54804.0, 31944.0]
[146.0, 633.0, 193.0]
[401, 536, 394]
p02689
u626891113
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 = [False] + [True]*n\nA = []\nB = []\nfor i in range(m):\n a, b = map(int,input().split())\n A.append(a)\n B.append(b)\n\nfor i in range(m):\n if h[A[i] - 1] > h[B[i] - 1]:\n p[B[i]] = False\n if h[A[i] - 1] < h[B[i] - 1]:\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s792304831', 's987381619', 's383968955']
[152456.0, 152436.0, 25352.0]
[907.0, 959.0, 287.0]
[482, 459, 451]
p02689
u629614915
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\n\n\n\n## main process\nif __name__ == '__main__':\n \n ## input\n N, M = map(int,input().split())\n HEIGHT_LIST = list(map(int,input().split())) \n ROAD_LIST = []\n for j in range(M): \n ROAD_LIST.append(\n tuple(map(int,input().split()))\n )\n \n ## busines...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s498776323', 's749513732', 's781132786', 's869958686', 's452770043']
[31204.0, 8844.0, 20032.0, 20108.0, 20140.0]
[284.0, 22.0, 43.0, 44.0, 249.0]
[803, 700, 571, 570, 547]
p02689
u631429391
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()))\nroads = []\nfor i in range(m):\n a,b = map(int,input().split())\n roads.append([a,b])\n#print(roads)\nterrace = [1] * n\nfor road in roads:\n if h_list[road[0]-1] > h_list[road[1]-1]:\n terrace[road[1]-1] = 0\n elif h_list[r...
['Runtime Error', 'Accepted']
['s574677602', 's319069389']
[9236.0, 28956.0]
[25.0, 311.0]
[503, 501]
p02689
u632094970
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 = list(map(int, input().split()))\nh = list(map(int, input().split()))\nto = [[] for i in range(n)]\n\nfor i in range(m):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n print(a, b)\n to[a].append(b)\n to[b].append(a)\n\nans = 0\n\nfor i in range(n):\n ...
['Wrong Answer', 'Accepted']
['s847244756', 's789312465']
[29264.0, 29432.0]
[641.0, 366.0]
[422, 406]
p02689
u651663683
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()))\nb=[[]for i in range(n)]\nfor i in range(m):\n a=list(map(lambda x:int(x)-1,input().split()))\n b[a[0]].append(a[1])\n b[a[1]].append(a[0])\ns=0\nfor i in range(n):\n f=1\n for j in b[i]:\n if h[i]<=h[j]:\n f=0\n break\n if f:\n ...
['Wrong Answer', 'Accepted']
['s422579661', 's953006085']
[29364.0, 29436.0]
[408.0, 418.0]
[309, 318]
p02689
u652522621
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(' ')))\nheight_all = height\n\nfor i range(M):\n a, b = map(int, input().split(' '))\n if height[a - 1] == height[b - 1]:\n height_all.remove(height[a - 1])\n elif height[a - 1] > height[b - 1]:\n height_all.remove(height[b - 1])\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s401471633', 's442665175', 's562572742']
[9048.0, 38580.0, 38600.0]
[22.0, 344.0, 383.0]
[372, 359, 510]
p02689
u652656291
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 = [0]*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] = -1\n if H[a-1] <= H[b-1]:\n H[a-1] = -1\nprint(p.count(0))\n', 'n,m = map(int,input().split())\nH = list(map(int,input().split()))...
['Wrong Answer', 'Accepted']
['s557834774', 's135372805']
[20032.0, 20032.0]
[241.0, 248.0]
[238, 238]
p02689
u652892331
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 = [int(i) for i in input().split()]\n\ncount = 0\nfor _ in range(M):\n A, B = map(int, input().split())\n if min(Height[A - 1], Height[B - 1]) != 0:\n count += 1\n Height[A - 1], Height[B - 1] = 0, 0\n\nfor i in Height:\n if i != 0:\n count += 1\n\npr...
['Wrong Answer', 'Accepted']
['s799017949', 's671554093']
[19980.0, 21856.0]
[262.0, 288.0]
[314, 559]
p02689
u657786757
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 collections\nn,m = list(map(int,input().split()))\ntower_high = list(map(int,input().split()))\ngood_tower = [1]*n\n\ndef check_tower(a,b):\n if tower_high[a]<tower_high[b]:\n good_tower[a]=0\n elif tower_high[a] > tower_high[b]:\n good_tower[b]=0\n else:\n good_tower[a]=0\n ...
['Wrong Answer', 'Accepted']
['s700435773', 's593861062']
[20620.0, 20648.0]
[296.0, 258.0]
[453, 435]
p02689
u660042112
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...
['if __name__ == "__main__":\n N, M = list(map(int, input().split()))\n H = list(map(int, input().split()))\n good_obs = [True for i in range(M)]\n for i in range(M):\n a, b = list(map(int, input().split()))\n if H[a-1] > H[b-1]:\n godd_obs[b-1] = False\n elif H[a-1] < H[b-1]...
['Runtime Error', 'Accepted']
['s203366777', 's152569045']
[19972.0, 20128.0]
[48.0, 288.0]
[373, 455]
p02689
u667427469
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...
["if __name__ == '__main__':\n\n nm = input()\n nm = nm.split()\n n = int(nm[0])\n m = int(nm[1])\n\n h = input()\n h = h.split()\n h = list(map(int,h))\n print(h)\n AB = []\n for i in range(m):\n ab = input()\n ab = ab.split()\n ab = list(map(int,ab))\n AB.appe...
['Runtime Error', 'Accepted']
['s739864600', 's947388451']
[33916.0, 20104.0]
[327.0, 374.0]
[474, 487]
p02689
u667949809
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(' ')))\nansList = [1]*n\nnumlist = []\n\nfor i in range(m):\n a,b = map(int, input().split())\n if h[a-1] > h[b-1]:\n #ansList[a-1] = ma\n numlist.append(b-1)\n else:\n numlist.append(a-1)\nfor i in list(set(numlist)):\n ...
['Wrong Answer', 'Accepted']
['s358449367', 's524231169']
[20880.0, 20300.0]
[296.0, 262.0]
[381, 428]
p02689
u671861352
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...
['#!python3\n\n# input\nN, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\nAB = [list(map(int, input().split())) for _ in range(M)]\n\n\ndef main():\n link = [[] for _ in range(N)]\n for a, b in AB:\n link[a - 1].append(b - 1)\n link[b - 1].append(a - 1)\n\n ans = N\n ...
['Wrong Answer', 'Accepted']
['s503365989', 's771818823']
[47892.0, 47532.0]
[451.0, 379.0]
[525, 485]
p02689
u671889550
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=[]\nfor i in range(M):\n P.append(list(map(int,input().split()))) \n\nans=[]\n\nfor i in range(M):\n if H[P[i][0]-1]>H[P[i][1]-1]: \n ans.append([P[i][0])\n elif H[P[i][0]-1]<H[P[i][1]-1]: \n ans.append(P[i][1]) \n els...
['Runtime Error', 'Accepted']
['s536715252', 's079881895']
[8960.0, 34656.0]
[27.0, 328.0]
[600, 375]
p02689
u674588203
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())\nhs=input().split()\n\nH=[0] \nfor h in hs:\n H.append(int(h))\n\n\nP=[[0]*1 for i in range(N+1)] \ncount=0\nfor p in range(len(P)):\n P[p][0]=p \n# print(P)\n\nfor m in range(M):\n pathfrom,pathto= map (int,input().split())\n P[pa...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s128285162', 's216492020', 's265674078', 's437973522', 's975681575', 's620828120']
[43800.0, 36316.0, 36292.0, 36264.0, 36232.0, 36688.0]
[539.0, 459.0, 458.0, 437.0, 420.0, 444.0]
[615, 545, 483, 484, 621, 685]
p02689
u678505520
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 = set(range(n))\nprint(h)\nfor i in range(m):\n a,b = map(int,input().split())\n if h[a-1] <= h[b-1]:\n H.discard(a-1)\n if h[a-1] >= h[b-1]:\n H.discard(b-1)\n\nprint(len(H))', 'n,m = map(int,input().split())\nh = list(map(i...
['Wrong Answer', 'Accepted']
['s740383367', 's816117831']
[22588.0, 22452.0]
[324.0, 284.0]
[257, 248]
p02689
u680190333
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=(int(x) for x in input().rstrip('\\n').split())\nHs = [int(x) for x in input().rstrip('\\n').split()]\nnums = [1 for x in Hs]\nfor i in range(M):\n roads = [int(x) for x in input().rstrip('\\n').split()]\n if Hs[roads[0]-1] < Hs[roads[1]-1]:\n nums[roads[0]-1] = 0\n ...
['Runtime Error', 'Accepted']
['s584821745', 's774729756']
[9004.0, 20144.0]
[24.0, 161.0]
[442, 441]
p02689
u681409497
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()))\nbet,cost = [],[0]*N\nfor i in range(M):\n bet.append(list(map(int,input().split())))\n\nfor b in bet:\n if height[b[0]-1] < height[b[1]-1]:\n cost[b[1]-1] = 1\n else:\n cost[b[0]-1] = 1\n\nprint(cost)\n', 'n,m = map(int,...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s767016126', 's852819664', 's214363291']
[32660.0, 8836.0, 20112.0]
[319.0, 27.0, 252.0]
[287, 261, 325]
p02689
u684267998
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 = [0]*M\nB = [0]*M\n\nfor i in range(M):\n A[i], B[i]= map(int, input().split())\n \nans = []*N\nfor i in range(M):\n a = A[i]-1\n b = B[i]-1\n if H[a] < H[b]:\n ans[a]=1\n elif H[a] > H[b]:\n ans[b]=1\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s171449965', 's270914392', 's092081819']
[20920.0, 23648.0, 21832.0]
[211.0, 277.0, 266.0]
[361, 302, 372]
p02689
u689710606
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)\n\nans = 0\nfor i in range(1, n + 1):\n for j in g[i]:\n if arr[j] >= arr[i]:\n break\n ...
['Wrong Answer', 'Accepted']
['s841426671', 's264762752']
[29520.0, 29132.0]
[330.0, 368.0]
[350, 342]
p02689
u690554532
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_n = [True] * n\nfor i in range(m):\n a, b = map(int, input().split())\n elif h[a-1] >= h[b-1]:\n l_n[b-1] = False\n elif h[a-1] <= h[b-1]:\n l_n[a-1] = False\nprint(sum(l_n)) ', 'n, m = map(int, input().split())\nh = list(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s386324060', 's780146317', 's010753219']
[8964.0, 9028.0, 20368.0]
[23.0, 21.0, 141.0]
[262, 286, 482]
p02689
u692311686
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()))\ntunagari=[[] for i in range(N)]\nfor i in range(M):\n A,B=map(int,input().split())\n tunagari[A-1]+=[B-1]\n tunagari[B-1]+=[A-1]\n\nnums=[0 for i in range(N)]\nt=0\nfor i in range(N):\n tmpl=tunagari[i]\n mini=min(tmpl)\n if mini<i:\n nums[i]=nu...
['Runtime Error', 'Runtime Error', 'Accepted']
['s406080692', 's803451910', 's654957052']
[30324.0, 9048.0, 29268.0]
[333.0, 22.0, 433.0]
[641, 359, 388]
p02689
u694380052
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())\nhl=input().split()\nshl=[int(x) for x in hl]\nvl=set()\nfor y in range(n):\n vl.add(y)\nprint(vl)\nfor i in range(m):\n try:\n a,b=map(int,input().split())\n if shl[a-1]>shl[b-1]:\n vl.remove(b-1)\n elif shl[a-1]<shl[b-1]:\n vl.remove(a-1)...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s087674989', 's112624276', 's122921035', 's020426227']
[29452.0, 8956.0, 146676.0, 24600.0]
[329.0, 25.0, 1830.0, 273.0]
[453, 504, 341, 327]
p02689
u700929101
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 = list(map(int,input().split(" ")))\nn,m = x\nh = list(map(int,input().split(" ")))\nlowerlist = [1] * n\nprint(h)\n\nfor i in range(m):\n ab = list(map(int,input().split(" ")))\n a,b = ab\n print(a)\n print(b)\n # print(ab)\n if h[a-1] >= h[b-1]:\n lowerlist[b-1] = 0\n if h[b-1] >= h[a-...
['Wrong Answer', 'Accepted']
['s954546185', 's219621929']
[124224.0, 20124.0]
[2371.0, 275.0]
[378, 322]
p02689
u703823201
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 m in range(M)]\nAB = list(map(list, set(map(tuple, AB))))\n\ni = []\nfor m in range(len(AB)):\n a = AB[m][0]\n b = AB[m][1]\n if H[a-1] >= H[b-1]:\n i.append(b-1)\n elif H[a-1] <= H[b-1]...
['Runtime Error', 'Accepted']
['s716618338', 's502556547']
[50220.0, 50392.0]
[440.0, 411.0]
[409, 421]
p02689
u711143961
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().split()]\nh = [int(i) for i in input().split()]\nhs = [[] for i in range(n)]\nfor i in range(m):\n a, b = [int(i) for i in input().split()]\n hs[a-1].append(h[b-1])\n hs[b-1].appned(h[a-1])\nc = 0\nfor i in range(n):\n if len(hs[i]) == 0:\n c += 1\n elif h[i] > max(hs[i]):\n ...
['Runtime Error', 'Accepted']
['s437357161', 's356580425']
[20156.0, 22996.0]
[65.0, 377.0]
[322, 340]
p02689
u712322283
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())\nhs = list(map(int, input().split()))\nd = [1]*n\n\nfor i in range(m):\n a,b = map(int, input().split())\n if hs[a-1] <= hs[b-1]:\n d[a-1] = 0\n if hs[a-1] >= hs[b-1]:\n d[b-1] = 0\n \n print(hs,d)\n \nprint(d.count(1))', 'n,m = map(int, input().spli...
['Runtime Error', 'Accepted']
['s491701452', 's402923832']
[141780.0, 20020.0]
[2240.0, 261.0]
[274, 249]
p02689
u713165870
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...
['if __name__ == "__main__":\n list_N_M = input().split(\' \')\n N = int(list_N_M[0])\n M = int(list_N_M[1])\n \n list_str_H_all = input().split(\' \')\n H = [0.0] * N\n for i in range(len(list_str_H_all)):\n H[i] = float(list_str_H_all[i])\n \n is_good_vp = [True] * N\n \n for _ in range(M):\n str_A_B...
['Runtime Error', 'Runtime Error', 'Accepted']
['s233000512', 's507230261', 's364164470']
[21528.0, 21556.0, 20804.0]
[260.0, 256.0, 270.0]
[580, 588, 654]
p02689
u716660050
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\nnice=0\nfor i in range(M):\n A,B=map(int,input().split())\n A-=1\n B-=1\n if l[A] == 0:\n l[A] = B\n nice += 1\n if l[B]==0:\n l[B] = -1\n elif l[A] == -1:\n l[A] = B\n if l[B]==0:\n ...
['Wrong Answer', 'Accepted']
['s637395982', 's138888668']
[19924.0, 20020.0]
[261.0, 260.0]
[386, 233]
p02689
u719840207
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()))\ngraph = [[] for _ in range(N)]\nfor _ in range(M):\n a , b = map(int,input().split())\n graph[a - 1].append(b - 1)\n graph[b - 1].append(a - 1)\nans=0\n\nnewg=[]\nfor j in graph:\n \n newg.append(set(j))\n\n\nfor index,i in enumerat...
['Wrong Answer', 'Accepted']
['s676695432', 's494769056']
[55576.0, 29356.0]
[606.0, 385.0]
[531, 397]
p02689
u723345499
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()))\npairs = [list(map(int, input().split())) for _ in range(m)]\n\nans = [1] * n\n\nfor i in range(m):\n if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:\n ans[pairs[i][0] - 1] = 0\n elif f h[pairs[i][0] - 1] = h[pairs[i][1] - 1]:\n ans...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s076569439', 's142824666', 's919793113', 's303985027']
[8920.0, 161688.0, 8972.0, 31812.0]
[21.0, 2273.0, 25.0, 311.0]
[429, 556, 427, 428]
p02689
u725993280
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 = [list(map(int,input().split())) for i in range(m)]\n\nans = []\n\nfor i in range(m):\n if h[a[i][0]-1] < h[a[i][1]-1]:\n ans.append(a[i][0]-1)\n else:\n ans.append(a[i][1]-1)\n \nans = set(ans)\nans = int(len(h)) - int(le...
['Wrong Answer', 'Accepted']
['s480827595', 's977921824']
[37792.0, 34480.0]
[354.0, 334.0]
[341, 449]
p02689
u729133443
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,_),h,*t=[[*map(int,t.split())]for t in open(0)]\np=[1]*n\nfor a,b in t:p[-a]&=h[a]>h[b];p[-b]&=h[b]>h[a]\nprint(sum(p))', 'n,h,*t=[[*map(int,t.split())]for t in open(0)]\np=[1]*n[0]\nfor a,b in t:x,y=h[a-1],h[b-1];p[-a]&=x>y;p[-b]&=y>x\nprint(sum(p))']
['Runtime Error', 'Accepted']
['s333579612', 's812850752']
[32144.0, 32148.0]
[199.0, 210.0]
[119, 124]
p02689
u729915102
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()]\n\nload = [list(map(int, input().split())) for _ in range(m)]\n\nresult = {i: 0 for i in range(n)}\n\nfor l in load:\n a, b = l[0]-1, l[1]-1\n #print(a,b)\n if h[a] < h[b]:\n result[b] += 1\n\n#print(result)\nprint(sum(result.valu...
['Wrong Answer', 'Accepted']
['s707804908', 's958969296']
[42716.0, 42680.0]
[327.0, 349.0]
[310, 391]
p02689
u732061897
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()))\nresults = []\nresultsSet = set()\nfor i in range(M):\n A, B = map(int, input().split())\n setAB = set([A, B])\n if resultsSet.isdisjoint(setAB):\n results.append(setAB)\n resultsSet = resultsSet | setAB\n else:\n r...
['Wrong Answer', 'Accepted']
['s398296739', 's748040367']
[20072.0, 45276.0]
[2206.0, 613.0]
[722, 591]
p02689
u740267532
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 = 0\nfor _ in range(M):\n A, B = map(int,input().split())\n if H[B-1] < H[A-1]:\n count +=1\n if H[B-1] > H[A-1]:\n count +=1\nprint(count)', 'N, M = map(int,input().split())\nH = list(map(int,input().split()))\nl = []\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s033711015', 's310821061', 's819459957', 's946079592']
[20108.0, 20120.0, 20016.0, 20028.0]
[258.0, 2206.0, 237.0, 269.0]
[228, 375, 186, 245]
p02689
u745687363
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=[[0] for i in range(n)]\nfor i in range(m):\n a, b = map(int, input().split())\n X[a-1].append(b)\n X[b-1].append(a)\nt=0\nfor i in range(n):\n E=list(H[k-1] for k in X[i])\n if max(E) < H[i]:\n t+=1\nprint(t)', 'n, m = map(int, input()....
['Wrong Answer', 'Accepted']
['s467690781', 's477490050']
[32744.0, 30608.0]
[428.0, 480.0]
[278, 281]
p02689
u745861782
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()))\nheights = list(map(int, input().split()))\nflags = [True] * n\ncount = 0\nfor _ in range(m):\n roots = list(map(int, input().split()))\n if heights[roots[0] - 1] > heights[roots[1] - 1]:\n flags[roots[1] - 1] = False\n elif heights[roots[0] - 1] < heights[roots[1] - 1]:\n...
['Wrong Answer', 'Accepted']
['s620258243', 's252901430']
[19956.0, 20000.0]
[276.0, 279.0]
[457, 470]
p02689
u749301160
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().rstrip().split())\nh = map(int, input().rstrip().split())\nl = []\nhigh = [0] * n\ncount = 0\n\nfor i in range(m):\n a, b = map(int, input().rstrip().split())\n l.append([a, b])\n\nfor i in l:\n if h[i[0]-1] < h[i[1]-1]:\n high[i[0]-1] += 1\n elif h[i[0]-1] == h[i[1]-1]:\n ...
['Runtime Error', 'Accepted']
['s376197249', 's928430610']
[32480.0, 28776.0]
[236.0, 316.0]
[454, 460]
p02689
u749416810
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())\nh=list(map(int,input().split()))\ntall=[0]*n\nfor i in range(m):\n a,b=map(int,input().split())\n a-=1\n b-=1\n tall[a]=max(tall[a],h[b])\n tall[b]=max(tall[b],h[a])\nres=0\nfor i in range(n):\n if h[i]>tall[i]:\n res+=1\nprint(res)', 'n,m=map(int,input())\nh=list(map(int,input().split(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s434718765', 's475589623', 's622933279', 's748271511']
[9220.0, 9224.0, 9072.0, 19992.0]
[25.0, 21.0, 21.0, 334.0]
[250, 251, 253, 258]
p02689
u749742659
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()))\nroads = [list(map(int, input().split())) for i in range(m)]\n\nbestcount = 0\n\nfor i in range(n):\n best = 1 \n for j in range(m):\n if (roads[j][0] == i):\n a = roads[j][0]\n b = roads[j][1]\n if...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s062602471', 's594559110', 's996207271', 's259468580']
[31216.0, 35020.0, 33376.0, 29400.0]
[2207.0, 2211.0, 432.0, 389.0]
[644, 671, 464, 450]
p02689
u750485713
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, K = map(int, input().split())\n\nH = input().split()\nH2 = [0] * N\nfor i in range(K):\n a, b = map(int, input().split())\n if H[a-1] > H[b-1]:\n H2[b-1] = 1\n elif H[a-1] < H[b-1]:\n H2[a-1] = 1\n elif H[a-1] == H[b-1]:\n H2[b-1] = 1\n H2[a-1] = 1\n\ncount = 0\nfor i in H2:...
['Wrong Answer', 'Accepted']
['s258938312', 's397857595']
[17748.0, 17432.0]
[276.0, 302.0]
[358, 377]
p02689
u750651325
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 re\nimport sys\nimport math\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\nimport functools\ndef v(): return input()\ndef k(): return int(input())\ndef S(): return input().split()\ndef I(): return map(int,input().split())\ndef X(): r...
['Runtime Error', 'Accepted']
['s777461104', 's529157752']
[10524.0, 22040.0]
[37.0, 285.0]
[630, 743]
p02689
u756030237
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\nhigh_list = list(map(int, input().split()))\ncheck_list = [1]*N\n\nfor i in range(M):\n a_, b_ = map(int, input().split())\n if high_list[a_-1] < high_list[b_-1]:\n check_list[a_-1] = 0\n elif high_list[a_-1] > high_list[b_-1]:\n check_list[b_-1] = 0\n elif high_list[a_-1...
['Wrong Answer', 'Accepted']
['s909072375', 's892518852']
[20044.0, 20112.0]
[246.0, 244.0]
[402, 405]
p02689
u769411997
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, B = [], []\nfor i in range(m):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\ntmp = [0] * n\ncnt = [0] * n\n\nnum = []\nres = 0\nfor i in range(1, n+1):\n if i not in A and i not in B:\n num.append(i)\n\nfor ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s101821903', 's890336178', 's334817533']
[23200.0, 19960.0, 19992.0]
[2206.0, 377.0, 309.0]
[717, 293, 276]
p02689
u773065853
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 = [int(x) for x in input().split()]\nl = [1] * n\nfor i in range(m):\n\ta, b = map(int, input().split())\n\tif h[a-1] >= h[b-1]:\n\t\tl[b-1] = 0\n\tif h[b-1] >= h[a-1]:\n\t\tl[a-1] = 0\nprint(sum(l))', 'n, m = map(int, input().split())\nh = [int(x) for x in input().split()]\nl = [1] * n\nfor i in range(m):\n\ta, b ...
['Runtime Error', 'Accepted']
['s731277359', 's650082505']
[9200.0, 20112.0]
[21.0, 254.0]
[186, 219]
p02689
u773440446
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\nl = [0] * 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 H[A - 1] < H[B - 1]:\n l[A - 1] = 0\n elif H[A - 1] == H[B - 1]:\n l[A - 1], l[B - 1] = 0, 0\nprint(l.count(1))', 'n,m = map...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s037275939', 's266487420', 's653619475', 's856976425', 's631958598']
[20032.0, 19876.0, 20124.0, 20132.0, 20120.0]
[48.0, 47.0, 49.0, 244.0, 248.0]
[292, 293, 293, 293, 320]
p02689
u773865844
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\n\nlines = sys.stdin.readlines()\n\nX = lines[0].split(' ')\nN = int(X[0])\nM = int(X[1])\n\nH = []\nY = [0 for j in range(N)]\nZ =[0]*N\n\nfor i in range(N):\n H.append(lines[1].split(' ')[i])\n\nfor j in range(M):\n A = int(lines[j+2].split(' ')[0])\n B = int(lines[j+2].split(' ')[1])\n if Y[...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s069879505', 's196041272', 's508921901', 's954278659', 's098539220']
[25752.0, 24160.0, 24220.0, 24236.0, 30720.0]
[2206.0, 2206.0, 2206.0, 2206.0, 212.0]
[419, 300, 384, 173, 372]
p02689
u779293207
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=[]\nd=[]\ne=[]\nf=[]\n\nfor i in range(M):\n A,B=map(int,input().split())\n d.append(A)\n d.append(B)\n if H[A-1]>H[B-1]:\n c.append(A)\n e.append(B)\n elif H[B-1]>H[A-1]:\n c.append(B)\n e.append(A)\n\nfor k in range(1,N+1):\n if (k ...
['Wrong Answer', 'Accepted']
['s506671848', 's417628008']
[24904.0, 20116.0]
[2206.0, 266.0]
[520, 277]
p02689
u779389113
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()\nN = int(N)\nM = int(M)\nh = list(map(int,input().split()))\ny = [0] * N\nfor i in range (M):\n A,B = map(int,input().split())\n if h[A -1] >= h[B -1]:\n y[B -1] += 1\n if h[B -1] >= h[a -1]:\n y[A -1] += 1\nprint(y.count(0))', '(N,M) = input().split()\nN = int(N)\nM = i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s267034980', 's570884485', 's308012983']
[20028.0, 20100.0, 19960.0]
[44.0, 43.0, 279.0]
[261, 261, 249]
p02689
u779728630
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\nL = [0 for in range(N+1)]\n\nfor q in range(M):\n A, B = map(int, input().split())\n if H[A] < H[B]:\n L[A] += 1\n elif H[A] > H[B]:\n L[B] += 1\n else:\n L[A] += 1\n L[B] += 1\n \nans = 0\nfor i in range(1,N+1):\n if L[i] ==...
['Runtime Error', 'Accepted']
['s909008318', 's105082623']
[9020.0, 20124.0]
[22.0, 265.0]
[329, 339]
p02689
u785266893
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\ngood = 0\n\nobs = [[]*n]\n\nfor i in range(m):\n a, b = map(int, input().split())', 'n, m = map(int, input().split())\nh = list(map(int, input().split()))\n\ngood = 0\n\nobs = [[] for i in range(n) ]\n\nfor i in range(m):\n a, b = map(in...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s040071428', 's883688675', 's811652650']
[19952.0, 20000.0, 31948.0]
[200.0, 65.0, 410.0]
[150, 420, 449]
p02689
u788452182
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(" "))\nheights=list(map(int,input().split(" ")))\n\nroads=[]\nmountains={}\ntestM=0\nres=0\nways=0\ntemp=0\nsign=False\nfor i in range(m):\n roads.append(list(map(int,input().split(" "))))\nfor j in range(1,n+1):\n if sign:\n res+=1\n sign=True\n for k in range(m):\n ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s371098692', 's454477069', 's594250595', 's801787526']
[31396.0, 35192.0, 16828.0, 20104.0]
[2206.0, 2210.0, 35.0, 256.0]
[570, 614, 492, 253]
p02689
u790012205
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()))\nHeight = []\nGood = []\nfor i in range(N):\n Height.append(H[i])\n Good.append(0)\nfor i in range(M):\n A, B = map(int, input().split())\n if Height[A - 1] < Height[B - 1]:\n Good[A - 1] = 1\n if Height[A - 1] > Height[B - 1]...
['Wrong Answer', 'Accepted']
['s236367735', 's272442133']
[20116.0, 20120.0]
[303.0, 271.0]
[460, 462]
p02689
u804711544
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(_) for _ in input().split()]\n\nelevation = {}\nfor _ in range(len(h)):\n elevation[_+1] = h[_]\n\nobs = list([] for _ in range(len(h)))\nfor i in range(m):\n obsA, obsB = map(int, input().split())\n if elevation[obsA] == elevation[obsB]: \n obs[obsA-1].appe...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s122734168', 's598248385', 's424771326']
[34940.0, 34800.0, 31708.0]
[475.0, 464.0, 435.0]
[836, 836, 840]
p02689
u805011545
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 = [int(x) for x in input().split()]\nH = [float(x) for x in input().split()]\nAB = [[int(x) for x in input().split()] for _ in range(M)]\n\ngraph = np.zeros((N,N))\nfor A, B in AB:\n graph[A-1][B-1] = 1\n graph[B-1][A-1] = 1\n\nans = 0\nfor i in range(N):\n h = 0\n for j in range(N):\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s287993979', 's465698575', 's828217663']
[48168.0, 48208.0, 48872.0]
[322.0, 319.0, 422.0]
[386, 399, 357]
p02689
u809816772
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\nfor i in range(M):\n A[i], B[i] = map(int, input().split())\n A[i] -= 1\n B[i] -= 1\nlis = []\nfor i in range(M):\n if H[A[i]] < H[B[i]]:\n min.append(A[i])\n if H[A[i]] == H[B[i]]:\n min.append(...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s056481471', 's379592650', 's512476546', 's894681417']
[20972.0, 21968.0, 21840.0, 21692.0]
[225.0, 2206.0, 2206.0, 307.0]
[407, 337, 339, 339]
p02689
u810356688
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\ndef input(): return sys.stdin.readline().rstrip()\ndef main():\n n,m=map(int,input().split())\n H=[int(_) for _ in input().split()]\n HH= [0]*n\n\n for i in range(m):\n a,b=map(int,input().split())\n HH[a-1]=max(HH[a-1],H[b-1])\n HH[b-1]=max(HH[b-1],H[a-1])\n ans=0\n ...
['Wrong Answer', 'Accepted']
['s095563559', 's538911161']
[19996.0, 20124.0]
[241.0, 216.0]
[447, 433]
p02689
u811068179
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 collections\nn,m = (int(i) for i in input().split())\nh = [int(i) for i in input().split()]\nab =[[0]]*n\nprint(ab)\nfor _ in range(m):\n\ta,b = (int(i) for i in input().split())\n\tif h[a-1]-h[b-1]>0:\n\t\tab[b-1]=["a"]\n\n\telif h[a-1]-h[b-1]<0:\n\t\tab[a-1]=["a"]\n\n\telse:\n\t\tab[a-1]=["a"]\n\t\tab[b-1]=[...
['Wrong Answer', 'Accepted']
['s677788718', 's461957317']
[20576.0, 20480.0]
[372.0, 326.0]
[318, 309]
p02689
u815304751
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 = list(map(int,input().split()))\nh_ = list(map(int,input().split()))\na_ = [list(map(int,input().split())) for i in range(m)]\n\nres = np.arange(2,n)\nres = res.tolist()\nfor i in range(m):\n if(h_[a_[i][0] - 1] < h_[a_[i][1] - 1]):\n if(a_[i][0] in res):\n res.remove(a_[...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s406107980', 's407638185', 's571222400']
[54232.0, 31520.0, 20056.0]
[2207.0, 2206.0, 298.0]
[575, 562, 346]
p02689
u815763296
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())\nHList = []\nansList=[]\nfor H in input().split():\n HList.append(H)\n ansList.append(1)\n\nprint(ansList)\n\nfor i in range(M):\n A, B = map(int, input().split())\n if HList[A-1] > HList[B-1]:\n ansList[B-1] = 0\n elif HList[A-1] < HList[B-1]:\n ansList[A...
['Wrong Answer', 'Accepted']
['s782850181', 's149696904']
[19356.0, 20812.0]
[266.0, 242.0]
[422, 309]
p02689
u819465503
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 random\nimport collections\n# num_list = [10**5, 10**4]\n\n# way_list = [[random.randint(1, 10**5), random.randint(1, 10**5)] for i in range(10**4)]\n\nnum_list = [int(i) for i in input().split()]\nheight_list = [int(i) for i in input().split()]\nway_list = list(list(map(int, input().split())) for i in range(n...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s023043993', 's284392127', 's925407883']
[45236.0, 45072.0, 44932.0]
[334.0, 329.0, 331.0]
[962, 750, 777]
p02689
u833738197
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()))\nlower_list = []\nfor i in range(m):\n r = list(map(int,input().split()))\n if height[r[0]-1] > height[r[1]-1]:\n lower_list.append(r[1])\n elif height[r[0]-1] < height[r[1]-1]:\n lower_list.append(r[0],r[1])\n else:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s490462990', 's642068287', 's833170718']
[20120.0, 9048.0, 20108.0]
[46.0, 21.0, 284.0]
[381, 349, 409]
p02689
u836284844
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 solve(height, road):\n graph = collections.defaultdict(set)\n for a, b in road:\n graph[a].add(b)\n graph[b].add(a)\n ans = 0\n no_good = set()\n for k in graph:\n for nei in graph[k]:\n if height[nei-1] >= height[k-1]:\n no_good.add(k)\n return len...
['Runtime Error', 'Accepted']
['s031260941', 's067812297']
[31152.0, 59496.0]
[259.0, 518.0]
[524, 544]
p02689
u838644735
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, *HAB = map(int, open(0).read().split())\n H = [0]*N\n for i in range(N):\n H[i] = HAB[i]\n A, B = [0]*M, [0]*M\n for i in range(M):\n A[i] = HAB[N + 2 * i + 0] - 1\n B[i] = HAB[N + 2 * i + 1] - 1\n \n ans = set()\n for i in range(M):\n a = A[i]\n...
['Runtime Error', 'Accepted']
['s480273527', 's216008929']
[9072.0, 44108.0]
[25.0, 165.0]
[530, 591]
p02689
u838959206
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()))\n\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 els...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s429721041', 's857944100', 's501119232']
[29384.0, 33572.0, 29428.0]
[355.0, 433.0, 364.0]
[365, 396, 289]
p02689
u845847173
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 = []\nfor i 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 ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s281124711', 's685396392', 's939319927', 's967851204', 's358392996']
[8908.0, 8920.0, 8936.0, 8920.0, 28996.0]
[24.0, 22.0, 21.0, 24.0, 317.0]
[456, 457, 470, 457, 473]
p02689
u849341325
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())]\n\nH = [0] + list(map(int,input().split()))\n\npath = {}\nfor i in range(1,N+1):\n\tpath[i] = {}\n\nfor i in range(1,M+1):\n\tA, B = map(int,input().split())\n\tpath[A].add(B)\n\tpath[B].add(A)\n\ncount = 0\n\nfor i in range(1,N+1)\n\tif H[i] > max(H[j] for j in path[i]):\n\t\tcount...
['Runtime Error', 'Accepted']
['s866752087', 's684497506']
[9008.0, 29316.0]
[22.0, 428.0]
[313, 361]
p02689
u851704997
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()))\nList = []\nfor k in range(1,N+1):\n List.append(k)\nfor i in range(M):\n A,B = map(int,input().split())\n tmpA = H[A-1]\n tmpB = H[B-1]\n if(tmpA < tmpB):\n if(A in List == True):\n List.remove(A)\n elif(tmpA > tmpB):\n if(B in List ...
['Wrong Answer', 'Accepted']
['s341922040', 's649646157']
[20144.0, 19952.0]
[2206.0, 259.0]
[461, 308]
p02689
u857293613
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())\nhlis = list(map(int, input().split()))\nroad = []\nfor i in range(m):\n a, b = map(int, input().split())\n road.append([a, b])\ntable = [0]*n\nans = 0\nfor i in range(n):\n if table[i] == 0:\n rival = []\n for j in road:\n if j[0]...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s008373493', 's575727405', 's987096142', 's070043485']
[47368.0, 28956.0, 47276.0, 20044.0]
[2207.0, 2206.0, 2207.0, 240.0]
[691, 746, 651, 342]
p02689
u858196335
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\ngoodObservatory = [1]*N\nH = []\nH = input()\n\nfor i in range(M):\n\tA,B = map(int, input().split())\n\tif H[A-1] > H[B-1]:\n\t\tgoodObservatory[B-1] = 0\n\telif H[A-1] < H[B-1]:\n\t\tgoodObservatory[A-1] = 0\n\telif H[A-1] == H[B-1]:\n\t\tgoodObservatory[A-1] = 0\n\t\tgoodObservat...
['Wrong Answer', 'Accepted']
['s227393861', 's152591626']
[11776.0, 20816.0]
[221.0, 254.0]
[333, 351]
p02689
u861141787
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 \nedeg = [[] for _ in range(n)]\nfor i in range(m):\n a, b = map(int, input().split())\n a -= 1; b -= 1\n edeg[a].append(b)\n edeg[b].append(a)\n \n#print(edeg)\n\nans = 0\nfor node in range(n):\n good = True\n for neigber in ed...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s070992875', 's320299472', 's307015585']
[29452.0, 29300.0, 29428.0]
[396.0, 478.0, 380.0]
[458, 457, 450]
p02689
u861886710
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()))\narr=[0]+list(map(int,input().split()))\ng = [[] for _ in range(n+1)]\nprint(g)\nfor _ in range(m):\n a, b = map(int, input().split())\n g[a].append(b)\n g[b].append(a)\nprint(g)\nans = 0\nfor v in range(1, n+1):\n \n for u in g[v]:\n if arr[u]>=arr[v]:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s076616275', 's558415977', 's784428688', 's805989400']
[33456.0, 19956.0, 20064.0, 29468.0]
[399.0, 313.0, 312.0, 361.0]
[591, 384, 384, 499]
p02689
u863433366
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 = [[] for _ in range(n)]\ncheck = [False for _ in range(n)]\nfor i in range(m):\n a, b = map(int, input().split())\n ab[a-1].append(b)\n ab[b-1].append(a)\n\nfor j in range(n):\n for k in ab[j]:\n if k < h[j]:\n check[j] = True\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s361842035', 's736610485', 's746638236', 's764463843', 's919315740', 's754622104']
[8908.0, 29276.0, 30224.0, 9028.0, 30168.0, 29404.0]
[25.0, 358.0, 353.0, 24.0, 376.0, 365.0]
[399, 328, 337, 331, 351, 331]
p02689
u863964720
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_B = [[0] * 2 for i in range(M)]\nJ = [0]*N\nfor i in range(M):\n A,B = map( int ,input().split())\n A_B[i][0] = A\n A_B[i][1] = B\nfor j in range(M):\n if H[A_B[j][0]-1] > H[A_B[j][1]-1]:\n if J[A_B[j][0]-1] != -1:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s271888352', 's408252901', 's897193885']
[28928.0, 28824.0, 28940.0]
[354.0, 354.0, 356.0]
[627, 627, 627]
p02689
u867826040
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 = [tuple(map(int,input().split())) for i in range(m)]\nx = ["B"]*n\nfor t in l:\n if h[t[0]-1] <= h[t[1]-1]:\n x[t[1]-1]="G"\n x[t[0]-1]="B"\n elif h[t[0]-1] >= h[t[1]-1]:\n x[t[1]-1]="B"\n x[t[0]-1]="G"\n print...
['Runtime Error', 'Accepted']
['s426424850', 's231839589']
[153724.0, 40436.0]
[1997.0, 466.0]
[330, 369]
p02689
u871934301
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()))\ngraph = [[] for _ in range(n)]\nfor _ in range(m):\n a, b = map(int, input().split())\n graph[a-1].append(b-1)\n graph[b-1].append(a-1) \nprint(graph)', 'N,M = map(int, input().split())\n\nH=list(map(int,input().split()))\n\ngraph=[[0] fo...
['Wrong Answer', 'Accepted']
['s753659294', 's646100309']
[33536.0, 26100.0]
[345.0, 353.0]
[223, 610]
p02689
u878291720
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\nrlist = {n:[] for n in range(1,N+1)}\ncnt = 0\nfor m in range(1.M+1):\n A,B = map(int,input().split())\n rlist[A].append(B)\n rlist[B].append(A)\n\nfor k,v in rlist.items():\n if len(v) == 0:\n cnt += 1\n else:\n for i in v:\n if H[...
['Runtime Error', 'Accepted']
['s943246869', 's622453704']
[9032.0, 37824.0]
[28.0, 454.0]
[375, 378]
p02689
u880400515
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()))\n\nG = [[] for i in range(N)]\n\nfor i in range(M):\n A, B = list(map(int, input().split()))\n G[A - 1].append(B-1)\n G[B-1].append(A-1)\n\nans = 0\n\nfor i in range(N):\n self_h = H[i]\n\n self_max_flag = True\n\n for to in...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s541766722', 's581678869', 's846907328', 's295350968']
[29360.0, 1899496.0, 20120.0, 29452.0]
[350.0, 2261.0, 47.0, 389.0]
[448, 457, 422, 439]
p02689
u883040023
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()))\nedge = [[] for _ in range(n)]\n\nfor _ in range(m):\n a,b = map(int,input().split())\n a -= 1\n b -= 1\n edge[a].append(b)\n edge[b].append(a) \n\nans = 0\n\nfor i in range(n):\n x = edge[i]\n \n if len(x) == 0:\n ans +...
['Wrong Answer', 'Accepted']
['s096882661', 's768569505']
[30484.0, 29364.0]
[523.0, 423.0]
[504, 472]
p02689
u886286585
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\ntmp = [1] * N\nmax = 0\n\nAB = [map(int, input().split()) for _ in range(M)]\nA, B = [list(i) for i in zip(*AB)] \n \nfor i in range(M):\n if H[A[i]-1] > H[B[i]-1]:\n tmp[B[i]-1] = 0\n elif H[A[i]-1] < H[B[i]-1]:\n tmp[A[i]-1] = 0\n...
['Wrong Answer', 'Accepted']
['s727254758', 's375457419']
[67704.0, 67796.0]
[464.0, 472.0]
[409, 360]
p02689
u891945807
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#h.sort()\n\nfor i in range(m):\n a,b = map(int,input().split())\n l[a-1].append(b-1)\n l[b-1].append(a-1)\n\nprint(l)\n \nc = 0\nfor j in range(n):\n if len(l[j]) == 0:\n c += 1\n else:\n m = 0\n for k in l[j]:\n if h[j] <= h[k]:...
['Runtime Error', 'Runtime Error', 'Accepted']
['s450477560', 's543110571', 's107851069']
[20140.0, 9048.0, 29468.0]
[41.0, 23.0, 378.0]
[376, 405, 391]
p02689
u892615201
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\ni = list(map(int, input().split())) \nj = list(map(int, input().split())) \n\nlis=[]\nfor i in range (i[0]):\n tendata=[i+1,j[i],0]\n lis.append(tendata)\n\nfor i in range(i[1]):\n miti = list(map(int, input().split()))\n if ((lis[miti[0]-1][1]) > (lis[miti[1]][1])):\n lis[miti[0]-1][2] = (lis[...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s275092135', 's290416914', 's516939088', 's670529368', 's021664096']
[26472.0, 31916.0, 31924.0, 26420.0, 26532.0]
[96.0, 446.0, 398.0, 393.0, 359.0]
[541, 583, 444, 572, 545]
p02689
u894074703
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 q3():\n N, M = (int(i) for i in input().split())\n H = [int(i) for i in input().split()]\n ans = [True]*N\n\n for i in range(M):\n A, B = (int(i) for i in input().split())\n\n if H[A-1] <= H[B-1]:\n ans[A-1] = False\n if H[B-1] <= H[A-1]:\n ans[B-1] = False\n...
['Wrong Answer', 'Accepted']
['s984697193', 's181714534']
[20052.0, 20080.0]
[259.0, 255.0]
[360, 372]
p02689
u898421050
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, b =[], []\nfor i in range(m):\n ab = list(map(int, input().split()))\n a.append(ab[0])\n b.append(ab[1])\n\nbad_list = []\nfor i in range(m):\n if h[a[i]-1] < h[b[i]-1]:\n bad_list.append(a[i])\n else:\n bad_list.ap...
['Wrong Answer', 'Accepted']
['s430701234', 's432368167']
[25800.0, 19928.0]
[279.0, 252.0]
[362, 345]
p02689
u901598613
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=[i for i in range(1,n+1)]\nlow=[]\nfor i in range(m):\n x,y=map(int,input().split())\n if H[x-1]==H[y-1]:\n low.append(x)\n low.append(y)\n elif H[x-1]>H[y-1]:\n low.append(y)\n else:\n low.append(x)\nlow=lis...
['Runtime Error', 'Runtime Error', 'Accepted']
['s145595801', 's841315970', 's159390695']
[23576.0, 60756.0, 23696.0]
[273.0, 356.0, 269.0]
[368, 453, 341]
p02689
u903699277
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 = map(int, input().split())\n H = list(map(int, input().split()))\n S = [list(map(int, input(_).split())) for _ in range(M)]\n LIST = [1] * N\n for A, B in S:\n if H[A-1] >= H[B-1]: LIST[B-1] = 0\n elif H[A-1] <= H[B-1]: LIST[A-1] = 0\n elif H[A-1] == H[B-1]:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s133823953', 's329927208', 's505045533', 's778338049', 's624686177']
[32008.0, 31960.0, 32004.0, 32028.0, 20012.0]
[460.0, 467.0, 470.0, 492.0, 234.0]
[392, 390, 425, 387, 387]
p02689
u904804404
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 = list(map(int,input().split()))\nH = list(map(int,input().split()))\n\n\nfrom collections import defaultdict\nd = defaultdict(int)\nfor i in range(M):\n A,B = list(map(int,input().split()))\n A -= 1\n B -= 1\n if d[A] < H[B]:\n d[A] = H[B]:\n if d[B] < H[A]:\n ...
['Runtime Error', 'Accepted']
['s179188740', 's342366538']
[9000.0, 25028.0]
[22.0, 286.0]
[478, 478]
p02689
u905793676
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()))\nbad = []\nans =[]\n\nfor i in range(m):\n a,b=map(int,input().split())\n if h[a-1] > h[b-1]:\n bad.append(b)\n elif h[a-1] == h[b-1]:\n bad.append(a)\n bad.append(b)\n else:\n bad.append(a)\n\nj = 1\nfor j in ra...
['Wrong Answer', 'Accepted']
['s993616733', 's390504224']
[20136.0, 20104.0]
[2206.0, 260.0]
[422, 329]
p02689
u910536093
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()))\n\nheight = [int(i) for i in input().split()]\n\ntele = {}\nfor num, h in enumerate(height, 1):\n tele[num] = [h, "G"]\n\nfor roads in range(m):\n a, b = list(map(int, input().split()))\n if (tele[a][0] >= tele[b][0]):\n tele[b][1] = "N"\n elif (tele[a][0] <= ...
['Wrong Answer', 'Accepted']
['s935143128', 's347073896']
[33784.0, 31216.0]
[402.0, 406.0]
[465, 534]
p02689
u913392095
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()))\nABmap=[[] for i in range(N)]\ncount=0\nfor i in range(M):\n A,B=map(lambda x:x-1,map(int,input().split()))\n ABmap[A].append(H[B])\n ABmap[B].append(H[A])\n \nfor i in range(N):\n if len(ABmap[i])==0:\n count+=1\n elif max(...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s321737064', 's786165360', 's111125113']
[22940.0, 595312.0, 22936.0]
[408.0, 2220.0, 399.0]
[391, 390, 386]
p02689
u916662650
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())\nhight = [int(x) for x in input().split()]\ntenbou = [input().split() for l in range(M)]\nresult = [1] * N\n\n\nfor i in range(M):\n x = int(tenbou[i][0]) - 1\n y = int(tenbou[i][1]) - 1\n if hight[x] >= hight[y]:\n result[y] = 0\n elif hight[y] > hight[x]:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s423071245', 's531246024', 's822392664']
[43756.0, 43632.0, 43200.0]
[316.0, 345.0, 331.0]
[364, 389, 439]
p02689
u921016616
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())\nl = [1] * (n + 1)\nl[0] = 0 \nh = list(map(int, input().strip().split())) \nb_a = b_b = 0\nfor i in range(m):\n a, b = map(int, input().split())\n if b_a == a and b_b == b :\n l[a] = l[b] = 0\n else if h[a-1] < h[b-1]:\n l[a] = 0\n else if h[a-1] > h[b-1] :\n l[b] = 0\n...
['Runtime Error', 'Accepted']
['s867762792', 's369252210']
[9052.0, 20784.0]
[20.0, 248.0]
[339, 289]
p02689
u921156673
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())) \nassert len(H) == N\npaths = [[] for i in range(N)]\nfor m in range(M)\n a, b = map(int, input().split())\n paths[a].append(b)\n paths[b].append(a) \nassert len(A) == M\n\ndef search(a, marks): \n peaks = []\n marks.append(a)\n for b in path...
['Runtime Error', 'Runtime Error', 'Accepted']
['s121120361', 's699842925', 's964826990']
[8928.0, 29324.0, 29432.0]
[28.0, 293.0, 354.0]
[636, 408, 414]
p02689
u921818939
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 collections\nfrom collections import defaultdict\n\nn,m=map(int,input().split())\nh=[int(i) for i in input().split()]\ngraph=defaultdict(list)\nfor i in range(m):\n a,b=map(int,input().split())\n graph[a].append(b)\n graph[b].append(a)\ncount=0\nprint(graph)\nfor i in graph:\n for j in graph[i]:\n ...
['Wrong Answer', 'Accepted']
['s593811059', 's259726163']
[36572.0, 46804.0]
[499.0, 577.0]
[386, 932]
p02689
u927373043
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())\ngood = [0]*N\n\nH = list(map(int,input().split()))\n\nfor j in range(M):\n a, b = map(int,input().split())\n if(H[a-1] == H[b-1]):\n good[a-1] += 1\n good[b-1] += 1\n elif(H[a-1] < H[b-1]):\n good[a-1] += 1\n elif(H[b-1] < H[a-1]:\n good[b-1] += 1\ncount = 0\nfor i in ...
['Runtime Error', 'Accepted']
['s360060973', 's242215663']
[8996.0, 20908.0]
[22.0, 283.0]
[360, 344]
p02689
u928758473
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 os\n\ndef main():\n\tn,m = map(int, input().split())\n\th_list = list(map(int, input().split()))\n\tans = [1]*n\n\tresult = []\n\tfor i in range(m):\n\t\ta,b = map(int, input().split())\n\t\tif h_list[a-1] < h_list[b-1]:\n\t\t\tans[a-1] = 0\t\n\t\telse:\n\t\t\tans[b-1] = 0\n\t\tresult.append(a)\n\t\tresult.app...
['Wrong Answer', 'Accepted']
['s594658330', 's395715817']
[22464.0, 20128.0]
[250.0, 237.0]
[357, 361]
p02689
u929996201
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 = map(int,input().split())\n s = [int(n) for n in input().split()]\n cs = s\n for i in range(m):\n a,b = map(int,input().split())\n a-=1,b-=1\n if(s[a] < s[b]):\n cs[a]=-1\n else if(s[a] == s[b]):\n cs[a]=-1\n cs[b]=-1\n else:\n cs[b]=-1\n print(cs.count(-1))\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s201196936', 's267160925', 's322192536', 's536302203', 's904946894', 's910146468', 's951855240', 's996449140', 's257999295']
[8952.0, 20104.0, 19964.0, 9012.0, 8952.0, 8940.0, 9036.0, 21012.0, 21000.0]
[22.0, 251.0, 52.0, 24.0, 22.0, 21.0, 20.0, 238.0, 245.0]
[346, 271, 284, 545, 591, 351, 341, 422, 400]