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 | u362599643 | 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()]\nG = [0]*N\nL = [1]*N\n\nfor i in range(M):\n A, B = map(int, input().split())\n L[A-1] = 0\n L[B-1] = 0\n\n if H[A-1]>H[B-1]: \n G[A-1] = 1\n G[B-1] = 0\n elif H[A-1]<H[B-1]: \n G[B-1] = 1\n G[A-1] = 0\... | ['Wrong Answer', 'Accepted'] | ['s658204107', 's438472558'] | [20044.0, 20052.0] | [278.0, 238.0] | [414, 239] |
p02689 | u364774090 | 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 = [int(x) for x in input().split()]\n\nhigh = set()\nlow = set()\nlonely = set()\n\nfor i in range(M):\n i1, i2 = [int(x) for x in input().split()]\n if H[i1 - 1] != H[i2 - 1]:\n high.add(i2)\n low.add(i1)\n lonely.add(i1)\n lonely.add(i2)\n\nresult = ... | ['Wrong Answer', 'Accepted'] | ['s322782570', 's119199555'] | [28072.0, 27456.0] | [333.0, 328.0] | [341, 427] |
p02689 | u366424761 | 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())\ntree = list(map(int,input().split())) \ntree_sub = tree \nfor i in range(M):\n a,b = map(int,input().split())\n if (tree[a-1] > tree[b-1]) and (int(tree[b-1]) in tree_sub):\n tree_sub[b-1] = 0\n elif (tree[a-1] < tree[b-1]) and (tree[a-1] in tree_sub):\n tree_sub... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s132222888', 's144401841', 's529179849', 's956846959', 's206714772'] | [20084.0, 20112.0, 20072.0, 19940.0, 20060.0] | [2206.0, 249.0, 45.0, 269.0, 246.0] | [437, 414, 369, 440, 393] |
p02689 | u372102441 | 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\n#n = int(input())\n#l = list(map(int, input().split()))\n\n\n\nimport copy\nn, m = map(int, input().split())\nh = list(map(int, input().split()))\nok = [True for i in range(n)]\nmaxu=copy.copy(h)\nfor i in range(m):\n p = list(map(int, input().split()))\n if maxu[p[0]-1... | ['Wrong Answer', 'Accepted'] | ['s160291950', 's956005555'] | [21208.0, 20340.0] | [209.0, 198.0] | [757, 647] |
p02689 | u373047809 | 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... | ['#!/usr/bin/env python3\na = 1\nx = int(input())\nwhile True:\n bz = (x-a**5)**.2\n if float.is_integer(bz):\n print(a, -int(bz))\n exit()\n a += 1', 'a = 0\nx = int(input())\nfor a in range(x):\n b = (x - a**5)**.2\n if type(b) in (int,float) and float.is_integer(float(b)):\n print... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s598941600', 's729950958', 's793302144'] | [9180.0, 9192.0, 20032.0] | [22.0, 25.0, 265.0] | [161, 167, 264] |
p02689 | u373295322 | 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()))\nroad_dict = {a+1: set() for a in range(n)}\nfor i in range(m):\n a, b = map(int, input().split())\n if a in road_dict:\n road_dict[a].add(b)\n else:\n road_dict[a] = set([b])\n if b in road_dict:\n road_dict[b].add(a)\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s950090746', 's569396872'] | [55004.0, 54000.0] | [2207.0, 529.0] | [935, 659] |
p02689 | u375616706 | 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\ndef ok(B):\n i=1\n B=abs(B)\n while i**5<B:\n i+=1\n return i**5==B\n\ndef get(B):\n f = B/abs(B)\n i=1\n B=abs(B)\n while i**5<B:\n i+=1\n return int(i*f)\n\n\n\nA_cand=[]\ni=0\nwhile i**5<=10**10:\n A_cand.append(i)\n i+=1\n\n#print(A_cand)\nfor a in ... | ['Runtime Error', 'Accepted'] | ['s219421589', 's171215215'] | [9124.0, 45312.0] | [24.0, 506.0] | [402, 334] |
p02689 | u382169668 | 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_tree = map(int, input().split())\nGOOD_Tree = [1 for n in range(len(H_tree))]\n\nfor n i in range(M):\n A, B =map(int, input().split())\n if H_tree[A-1]>=H_tree[B-1]:\n GOOD_tree[A-1] = 0\n else:\n GOOD_tree[B-1] = 0\nprint(GOOD_tree.count(1))', 'N, M =map(int, input().spli... | ['Runtime Error', 'Accepted'] | ['s179369405', 's763489041'] | [9024.0, 19976.0] | [25.0, 245.0] | [277, 279] |
p02689 | u383450070 | 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()))\nlst = [0] * n\nfor j in range(m):\n a,b=map(int,input().split())\n if height[a-1]<height[b-1]:\n if lst[a-1] == -1:\n lst[b-1]+=1\n else:\n lst[a-1]=-1\n lst[b-1]+=1\n elif height[a-1]>height[b-1]:\n if lst[b-1] == -1:\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s463019662', 's811771916', 's906549674'] | [20068.0, 20132.0, 20160.0] | [282.0, 301.0, 302.0] | [513, 403, 500] |
p02689 | u384476576 | 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 = list(map(int, input().split()))\nroad_list = []\n\nfor _ in range(M):\n road_list.append([])\nfor i in range(M):\n a, b = list(map(int, input().split()))\n H_a, H_b = [H_list[a - 1], H_list[b - 1]]\n if H_a <= H_b:\n road_list[a - 1].append(a)\n e... | ['Runtime Error', 'Accepted'] | ['s003703155', 's227384639'] | [25080.0, 25156.0] | [377.0, 362.0] | [440, 454] |
p02689 | u387080888 | 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,ans=[],[]\nfor _ in range(M):\n a.append(list(map(int,input().split())))\nfor i in range(M):\n if H[(a[i][0])-1]>H[(a[i][1])-1]:\n ans.append(a[i][0])\n elif H[(a[i][0])-1]<H[(a[i][1])-1]:\n ans.append(a[i][1])\nprint(len(ans))',... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s108212530', 's538592163', 's935339470', 's228684928'] | [32016.0, 31336.0, 31220.0, 19972.0] | [333.0, 2207.0, 248.0, 255.0] | [306, 739, 303, 251] |
p02689 | u391675400 | 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\ncheck = [True] * n \nfor i in range(m):\n print(i)\n a,b = (map(int,input().split()))\n if h[a-1] > h[b-1]:\n check[b-1] = False\n elif h[a-1] < h[b-1]:\n # print("i,check",i,check)\n check[a-1] = False\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s837582219', 's068051458'] | [19948.0, 20112.0] | [483.0, 250.0] | [405, 405] |
p02689 | u397020326 | 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()))\nroad = [list(map(int, input().split())) for i in range(M)]\nDP = [0 for i in range(N+1)]\nDP[0] = -1\nkouho = []\n\nfor i in range(M):\n Ai = road[i][0]\n Bi = road[i][1]\n if H[Ai - 1] > H[Bi - 1]:\n if DP[Ai] != -1:\n DP[Ai] = 1\n ... | ['Wrong Answer', 'Accepted'] | ['s292613463', 's883303589'] | [32828.0, 31740.0] | [372.0, 349.0] | [599, 514] |
p02689 | u400221789 | 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\nfor i in range(m):\n a,b, = map(int,input().split())\n if h[a-1] >= h[b-1]:\n ans[b-1] =0\n if h[a-1] <= h[b-1]:\n ans[a-1] = 0\n print(ans)\nprint(sum(ans))', 'n,m = map(int,input().split())\nh = list(map(int,input().split()... | ['Wrong Answer', 'Accepted'] | ['s434361119', 's172634679'] | [122520.0, 20068.0] | [3611.0, 258.0] | [240, 227] |
p02689 | u400692785 | 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()))\nli = []\nfor m in range(M):\n a, b = map(int, input().split())\n if h[a-1] < h[b-1]:\n li.append(a)\n if h[a-1] == h[b-1]:\n li.append(a)\n li.append(b)\n else:\n li.append(b)\n\nanswer = N - len(set(li))\nprint(answer)', 'N, M = m... | ['Wrong Answer', 'Accepted'] | ['s542550710', 's105010960'] | [23184.0, 19984.0] | [282.0, 251.0] | [292, 294] |
p02689 | u411478442 | 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())\nobs_height = [int(x) for x in input().split()]\ngood_obs_num = 0\ncheck_list = []\n\nfor i in range(M):\n a,b = (int(x) for x in input().split())\n if(a < b):\n good_obs_num += 1\n \nprint(good_obs_num)', 'def is_good_obs(num,obs_height,linked_num):\n for e in linke... | ['Wrong Answer', 'Accepted'] | ['s160184810', 's897862896'] | [20064.0, 29416.0] | [228.0, 433.0] | [243, 534] |
p02689 | u411858517 | 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()))\nroot = [list(map(int, input().split())) for _ in range(M)]\n\nis_min = [0 for _ in range(N)]\nfor i in range(M):\n A = root[i][0] - 1\n B = root[i][1] - 1\n\n if H[A] > H[B]]:\n is_min[B] = 1\n\n elif H[A] == H[B]]:\n is_... | ['Runtime Error', 'Accepted'] | ['s513720444', 's416016788'] | [9000.0, 31880.0] | [25.0, 314.0] | [395, 392] |
p02689 | u413318755 | 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 HN = list(map(int, input().split()))\n\n temp = [True for _ in range(N)]\n for _ in range(M):\n A, B = map(int, input().split())\n\n if HN[A - 1] < HN[B - 1]:\n temp[A - 1] = False\n if HN[B - 1] < HN[A - 1]:\n tem... | ['Wrong Answer', 'Accepted'] | ['s945314881', 's114054438'] | [20036.0, 20120.0] | [247.0, 237.0] | [451, 453] |
p02689 | u416779002 | 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()))\nalllist = []\nnotwinner = []\nfor i in range(M):\n ab = list(map(int,input().split()))\n if H[ab[0]-1] > H[ab[1]-1]:\n notwinner.append(ab[1])\n elif H[ab[0]-1] < H[ab[1]-1]:\n notwinner.append(ab[0])\n else:\n notwin... | ['Wrong Answer', 'Accepted'] | ['s961728593', 's199221593'] | [20124.0, 20120.0] | [264.0, 268.0] | [395, 459] |
p02689 | u418199806 | 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 = []\nfor i in range(M):\n A, B = map(int, input().split())\n ans = [max(H[A-1], H[B-1]) if i == H[A-1] else i for i in ans]\n ans = [max(H[A-1], H[B-1]) if i == H[B-1] else i for i in ans]\n ans.append(max(H[A-1], H[B-1])) \npri... | ['Wrong Answer', 'Accepted'] | ['s214820597', 's830570999'] | [20148.0, 20032.0] | [2206.0, 253.0] | [348, 247] |
p02689 | u433380437 | 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\nn,m = map(int,input().split())\nh=list(map(int,input().split()))\ng = [[] for _ in range(n)]\nfor _ in range(m):\n a,b = map(int,input().split())\n a-=1\n b-=1\n g[a].append(b)\n g[b].append(a)\nans=0\nfor j in range(n):\n for i in g[j]:\n if h[j]<=h[i]:\n ... | ['Wrong Answer', 'Accepted'] | ['s085687893', 's010639416'] | [29864.0, 29648.0] | [379.0, 365.0] | [368, 351] |
p02689 | u434296044 | 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()))\nt=[0]*N\nfor i in range(M):\n A,B=map(int,input().split())\n t[A-1] = max(t[A-1], H[B-1])\n t[B-1] = max(t[B-1], H[A-1])\n\nct=0\nfor j in range(N):\n if H[j]>[j]:\n ct+=1\nprint(ct)\n', 'N,M=map(int,input().split())\nh=list(map(int,... | ['Runtime Error', 'Accepted'] | ['s687230786', 's423196370'] | [20136.0, 20152.0] | [45.0, 317.0] | [255, 255] |
p02689 | u436660228 | 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... | ['total_tenb,total_load=map(int,input().split())\nhight=[]\ngood_tenb=[]\nfor i in range(total_tenb):\n a=int(input())\n hight.append(a)\n good_tenb.append(a)\n \ndef kuraberu(A,B):\n if hight[A]>hight[B]:\n good_tenb.append(height[A])\n good_tenb.del(height[B])\n elif hight[A]<hight[B]:\n good_tenb.appe... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s167461799', 's372399774', 's819640898', 's853030336', 's950238735', 's953109886', 's906297640'] | [8980.0, 10904.0, 10904.0, 20968.0, 9040.0, 10996.0, 20144.0] | [23.0, 24.0, 24.0, 48.0, 25.0, 31.0, 265.0] | [487, 311, 304, 460, 309, 476, 310] |
p02689 | u436721750 | 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())\nS=np.zeros((N,N))\nH=list(map(int,input().split()))\n\nfor j in range(M):\n a,b=map(int,input().split())\n \n if H[a-1]<H[b-1]:\n S[a-1,b-1]=-1\n S[b-1,a-1]=1\n elif H[a-1]>H[b-1]:\n S[a-1,b-1]=1\n S[b-1,a-1]=-1\n else:\n S[a-1,b-1]=-1\n S[b-1,a... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s194737423', 's448086226', 's482579939', 's352221654'] | [27268.0, 9012.0, 27260.0, 39124.0] | [115.0, 20.0, 95.0, 339.0] | [419, 414, 424, 274] |
p02689 | u437351386 | 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()))\nsum=0 \ndp=[float("INF") for i in range(n)]\nfor i in range(m):\n a,b=list(map(int,input().split()))\n if h[a-1]<h[b-1] and dp[b-1]==float("INF"):\n sum=sum+1\n dp[a-1]=0\n elif h[b-1]<h[a-1] and dp[a-1]==float("INF"):\n sum... | ['Wrong Answer', 'Accepted'] | ['s810778414', 's910344608'] | [19988.0, 20052.0] | [357.0, 315.0] | [344, 347] |
p02689 | u438189153 | 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()))\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])\nres=sum([H[i]>A[i] for i in range(N)])\nprint(res)\n', 'N,M=map(int,input().split())\nhigh=list(map(int,input().split()))\nA=[... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s054719134', 's847726185', 's770647769'] | [20012.0, 20112.0, 19972.0] | [48.0, 50.0, 321.0] | [235, 233, 232] |
p02689 | u443854804 | 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())\nList=list(map(int,input().split()))\ns=[]\n\nfor i in range(m):\n a,b=list(map(int,input().split()))\n if List[a-1]>List[b-1]:\n s.append(b)\n elif List[a-1]<List[b-1]:\n s.append(a)\n else:\n s.append(a)\n s.append(b)\n \n\nprint(s)\nt=set(s) ... | ['Wrong Answer', 'Accepted'] | ['s906881904', 's323667168'] | [20528.0, 20088.0] | [278.0, 282.0] | [329, 318] |
p02689 | u444481227 | 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())\nheight=[int(x) for x in input().split()]\nnlist=[1]*N\nprint(nlist)\n\nfor _ in range(M):\n a, b =(int(x) for x in input().split())\n a-=1\n b-=1\n if height[a]<height[b]:\n nlist[a]=0\n\n if height[b]<height[a]:\n nlist[b]=0\n print(nlist)\n\np... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s189500364', 's968803270', 's971973865', 's157630333'] | [122896.0, 20020.0, 122876.0, 20092.0] | [2378.0, 2206.0, 2356.0, 271.0] | [318, 339, 318, 290] |
p02689 | u446808186 | 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\npair=[]\nfor _ in range(M):\n inp=list(map(int,input().split()))\n pair.append(inp)\n\nloser=[]\nfor i in range(M):\n if h[pair[i][0]]<h[pair[i][1]]:\n loser.append(pair[i][0])\n elif h[pair[i][0]]>h[pair[i][1]]:\n loser.appen... | ['Runtime Error', 'Accepted'] | ['s882581978', 's049175216'] | [34676.0, 34520.0] | [324.0, 345.0] | [453, 461] |
p02689 | u447456419 | 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, b = map(float, input().split())\na = int(a)\nb_int = b*100\n\nans = a*b_int/100\nans = int(ans)\nprint(ans)\n', 'n,m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for i in range(m)]\n\ngood = [1]*n\n\nfor comb in ab:\n a = comb[0]-1\n b = comb[1]-1\n ... | ['Wrong Answer', 'Accepted'] | ['s464960721', 's122138510'] | [9008.0, 31960.0] | [29.0, 307.0] | [105, 301] |
p02689 | u447899880 | 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()))\nresult=list(range(n))\nfor i in range(m):\n a,b =map(int,input().split())\n a-=1\n b-=1\n if h[a]>h[b]:\n if b in result:\n del result[b]\n elif h[a]<h[b]:\n if a in result:\n del result[a]\n else:\n... | ['Runtime Error', 'Accepted'] | ['s061926816', 's528582283'] | [20024.0, 20072.0] | [1790.0, 256.0] | [454, 325] |
p02689 | u449580152 | 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()))\ns = [[0]]*m\n \nfor _ in range(m):\n a, b = map(int, input().split())\n s[a-1].append(H[b-1])\n s[b-1].append(H[a-1])\n \nc = 0\nfor j in range(n):\n if H[j] > max(s[j]):\n c+= 1\n \nprint(c) \n', 'n, m = map(int, input().split(... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s005587724', 's032814259', 's268035203', 's375954930', 's413070712', 's434789407', 's601847856', 's608207625', 's674200564', 's232289075'] | [19976.0, 9008.0, 8912.0, 19912.0, 20064.0, 20056.0, 9068.0, 20072.0, 9060.0, 26048.0] | [2206.0, 22.0, 22.0, 2206.0, 2206.0, 2206.0, 21.0, 2206.0, 22.0, 379.0] | [269, 472, 444, 269, 267, 299, 448, 262, 279, 277] |
p02689 | u451206510 | 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 = [[] for i in range(N+1)]\nfor i in range(N+1):\n A[i].append(H[i-1])\nfor i in range(M):\n a,b = map(int, input().split())\n A[a].append(H[b-1])\n A[b].append(H[a-1])\n\nans = 0\nfor i in range(1,N+1):\n print(A[i])\n if max... | ['Wrong Answer', 'Accepted'] | ['s492969412', 's436431469'] | [27880.0, 24120.0] | [527.0, 398.0] | [417, 364] |
p02689 | u452512115 | 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\nAB = [tuple(map(int, input().split())) for i in range(M)]\n\ngraph = [[] for _ in range(N)]\n\nfor a, b in AB:\n a, b = a-1, b-1\n graph[a].append(b)\n graph[b].append(a)\n\n ans = 0\n\nfor i, h in enumerate(H):\n for to in graph[i]:\n ... | ['Wrong Answer', 'Accepted'] | ['s632816549', 's994432677'] | [42868.0, 29416.0] | [382.0, 360.0] | [370, 458] |
p02689 | u453623947 | 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 = [input().split() for i in range(m)]\n\nlist = [0]*n\nfor j in range(m):\n if h[int(l[j][0])-1] > h[int(l[j][1])-1]:\n list[int(l[j][1])-1] -= 1\n elif h[int(l[j][0])-1] < h[int(l[j][1])-1]:\n list[int(l[j][0])-1] -= 1\n el... | ['Wrong Answer', 'Accepted'] | ['s374629784', 's840596575'] | [43892.0, 43172.0] | [343.0, 368.0] | [414, 402] |
p02689 | u455957070 | 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())\nA = []\nB = []\nans = 0\nH = list(map(int,input().split()))\nfor i in range(m-1):\n a, b = map(int, input().split())\n A.append(int(a))\n B.append(int(b))\nfor i in range(m-1):\n if H[(A[i])-1] < H[(B[i])-1]:\n ans += 1\nfor i in range(m-1):\n if A.count(i) == 0 and B.co... | ['Wrong Answer', 'Accepted'] | ['s971203850', 's980299665'] | [22508.0, 20104.0] | [2206.0, 276.0] | [438, 323] |
p02689 | u461833298 | 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(x) for x in input().split()]\nAB = [[int(x) for x in input().split()] for _ in range(M)]\n\nli = [0] + [-1] * N\nfor a, b in AB:\n ma = max(H[a-1], H[b-1])\n if ma==H[a-1]:\n li[b]=-4\n# elif ma==H[b-1]:\n# li[a]=-4\n else:\n li[a]=-4\n ... | ['Wrong Answer', 'Accepted'] | ['s215299121', 's211034664'] | [31136.0, 31284.0] | [323.0, 292.0] | [552, 691] |
p02689 | u469281291 | 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 math\n\nn, m = map(int, input().split())\nh = list(map(int, input().split()))\nma = [0] * n\nfor i in range(m):\n a, b = map(int, input().split())\n ma[a - 1] = max(ma[a-1],h[b - 1])\n ma[b - 1] = max(ma[b-1] ,h[a - 1])\ncnt = 0\nprint(ma)\nprint(h)\nfor i in range(n):\n if h[i] > ma[i]... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s739217319', 's945843841', 's976165770', 's902198414'] | [20100.0, 20012.0, 20028.0, 20120.0] | [348.0, 362.0, 266.0, 317.0] | [334, 343, 266, 315] |
p02689 | u471503862 | 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())\nO = list(map(int, input().split()))\nB = [[] for i in range(N)]\n \nfor j in range(M):\n o_1, o_2 = map(int, input().split())\n B[o_1-1].append(o_2-1)\n B[o_2-1].append(o_1-1)\n \nprint(B)\n\nans = 0\nfor node in range(N):\n flag =1\n for l in B[node]:\n if O[node] <= O[l]:\... | ['Wrong Answer', 'Accepted'] | ['s010902460', 's668736520'] | [33356.0, 29344.0] | [454.0, 373.0] | [364, 352] |
p02689 | u473433753 | 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 ai,bi=list(map(int, input("").split()))\n a.append(ai)\n b.append(bi)\nma=0\nout=0\nfor i in range(n):\n ma=h[i]\n q=h[i]\n for j in range(m):\n if i==a[j]-1 or i==b[j]-1:\n ... | ['Wrong Answer', 'Accepted'] | ['s824480535', 's383878140'] | [22536.0, 19988.0] | [2206.0, 286.0] | [515, 270] |
p02689 | u476124554 | 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\narr = [[] for i in range(n)]\nfor i in range(m):\n a,b = map(int,input().split())\n arr[a-1].append(b-1)\n arr[b-1].append(a-1)\n\nfor i in range(len(h)):\n tmph = h[i]\n flg = 1\n if arr[i]:\n for j in arr[i]:\n ... | ['Wrong Answer', 'Accepted'] | ['s243149235', 's748979499'] | [29552.0, 29348.0] | [390.0, 366.0] | [435, 418] |
p02689 | u479612543 | 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 = {}\nfor k, v in zip(range(1,n+1),[k for k in map(int, input().split())]):\n h[k] = v \n\nmiti = []\nfor i in range(m):\n temp = [k for k in map(int, input().split())]\n miti.append(temp)\n\nx = np.zeros(n)\n\nfor i in range(m):\n if h[miti[i][0]] < h[miti[i][1]]:\n ... | ['Runtime Error', 'Accepted'] | ['s229498634', 's345398117'] | [37984.0, 56248.0] | [267.0, 629.0] | [515, 535] |
p02689 | u481550011 | 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()))\ngood=[True]*N\nfor i in range(M):\n A,B=map(int,input().split())\n if H[A-1]>H[B-1]:\n print("A")\n good[B-1]=False\n elif H[B-1]>H[A-1]:\n good[A-1]=False\n else:\n good[A-1],good[B-1]=False,False\nans=0\nfor i in... | ['Wrong Answer', 'Accepted'] | ['s805788864', 's612643034'] | [20128.0, 20044.0] | [423.0, 260.0] | [354, 334] |
p02689 | u483298903 | 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())\nlist = []\nfor i in range(M):\n if H[A[i]-1]>=H[B[i]-1]:\n list.append(B[i])\n elif H[A[i]-1]<=H[B[i]-1]:\n list.append(A[i])\nprint("N:{} M:{} H:{} list:{} set(lis... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s539731282', 's691988165', 's077026150'] | [27028.0, 27168.0, 24372.0] | [305.0, 296.0, 283.0] | [366, 345, 365] |
p02689 | u490553751 | 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... | ['#template\ndef inputlist(): return [int(k) for k in input().split()]\n#template\nN,M = inputlist()\nH = inputlist()\ngraph = [[] for _ in range(N)]\nprint(graph)\n\nfor i in range(M):\n A,B = inputlist()\n A -=1\n B -=1\n graph[A].append(B)\n graph[B].append(A)\nans = 0\nfor i in range(N):\n h = H[i... | ['Wrong Answer', 'Accepted'] | ['s969368497', 's997359365'] | [30204.0, 29576.0] | [446.0, 452.0] | [402, 389] |
p02689 | u496018856 | 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... | ['input1 = input().rstrip().split(" ")\nh = input().rstrip().split(" ")\nyoi = [1 for i in range(int(input1[0]))]\n\n# print(h)map(int, input().split())\nroot = [input().rstrip().split(" ") for i in range(int(input1[1]))]\n\n\nprint(int(root[0][1]))\nfor i in range(int(input1[1])):\n a=int(root[i][0])-1\n b=int(... | ['Wrong Answer', 'Accepted'] | ['s518478154', 's353353601'] | [46812.0, 19972.0] | [308.0, 258.0] | [744, 281] |
p02689 | u497805118 | 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\ncandidates = {}\nfor i in range(m):\n x, y = map(int, input().split(" "))\n\n if h[x - 1] <= h[y -1]:\n candidates[x] = False\n if h[x - 1] >= h[y -1]:\n candidates[y] = False\n print(x, y , candidates)\n\nans = 0... | ['Runtime Error', 'Accepted'] | ['s781845339', 's163273391'] | [142000.0, 20116.0] | [1750.0, 288.0] | [420, 391] |
p02689 | u502508885 | 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\nh = list(map(int, input().split()))\nprint(h)\n\nyoi_warui = [0]*(n)\ndokuritsu = [0]*(n)\n\nfor i in range(m):\n a, b = list(map(int, input().split()))\n dokuritsu[a-1] = 1\n dokuritsu[b-1] = 1\n if h[a-1] < h[b-1]:\n yoi_warui[a-1] = 1\n elif h[b-1] < ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s564197372', 's902927667', 's478449539'] | [20036.0, 20140.0, 19968.0] | [305.0, 320.0, 330.0] | [386, 470, 435] |
p02689 | u508426820 | 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 = [0] + list(map(int, input().split()))\nkouho = [i + 1 for i in range(N)]\nfor i in range(M):\n a, b = map(int, input(),split())\n if H[a] > H[b] and b in kouho:\n kouho.remove(b)\n elif H[a] < H[b] and a in kouho:\n kouho.remove(a)\n elif H[a] == H[b]:\n... | ['Runtime Error', 'Accepted'] | ['s709901981', 's740079508'] | [19964.0, 26924.0] | [48.0, 302.0] | [428, 328] |
p02689 | u512212329 | 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(x) for x in input().split()]\n heights = tuple(int(x) for x in input().split())\n adjacents_heights = [set() for _ in range(n)]\n print(heights)\n for i in range(m):\n a, b = [int(x) - 1 for x in input().split()]\n adjacents_heights[a].add(heights[b])\n ad... | ['Wrong Answer', 'Accepted'] | ['s924512652', 's003697698'] | [45184.0, 20048.0] | [503.0, 234.0] | [610, 498] |
p02689 | u515052479 | 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\n\n#seen = np.zeros((n,n))\n\n\n# a,b = map(int,input().split())\n\n\n \nans = 0\n\n\n# temp_1 = np.max(temp)\n# if (h[i] > temp_1) and (temp_1 != 0):\n# ans += 1\n# elif temp_1 == 0:\n# ans += 1\n \npri... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s369926092', 's388974520', 's426819143', 's629709238', 's690989158', 's384921593'] | [38616.0, 38376.0, 38352.0, 38416.0, 38280.0, 38468.0] | [135.0, 133.0, 128.0, 130.0, 133.0, 345.0] | [432, 423, 426, 421, 430, 330] |
p02689 | u517910772 | 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 c():\n N, M = map(int, input().split())\n \n H = list(map(int, input().split()))\n\n \n G = {}\n for i in range(M):\n A, B = map(int, input().split())\n G[A-1] = max(G.get(A-1, 0), H[B-1])\n G[B-1] = max(G.get(B-1, 0), H[A-1])\n cnt = 0\n print(G)\n for j in range(N... | ['Wrong Answer', 'Accepted'] | ['s984008667', 's245129094'] | [21144.0, 20092.0] | [395.0, 340.0] | [492, 532] |
p02689 | u518242261 | 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\nN_addj = [[] for i in range(N)]\n\nfor i in range(M):\n AB = list(map(int, input().split()))\n N_addj[AB[0]-1].append(AB[1]-1)\n N_addj[AB[1]-1].append(AB[0]-1)\n\n\nN_memo = [0] * N\n\nnum = 0\n\n\narr = []\n\nprint(H)\n\n\nfor i in ... | ['Wrong Answer', 'Accepted'] | ['s393653257', 's672022814'] | [33388.0, 30240.0] | [401.0, 419.0] | [463, 453] |
p02689 | u519123891 | 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... | ['# input\ninp_ls = input().split(" ")\nn,m = [int(e) for e in inp_ls[:2]]\nh_ls = [int(e) for e in input().split(" ")[:n]]\n\n# calc\nraw_obs_dic = {i+1: [] for i in range(n)}\nfor i in range(m):\n\ta,b = [int(e) for e in input().split(" ")[:2]]\n\traw_obs_dic[a].append(b)\n\traw_obs_dic[b].append(a)\n\n\nobs_dic = {k... | ['Wrong Answer', 'Accepted'] | ['s842968441', 's753677990'] | [55584.0, 55480.0] | [687.0, 562.0] | [661, 665] |
p02689 | u520843951 | 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\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] - ... | ['Runtime Error', 'Accepted'] | ['s237558659', 's289161936'] | [20120.0, 67796.0] | [44.0, 449.0] | [391, 391] |
p02689 | u522937309 | 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()) \nlist_h=list(map(int, input().split())) \n\na = []\nfor i in range(m):\n ai = list(map(int, input().split())) \n a.append(ai)\n\nbooler = [True] * n\nfor i in range(n):\n a_copy = copy.deepcopy(a)\n for j in range(m):\n if i in a_copy[j] :\n a_copy[j... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s799037042', 's883359698', 's394988560'] | [31888.0, 9176.0, 50484.0] | [253.0, 21.0, 466.0] | [613, 181, 595] |
p02689 | u531456543 | 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())\nilst = [int(i) for i in input().split()]\ntlst = [0]*n\ntotal = 0\nfor i in range(m):\n List = [int(j) for j in input().split()]\n print(List)\n xlst = []\n for p in List:\n xlst.append(ilst[p-1])\n print(xlst)\n maxIndex = [i for i, x in enumerate(xlst) if x == ... | ['Wrong Answer', 'Accepted'] | ['s495748580', 's857729700'] | [20164.0, 20140.0] | [790.0, 358.0] | [563, 511] |
p02689 | u531599639 | 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()]\nroads = [list(map(int, input().split())) for _ in range(N)]\nalone=[]\nans={}\nb_list=[]\nfor i in range(1, N+1):\n alone.append(i)\nfor road in roads:\n if max(road) not in b_list:\n ans[max(road)]='Yes'\n b_list.append(min(road))\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s005127076', 's969230781', 's189859893'] | [36320.0, 36288.0, 20016.0] | [2206.0, 2206.0, 252.0] | [435, 436, 212] |
p02689 | u532966492 | 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 wxyz = [list(map(int, input().split())) for _ in [0]*m]\n\n class unionfind():\n \n def __init__(self, size): \n self.size = size\n self.tree_root = list(range(self.size))\n self.tree_depth = [1]*self.size\n\n ... | ['Runtime Error', 'Accepted'] | ['s952480898', 's786063809'] | [41432.0, 49080.0] | [245.0, 384.0] | [1853, 440] |
p02689 | u534308356 | 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 = list(map(int, input().split()))\ndata = []\nfor _ in range(m):\n data.append( list(map(int, input().split())) )\n\nans_list = [1 for _ in range(n)]\n\nfor d in data:\n \n d_0 = d[0] - 1\n d_1 = d[1] - 1\n\n if h_list[d_0] == h_list[d_1]:\n ans_list[d_... | ['Wrong Answer', 'Accepted'] | ['s514007002', 's906343403'] | [33008.0, 31932.0] | [345.0, 331.0] | [526, 528] |
p02689 | u536034761 | 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(" "))\nflag = [1 for i in range(M)]\nheight = list(map(int, input().split(" ")))\nfor i in range(M):\n a, b = map(int, input().split(" "))\n if height[a - 1] < height[b - 1]:\n flag[a - 1] = 0\n elif height[a - 1] > height[b - 1]:\n flag[b - 1] = 0\n else:\n flag[a - 1] = 0\... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s175341571', 's385317253', 's476352702', 's512932518'] | [20764.0, 20756.0, 17100.0, 20800.0] | [255.0, 260.0, 33.0, 252.0] | [344, 338, 300, 344] |
p02689 | u538817603 | 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 main():\n N, M = map(int, input().split())\n V = [True] * N\n H = [int(v) for v in input().split()]\n AB = [[map(int, input().split())] for _ in range(M)]\n for ab in AB:\n a, b = ab\n a-=1\n b-=1\n # if V[a] or V[b]:\n if... | ['Runtime Error', 'Accepted'] | ['s234876689', 's324926158'] | [65724.0, 30340.0] | [346.0, 171.0] | [451, 445] |
p02689 | u539969758 | 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()))\nmichi = [[] for i in range(N)]\n \nfor i in range(M):\n a,b = map(int,input().split())\n michi[a-1].append(b-1)\n michi[b-1].append(a-1)\n\n \nans = 0\nfor i in range(N): \n if michi[i] == []:\n print(i)\n ans +=1\n else... | ['Wrong Answer', 'Accepted'] | ['s223281663', 's134512444'] | [29632.0, 29436.0] | [381.0, 370.0] | [612, 754] |
p02689 | u542190960 | 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 math\n\nx = int(input())\n\nend = math.floor(x**0.2)\n\nfor i in range(1, x+1):\n if x % i == 0:\n for a in range(i//2,end,1):\n b = a - i\n if a**5 - b**5 == x:\n print(a, b)\n break', 'n, m = map(int, input().split())\n \nh_list = list(map(int,inp... | ['Runtime Error', 'Accepted'] | ['s778179990', 's728251740'] | [9196.0, 34584.0] | [27.0, 330.0] | [240, 496] |
p02689 | u543000780 | 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()))\nadj_max = [0]*N\nans = 0\nfor _ in range(M):\n tmp1, tmp2 = map(int, input().split())\n adj_max[tmp1] = max(adj_max[tmp1], H[tmp2])\n adj_max[tmp2] = max(adj_max[tmp2], H[tmp1])\nfor num in range(N):\n if H[num] > adj_max[num]:\n ans += 1\n... | ['Runtime Error', 'Accepted'] | ['s048110741', 's538852957'] | [20124.0, 20120.0] | [308.0, 328.0] | [317, 331] |
p02689 | u547375079 | 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 \ngood = [True] * N\nfor m in range(0, M):\n A, B = map(int, input().split())\n if heights[A] > heights[B]:\n good[B] = False\n elif heights[A] < heights[B]:\n good[A] = False\n \ncount = 0\nfor obs in good:\n if obs: count += ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s166667294', 's256997200', 's602769784', 's070654954'] | [20028.0, 8984.0, 20152.0, 20112.0] | [241.0, 22.0, 46.0, 325.0] | [325, 278, 334, 346] |
p02689 | u548545174 | 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\nneighbor_max_heights = [0] * N\n\nfor i in range(M):\n a, b = AB[i]\n neighbor_max_heights[b-1] = max(neighbor_max_heights[b-1], H[a-1])\n neighbor_max_heights[a-1] = max(neighbor_ma... | ['Runtime Error', 'Accepted'] | ['s051066438', 's256759603'] | [10864.0, 32032.0] | [23.0, 388.0] | [431, 435] |
p02689 | u549494450 | 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(" ")\nh = input().split(" ")\nc = {}\nfor j in range(int(a[0])):\n c[str(j+1)] = [int(h[j]),"good"]\nb = []\ngood = int(a[0])\nfor i in range(int(a[1])):\n d = input().split()\n x = int(c[d[0]][0])\n y = int(c[d[1]][0])\n if x > y:\n c[d[1]][1] = "bad"\n if y > x:\n c... | ['Wrong Answer', 'Accepted'] | ['s206412416', 's265407758'] | [47480.0, 40612.0] | [520.0, 459.0] | [501, 492] |
p02689 | u551437236 | 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\nmin = []\nfor i in range(m):\n a, b = map(int, input().split())\n if h[a] < h[b]:\n min.append(a)\n if h[a] == h[b]:\n min.append(a)\n min.append(b)\n if h[a] > h[b]:\n min.append(b)\n\nprint(len(h)-len(set... | ['Runtime Error', 'Accepted'] | ['s134135886', 's281548274'] | [20116.0, 20112.0] | [245.0, 281.0] | [312, 324] |
p02689 | u552533086 | 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())\nheight = list(map(int, input().split()))\nroad = {}\n\n\nfor i in range(K):\n a, b = list(map(int, input().split()))\n try:\n road[a-1].append(b-1)\n except:\n road[a-1] = [b-1]\n try:\n road[b-1].append(a-1)\n except:\n road[b-1] = [... | ['Runtime Error', 'Accepted'] | ['s003909606', 's860420228'] | [34460.0, 34776.0] | [477.0, 453.0] | [550, 553] |
p02689 | u552741877 | 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_a = list(map(int, input().split()))\n\nm_l = [[0,0]]*m\nr_l = [{}]*n\nfor i in range(m):\n r = list(map(int, input().split()))\n a = r[0] - 1\n b = r[1] - 1\n\n ral = set([]) if len(r_l[a]) == 0 else r_l[a]\n rbl = set([]) if len(r_l[b]) == 0 else r_l[b]\n\n ral.add(b)\n rbl.... | ['Wrong Answer', 'Accepted'] | ['s155962355', 's912394538'] | [46952.0, 43088.0] | [563.0, 505.0] | [470, 459] |
p02689 | u557750361 | 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 H = list(map(int, input().split()))\n LIST = [ 1 for _ in range(N)]\n for _ in range(M):\n A, B = map(int, input().split())\n if H[A-1] >= H[B-1]: LIST[B-1] = 0\n if H[A-1] <= H[B-1]: LIST[A-1] = 0\n print(sum(LIST))\n', 'n, m = map(int, input().... | ['Runtime Error', 'Accepted'] | ['s672131723', 's124098222'] | [8952.0, 20112.0] | [20.0, 259.0] | [282, 332] |
p02689 | u558242240 | 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... | ['class UnionFind:\n def __init__(self, n):\n self.root = list(range(n))\n self.size = [1] * (n)\n self.maxh = [0] * (n)\n def find_root(self, x):\n root = self.root\n while root[x] != x:\n root[x] = root[root[x]]\n x = root[x]\n return x\n\n def ... | ['Wrong Answer', 'Accepted'] | ['s609076417', 's068611165'] | [20208.0, 29436.0] | [441.0, 406.0] | [1181, 374] |
p02689 | u561862393 | 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\nimport numpy as np\n\nn, m = map(int, input().split())\n\nT_Height = [int(h) for h in input().split()]\n\nRoads = [[0] * n for _ in range(n)]\n\nfor i in range(m):\n a, b = map(int, input().split())\n Roads[a-1][b-1] = T_Height[b-1]\n Roads[b-1][a-1] = T_Height[a-1]\n\... | ['Wrong Answer', 'Accepted'] | ['s712498668', 's423927144'] | [2157876.0, 38664.0] | [2266.0, 273.0] | [433, 453] |
p02689 | u562400059 | 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()))\n\nAB = [[]] * N\n\nfor i in range(M):\n A, B = list(map(int, input().split()))\n tmp = copy.deepcopy(AB[A-1])\n tmp.append(B-1)\n AB[A-1] = tmp\n tmp = copy.deepcopy(AB[B-1])\n tmp.append(A-1)\n AB[B-1] = tmp\n\... | ['Wrong Answer', 'Accepted'] | ['s864846127', 's748223084'] | [32548.0, 20112.0] | [2206.0, 279.0] | [457, 269] |
p02689 | u563838154 | 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(map(int,input().split())) for j in range(m)]\n# print("h:",h)\n# print("a",a)\ncan_go = [[] for i in range(n)]\n# print(can_go)\nfor i in a:\n # print(i)\n can_go[i[0]-1].append(i[1])\n can_go[i[1]-1].append(i[0])\n# print(can_go)\nb... | ['Wrong Answer', 'Accepted'] | ['s041591592', 's369484813'] | [41336.0, 41248.0] | [435.0, 449.0] | [579, 574] |
p02689 | u567430603 | 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()))\nng_peaks = set([])\nfor j in range(M):\n A_j, B_j = map(int, input().split())\n if peaks[A_j-1] >= peaks[B_j-1]:\n ng_peaks.add(B_j)\n if peaks[A_j-1] =< peaks[B_j-1]:\n ng_peaks.add(A_j)\nprint(N-len(ng_peaks))', 'N, M ... | ['Runtime Error', 'Accepted'] | ['s728304979', 's511420071'] | [9040.0, 20100.0] | [22.0, 278.0] | [300, 300] |
p02689 | u568559987 | 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(map(int,input().split()))\nx=[[] for _ in range(n+1)]\nfor i in range(m):\n a,b=map(int,input().split())\n x[a].append(h[b-1])\n x[b].append(h[a-1])\ncount=0\nfor j in range(1,n+1):\n if x[j]==[]:\n count+=1\n else:\n if h[j-1]>max(x[j]):\n count+=1\nprint(count)\n ', 'n,m=map(int,input().spli... | ['Runtime Error', 'Accepted'] | ['s003086174', 's712020725'] | [9152.0, 22840.0] | [28.0, 366.0] | [276, 302] |
p02689 | u570155187 | 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\ng = [[] for _ in range(n)]\nfor _ in range(m):\n a,b = map(int,input().split())\n g[a-1].append(b-1)\n g[b-1].append(a-1)\nprint(g)\n\ncnt = n\nfor i in range(n):\n for j in g[i]:\n if h[i] <= h[j]:\n cnt -= 1\n break\nprint(cnt)',... | ['Wrong Answer', 'Accepted'] | ['s272980515', 's708418112'] | [33348.0, 29316.0] | [388.0, 379.0] | [300, 291] |
p02689 | u580273604 | 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... | ['4 3\n1 2 3 4\n1 3\n2 3\n2 4', 'N,M=map(int,input().split())\nH=list(map(int,input().split()))\nA=[0]*M;B=[0]*M\nC=[0]*N\nfor i in range(M):\n A[i],B[i]=map(int,input().split())\n\nfor i in range(M):\n if H[A[i]-1]<H[B[i]-1]:C[A[i]-1]+=1\n elif H[A[i]-1]>H[B[i]-1]:C[B[i]-1]+=1\n else:C[A[i]-1]+=1;C[B[i]-1]+=1\npri... | ['Runtime Error', 'Accepted'] | ['s734405360', 's966009739'] | [8900.0, 21764.0] | [24.0, 273.0] | [23, 290] |
p02689 | u586639900 | 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()))\nconditions = [[] for _ in range(N)]\nfor i in range(M):\n a, b = map(int, input().split())\n \n \n conditions[a - 1].append(b - 1)\n conditions[b - 1].append(a - 1)\n\nbad_count = [1] * N\nfor i, cond in enumerate(conditions):\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s450749896', 's749204843', 's684568637'] | [30156.0, 30184.0, 19980.0] | [428.0, 421.0, 260.0] | [599, 598, 271] |
p02689 | u586662847 | 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\n\ndef resolve():\n N, M = map(int, input().split())\n H = list(map(int, input().split()))\n\n A = np.zeros((N, N))\n for i in range(M):\n pp, ss = map(int, input().split())\n ss -= 1\n pp -= 1\n A[pp][ss] = H[ss]\n A[ss][pp] = H[pp]\n\n ans = 0\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s338192476', 's799877414', 's607437928'] | [38532.0, 38468.0, 22988.0] | [132.0, 127.0, 321.0] | [314, 433, 421] |
p02689 | u589047182 | 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())\nans_list = list(range(1,N))\nHList = list(map(int, input().split()))\nrootList = []\n\nfor i in range(M):\n a, b = map(int, input().split())\n H_a = HList[a-1]\n H_b = HList[b-1]\n if(a in ans_list):\n if(H_b > H_a or H_b == H_a):\n ans_list.remove(a)\n if(b in ans_list)... | ['Wrong Answer', 'Accepted'] | ['s236475065', 's126946089'] | [24280.0, 30112.0] | [2206.0, 322.0] | [388, 492] |
p02689 | u591734860 | 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 make_heights_list(height):\n return [height, True]\n\n\ntower_len, roads_len = map(int, input().split(' '))\n\nheights = [[0, False]]\nheights += (list(map(make_heights_list, input().split(' '))))\n\nprint(heights)\n\n\nroads_highest = list()\nfor i in range(roads_len):\n start, end = map(int, input().split... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s097173712', 's951341834', 's993986785'] | [30364.0, 28044.0, 27940.0] | [596.0, 349.0, 320.0] | [787, 810, 811] |
p02689 | u592601397 | 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... | ['#ABC166\nN,M=map(int,input().split())\nH =list(map(int,input().split())) \nA = list(range(N))\nfor i in range(M):\n a, b = map(int, input().split())\n if H[a-1] > H[b-1]:\n A[b-1] = 0\n elif H[a-1] < H[b-1]:\n A[a-1] = 0\n else:\n A[a-1] = 0 and A[b-1] = 0\n\nprint(N-A.count(0))', '#... | ['Runtime Error', 'Accepted'] | ['s593407019', 's888492630'] | [9132.0, 20076.0] | [31.0, 257.0] | [319, 326] |
p02689 | u594956556 | 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\ngooddict={i:1 for i in 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 gooddict[a]=0\n if h[a-1]>=h[b-1]:\n gooddict[b]=0\n\ncount=0\nfor i in range(1,n+1):\n if gooddict[i]==1:\n count+=1\nprint... | ['Wrong Answer', 'Accepted'] | ['s132345903', 's102272481'] | [24592.0, 24544.0] | [323.0, 333.0] | [325, 309] |
p02689 | u595375942 | 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 = dict()\nfor i in range(1, N+1):\n G[i] = [0]\n\nfor _ in range(M):\n A, B = map(int, input().split())\n G[A] += [B]\n G[B] += [A]\n\ncnt = 0\nfor i in range(1, N+1):\n flag = False\n if len(G[i]) > 1:\n for j in G[i]:\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s869271668', 's912406893', 's969419558'] | [41092.0, 40864.0, 41044.0] | [447.0, 484.0, 478.0] | [504, 508, 552] |
p02689 | u596681540 | 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 = input().split()\nans = [1] * N\n\nprint(H)\nfor i in range(M):\n a, b = map(int, input().split())\n AH = int(H[a - 1])\n BH = int(H[b - 1])\n if AH >= BH:\n ans[b - 1] = 0\n elif BH >= AH:\n ans[a - 1] = 0\n\n\nprint(ans.count(1))\n', "import numpy as... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s070457038', 's198356294', 's312790843', 's488652900', 's835577195', 's957229809'] | [20312.0, 73700.0, 79080.0, 73520.0, 73672.0, 46760.0] | [578.0, 2208.0, 573.0, 540.0, 549.0, 412.0] | [283, 1275, 855, 1287, 1135, 346] |
p02689 | u600261652 | 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 resolve():\n N, M = map(int, input().split())\n H = list(map(int, input().split()))\n A = []\n B = []\n ans = 0\n for _ in range(M):\n a, b = map(int, input().split())\n A.append(a-1)\n B.append(b-1)\n while len(set(H)) != 0:\n v = H.index(max(H))+1\n for i ... | ['Time Limit Exceeded', 'Accepted'] | ['s930045341', 's349668328'] | [28704.0, 20012.0] | [2206.0, 299.0] | [491, 329] |
p02689 | u602500004 | 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 math\nimport numpy as np\nimport sys\nimport os\nfrom operator import mul\nfrom operator import itemgetter\n\nsys.setrecursionlimit(10**7)\n\ndef _S(): return sys.stdin.readline().rstrip()\ndef I(): return int(_S())\ndef LS(): return list(_S().split())\ndef LI(): return list(map(int,LS()))\n\nif os.getenv("LOC... | ['Wrong Answer', 'Accepted'] | ['s543144883', 's044046103'] | [61120.0, 60544.0] | [405.0, 390.0] | [1199, 1201] |
p02689 | u604412462 | 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()))\nq = [1]*1\nfor i in range(m):\n a,b = map(int,input().split())\n if h[a-1] < h[b-1]:\n q[a-1] = 0\n elif h[a-1] > h[b-1]:\n q[b-1] = 0\n else:\n q[a-1] = 0\n q[b-1] = 0\nprint(q.count(1))', 'n,m = map(int,input... | ['Runtime Error', 'Accepted'] | ['s243528001', 's006010231'] | [19972.0, 31912.0] | [40.0, 402.0] | [283, 418] |
p02689 | u605161376 | 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\nlst = [0 for i in range(N)]\n\nfor m in range(M):\n a,b = map(int, input().split())\n a-=1\n b-=1\n if lst[a] > lst[b]:\n lst[b]-=1\n elif lst[a] < lst[b]:\n lst[b]-=1\n\nprint(lst.count(0))', 'N,M = map(int, input().... | ['Wrong Answer', 'Accepted'] | ['s191993095', 's343093457'] | [20064.0, 20112.0] | [242.0, 268.0] | [277, 315] |
p02689 | u607563136 | 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(int,input().split())) for _ in range(m)]\n\n\npoint = [0]*n\napp = [0]*n\ncnt = []\n\nfor i in ab:\n app[i[0]-1] += 1\n app[i[1]-1] += 1\n if h[i[0]-1] > h[i[1]-1]:\n point[i[0]-1] += 1\n elif h[i[0]-1] < h[i[1]-1... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s014290522', 's352860047', 's507884516', 's974567780'] | [37032.0, 31236.0, 8940.0, 35920.0] | [357.0, 2206.0, 26.0, 350.0] | [413, 631, 287, 419] |
p02689 | u609307781 | 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... | ["# C\nimport numpy as np\n\ninp = input().split(' ')\nN, M = int(inp[0]), int(inp[1])\n\ninps = input().split(' ')\nH = np.array([int(inps[i]) for i in range(len(inps))])\nAB = []\nfor i in range(M):\n inps = input().split(' ')\n AB.append(set([int(inps[0]), int(inps[1])]))\n \ndef get_height(els):\n retur... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s173951400', 's217638153', 's906472285', 's347749002'] | [58632.0, 58640.0, 58636.0, 19956.0] | [2207.0, 2207.0, 2207.0, 344.0] | [669, 584, 585, 266] |
p02689 | u609814378 | 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 math\nimport sys\n\nN,M= map(int, input().split())\nH = list(map(int, input().split())) \n\nlis = [0] * N \n\n\nfor _ in range(M):\n A, B = map(int, input().split())\n\n hightA = H[A-1]\n hightB = H[B-1]\n\n if hightA < hightB:\n if lis[B-1] == 0:\n lis[B-1] = 1\n lis[... | ['Wrong Answer', 'Accepted'] | ['s674714258', 's697510031'] | [20132.0, 20028.0] | [280.0, 282.0] | [659, 724] |
p02689 | u613350811 | 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\nG = [1] * N\nfor i in range(M):\n A[i], B[i] = map(int, input().split())\n me = A[i-1]\n t = B[i-1]\n if H[me-1] <= H[t-1]:\n G[me-1] = 0\n\n me = B[i-1]\n t = A[i-1]\n if H[me-1] <= H[t-1]:\n ... | ['Wrong Answer', 'Accepted'] | ['s785789313', 's378079415'] | [21776.0, 21772.0] | [315.0, 302.0] | [339, 327] |
p02689 | u615576660 | 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 = list(map(int,input().split()))\nroad_list = []\n\nfor i in range(M):\n road_list.append(list(map(int,input().split())))\n \nprint(height_list)\nprint(road_list)\nprint(road_list[0])', 'n, m = map(int, input().split())\nhs = list(map(int, input().split()))\n\nedge = ... | ['Wrong Answer', 'Accepted'] | ['s238835132', 's323191295'] | [35056.0, 29428.0] | [300.0, 383.0] | [224, 407] |
p02689 | u616382321 | 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\ncnt = 0\nfor n in range(1,N+1):\n adj = []\n adj.append([n])\n for i in AB:\n if n in i:\n adj.append(i)\n adj = set(sum(adj,[]))\n adj_H = [H[s-1] for s ... | ['Runtime Error', 'Accepted'] | ['s209740166', 's947446662'] | [31220.0, 29464.0] | [279.0, 339.0] | [427, 330] |
p02689 | u619144316 | 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())\nH = list(map(int,input().split()))\ngraph = defaultdict(list)\nfor _ in range(M-1):\n A, B = map(int,input().split())\n graph[A].append(H[B-1])\n graph[B].append(H[A-1])\n\ncnt = 0\nfor i in range(1,N+1):\n t = H[i-1]\n a = max(gra... | ['Runtime Error', 'Accepted'] | ['s204283219', 's827878699'] | [28184.0, 24712.0] | [318.0, 356.0] | [352, 306] |
p02689 | u620238824 | 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(map(int, input().split())) for i in range(M)] 、複数行複数列\n\ngood = []\nbad = []\nfor i in range(M):\n left = H[A[i][0] - 1]\n right = H[A[i][1] - 1]\n if left < right:\n good.append(A[i][1])\n bad.append(A[i][0])\n... | ['Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s229157155', 's230217756', 's400471465', 's789422167', 's937147422', 's138896017'] | [36384.0, 32284.0, 36408.0, 32024.0, 39696.0, 19960.0] | [348.0, 348.0, 2206.0, 319.0, 2207.0, 246.0] | [644, 424, 722, 471, 761, 300] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.