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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02948 | u150664457 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from operator import itemgetter\nimport sys\ninput = sys.stdin.readline\n\nN, M = map(int,input().split()) \nList = [list(map(int,input().split())) for i in range(N)] # [[1,2],[3,4],[5,6]]\n\nList.sort(key=itemgetter(0))\nList_S = [0]\nadd_list = []\n \nresult = 0\np = 0\n\nfor i in range(1, M+1):\n add = 0\n w... | ['Wrong Answer', 'Accepted'] | ['s225091288', 's552213536'] | [50588.0, 28992.0] | [2106.0, 1041.0] | [722, 726] |
p02948 | u150787983 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nN, M = list(map(int, input().split()))\njobs = [[] for _ in range(M)]\n\nfor i in range(N):\n d, r = list(map(int, input().split()))\n if d-1 < M:\n jobs[d-1].append(r)\n\nrewords = 0\nheap = []\n\nfor i in range(M):\n for reword in jobs[i]:\n heapq.heappush(heap, reword)\n i... | ['Wrong Answer', 'Accepted'] | ['s414548910', 's883538011'] | [24508.0, 23752.0] | [598.0, 505.0] | [403, 387] |
p02948 | u155667931 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nN,M = map(int,input().split())\ndic = {}\nfor i in range(N):\n A,B = map(int,input().split())\n if A <= M:\n if dic[A]:\n dic[A].append(B)\n else:\n dic[A] = [B]\n \nans = 0\nplan = heapq()\nfor i in range(1,M+1):\n for w in dic[i]:\n heapq.heappush(plan,-w)\n if len(plan) !=... | ['Runtime Error', 'Accepted'] | ['s877840208', 's721184205'] | [3064.0, 26068.0] | [278.0, 467.0] | [345, 381] |
p02948 | u163320134 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nn,m=map(int,input().split())\narr=[list(map(int,input().split())) for _ in range(n)]\narr2=[[i,0] for i in range(1,m+2)]\narr.extend(arr2)\narr=sorted(arr,reverse=True,key=lambda x:x[1])\nq=[]\nans=0\npos=0\nwhile 1:\n a,b=arr[pos]\n if a>m:\n break\n if a==arr[pos+1][0]:\n heapq.heappush(q,-... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s440263153', 's942276135', 's957599352', 's676853381'] | [42528.0, 42528.0, 44996.0, 43664.0] | [739.0, 687.0, 782.0, 696.0] | [384, 384, 432, 371] |
p02948 | u168333670 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N, M = map(int, input().split())\n\nreward = [[] for _ in range(M)]\n\nfor i in range(N):\n a, b = map(int, input().split())\n\n if a > M:\n continue\n c[m - a].append(b)\n\nimport heapq\n\nh = []\nheapq.heapify(h)\nans = 0\n\nfor i in range(M - 1, -1, -1):\n for b in c[i]:\n heapq.heappush(... | ['Runtime Error', 'Accepted'] | ['s529506142', 's545047836'] | [10288.0, 18428.0] | [271.0, 449.0] | [373, 368] |
p02948 | u169138653 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn,m=map(int,input().split())\nab=[[] for i in range(m)]\nfor i in range(n):\n a,b=map(int,input().split())\n if a<=m:\n ab[a-1].append(-b)\nl=[]\nheapq.heapify(l)\nans=0\nfor i in range(m):\n for j in ab[i]:\n heapq.heappush(l,j)\n if l:\n print(l)\n ans+=-heapq.heappop(l)\nprint(ans)', ... | ['Runtime Error', 'Accepted'] | ['s354930950', 's478970399'] | [148436.0, 17604.0] | [2105.0, 447.0] | [299, 270] |
p02948 | u169696482 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n, m = map(int, input().split())\nA = list(list(map(int, input().split())) for _ in range(n))\nd = 0\nfor i in range(m):\n B = [0]\n for a, b in A:\n if a < m-i:\n B.append(b)\n d += max(B)\nprint(d)', "import heapq\ndef main():\n N, M = list(map(int, input().split()))\n jobs = [[] for _ ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s844153041', 's914972999', 's731820709'] | [28232.0, 23752.0, 23752.0] | [2105.0, 464.0, 278.0] | [217, 412, 450] |
p02948 | u175426149 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["n, m = map(int, input().split())\njobs = dict()\n\nfor i in range(n):\n a, b = map(int, input().split())\n if not a in jobs.keys():\n jobs[a] = [b]\n else:\n jobs[a].append(b)\n\nprint(jobs)\n\ndays = []\nmoney_list = [0]\nfor i in range(1, m+1):\n # print('days', days)\n if i in jobs.key... | ['Runtime Error', 'Accepted'] | ['s635606184', 's483733386'] | [28872.0, 26104.0] | [2108.0, 460.0] | [456, 575] |
p02948 | u185966380 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nN, M = map(int, input().split())\nAB_list = []\n[heapq.heappush(AB_list, list(map(int, input().split()))) for _ in range(N)]\nans = 0\nkouho = []\n\nfor day in range(1, M + 1):\n while 1:\n if len(AB_list) != 0:\n i = heapq.heappop(AB_list)\n if i[0] > day:\n ... | ['Wrong Answer', 'Accepted'] | ['s101308230', 's054082276'] | [28196.0, 28176.0] | [681.0, 704.0] | [493, 458] |
p02948 | u189023301 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nn, m = map(int, input().split())\nlis = []\nfor i in range(n + 1):\n lis.append([])\n\nfor i in range(n):\n a, b = map(int, input().split())\n if a <= m:\n lis[a].append(-b)\n\ncnd = []\nheapq.heapify(cnd)\nres = 0\n\nfor j in range(1, m + 1):\n for e in lis[j]:\n heapq.heapp... | ['Runtime Error', 'Accepted'] | ['s972497474', 's936740164'] | [17856.0, 17732.0] | [440.0, 433.0] | [370, 333] |
p02948 | u189479417 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nN, M = map(int,input().split())\nL = [[] for _ in range(M)]\nfor _ in range(N):\n A, B = map(int,input().split())\n L[A-1].append(-B)\nQ = []\nans = 0\nfor i in range(M):\n for j in L[i]:\n heapq.heappush(Q, j)\n ans -= heapq.heappop(Q)\n \nprint(ans)', 'import heapq\nN, M = map(in... | ['Runtime Error', 'Accepted'] | ['s542383439', 's224540362'] | [17600.0, 17604.0] | [421.0, 446.0] | [274, 345] |
p02948 | u197457087 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import heapify, heappop, heappush\nN,M = map(int,input().split())\nA = [[] for _ in range(M+1)]\n#HQ = []\nfor i in range(N):\n a,b = map(int,input().split())\n if a < M:\n A[a].append(b)\n#print(A)\nans = 0\nL = []\nfor day in range(1,M+1):\n for t in A[day]:\n heappush(L,-t)\n #print(L)\n if n... | ['Wrong Answer', 'Accepted'] | ['s775788160', 's846232185'] | [24416.0, 24124.0] | [312.0, 317.0] | [369, 370] |
p02948 | u203843959 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N,M=map(int,input().split())\n\nbalist=[]\nfor i in range(N):\n A,B=map(int,input().split())\n balist.append((B,A))\n \nbalist.sort(reverse=True)\n#print(balist)\n\nanswer=0\nday=0\nfor (b,a) in balist:\n if day+a<=M:\n print(b,day+a)\n answer+=b\n day+=1\n \n if day>=M:\n break\n \nprint(answe... | ['Wrong Answer', 'Accepted'] | ['s158472919', 's225109649'] | [17448.0, 17232.0] | [541.0, 500.0] | [299, 455] |
p02948 | u208497224 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n, m = map(int, input().split())\nbaitos = [list(map(int, (input().split()))) for _ in range(n)]\nbaitos = sorted(baitos, key=(lambda x: x[0]))\n\nmax = 0\navailable_works = []\nfor shigotobi in reversed(range(m)):\n nokori = m-shigotobi\n \n for baito_index in range(len(baitos)):\n if baitos[baito_in... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s367760403', 's801948326', 's368433595'] | [30932.0, 30108.0, 27880.0] | [2105.0, 2105.0, 458.0] | [869, 808, 448] |
p02948 | u219197917 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import heappush, heappop\nimport sys\ninput = sys.stdin.readline\nn, m = map(int, input().split())\nab = [tuple(int(i) for i in input().split()) for _ in range(n)]\npab = [(i, k[0], k[1]) for i, k in enumerate(sorted(ab, key=lambda x: (-x[1], x[0])))]', 'from heapq import heappush, heappop\nimport sys\ninp... | ['Wrong Answer', 'Accepted'] | ['s466618460', 's672774264'] | [33636.0, 20744.0] | [343.0, 393.0] | [257, 368] |
p02948 | u220522704 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import sys\ninput = sys.stdin.readline\nfrom operator import itemgetter\n\nN, M = map(int,input().split())\nwork_list = [list(map(int, input().split())) for i in range(N)]\n\n#sort by hosyu\nwork_list.sort(key=itemgetter(1), reverse=True)\nsum = 0\nworkdays = list(range(M+1))\n\nfor day, reward in work_list:\n lat... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s135835904', 's468027147', 's706351248', 's387904969'] | [34520.0, 23572.0, 23600.0, 23748.0] | [2106.0, 229.0, 238.0, 306.0] | [382, 413, 441, 449] |
p02948 | u223904637 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nn,m=map(int,input().split())\nab=[]\nfor i in range(n):\n ab.append(list(map(int,input().split())))\nab.sort()\n\nq=[]\nans=0\nfor i in range(m):\n while j <= n-1:\n if ab[j][0]<=i+1:\n heapq.heappush(q,-ab[j][1])\n else:\n ans-=heapq.heappop(q)\n b... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s369293335', 's431365421', 's253809537'] | [27896.0, 28444.0, 31600.0] | [511.0, 592.0, 638.0] | [330, 326, 348] |
p02948 | u225388820 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn,m=map(int, input().split())\ns = [list(map(int, input().split())) for i in range(n)]\nq = []\nans=0\n\nheapq.heapify(q)\nheapq.heapify(s)\nfor k in range(m-1,-1,-1):\n while True:\n if s!=[]:\n \n p=heapq.heappop(s)\n if p[0]+k<=m:\n \n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s084755710', 's164466685', 's276286102', 's277071704', 's296527105', 's327339792', 's619454793', 's863469050', 's978183036', 's202960804'] | [27344.0, 27344.0, 27344.0, 27344.0, 27344.0, 27344.0, 22764.0, 27344.0, 27344.0, 28524.0] | [817.0, 719.0, 604.0, 603.0, 798.0, 800.0, 1909.0, 345.0, 603.0, 658.0] | [708, 655, 613, 630, 691, 689, 385, 628, 630, 324] |
p02948 | u227082700 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import*\nL=lambda:list(map(int,input().split()))\nn,m=L()\nc=[]\nh=[i+1for i in range(m)]\nfor i in range(n):\n a,b=L()\n c.append([b,a])\nc.sort(key=lambda c:(c[0],c[1]),reverse=1)\na=0\nfor i in c:\n j=m\n b=True\n while j!=0:\n k=heappop(h)\n if i[1]<=k:\n b=False\n break\n heapp... | ['Wrong Answer', 'Accepted'] | ['s629448625', 's973596181'] | [32288.0, 42916.0] | [2105.0, 603.0] | [359, 302] |
p02948 | u231122239 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["n, m = map(int, input().split(' '))\nab = []\nfor _ in range(n):\n ab.append(list(map(int, input().split(' '))))\nab = sorted(ab, key=lambda x: (-x[1], -x[0]))\n\nans = 0\nfor i in ab:\n if i[0] < m:\n ans += i[1]\n m -= 1\nprint(ans)", "n, m = map(int, input().split(' '))\nab = []\nfor _ in range... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s127874690', 's678513565', 's687989838', 's711465137'] | [42480.0, 45292.0, 43676.0, 26740.0] | [555.0, 659.0, 2106.0, 1121.0] | [243, 290, 381, 1307] |
p02948 | u233588813 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['a=int(input())\nb=[sorted(input()) for j in range(a)]\nc=[[0for i in range(26)] for j in range(a)]\nfor i in range(a):\n for j in range(10):\n c[i][ord(b[i][j])-97]+=1\nsum=0\nd=1\nc.sort()\nprint(c)\nfor i in range(a-1):\n if c[i]==c[i+1]:\n d+=1\n else:\n sum+=d*(d-1)//2\n d=1\n if i==a-2:\n sum+... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s058067509', 's999201941', 's367207746'] | [3064.0, 3064.0, 40024.0] | [17.0, 17.0, 656.0] | [328, 319, 287] |
p02948 | u235210692 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nclass job:\n def __init__(self,name,date,award):\n self.name=name\n self.award=award\n self.date=date\n def __gt__(self,other):\n if self.award<other.award:\n return True\n elif self.award==other.award and self.date<other.date:\n return Tr... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s301403809', 's852850288', 's443496024'] | [2940.0, 40856.0, 40640.0] | [17.0, 390.0, 1177.0] | [1169, 726, 1479] |
p02948 | u243714267 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N, M = map(int, input().split())\nmd = [0]*N\n\nfor i in range(0,N):\n d, m = map(int, input().split())\n md[i] = {"m":m, "d":d}\n\nmd = sorted(md, key=lambda x:x["m"], reverse=True)\nprint(md)', 'def insertHeap(array, val):\n array.append(val)\n n = len(array)-1\n while n != 0:\n parent = int((n - ... | ['Wrong Answer', 'Accepted'] | ['s962106902', 's738297653'] | [48100.0, 17712.0] | [510.0, 1199.0] | [187, 1219] |
p02948 | u250554058 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nn, m = map(int, input().split())\nnum = sorted([list(map(int, input().split())) for i in range(n)], key = lambda x: x[0])\n\ns = []\nheapq.heapify(s)\n\nfor i in range(1, m + 1):\n for j in num:\n if(j[0] <= i):\n heapq.heappush(s, j[1])\n else:\n break\n\nprint(sum(s))\n', 'import h... | ['Wrong Answer', 'Accepted'] | ['s859311225', 's386096652'] | [86348.0, 31908.0] | [2108.0, 574.0] | [290, 355] |
p02948 | u254871849 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['# 2019-11-16 14:51:41(JST)\nimport sys\nimport collections\n# import math\n# from string import ascii_lowercase, ascii_uppercase, digits\n# from bisect import bisect_left as bi_l, bisect_right as bi_r\n# import itertools\n# from functools import reduce\n# import operator as op\n# from scipy.misc import comb # float\n... | ['Wrong Answer', 'Accepted'] | ['s041329696', 's627167645'] | [81164.0, 24932.0] | [2108.0, 266.0] | [1687, 538] |
p02948 | u255673886 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n = int(input())\ns = [input() for i in range(n)]\n# print(n)\n# print(s)\ns = list(map(list, s))\n# print(s)\nfor i in range(n):\n s[i].sort()\n s[i] = "".join(s[i])\n# print(s)\ndic = {}\nfor i in range(n):\n if s[i] in dic:\n dic[s[i]] += 1\n else:\n dic.setdefault(s[i],1)\na = list(dic.v... | ['Runtime Error', 'Accepted'] | ['s705978849', 's565887926'] | [3064.0, 31980.0] | [17.0, 629.0] | [464, 378] |
p02948 | u255943004 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N,M = map(int,input().split())\nAB = [[0,0]]*N\nfor n in range(N):\n AB[n] = list(map(int,input().split()))\nwork_schedule = [0]*M\nsorted_AB = sorted(AB,key=lambda x:(-x[1],x[0]))\nfor work in sorted_AB:\n cnt = 0\n while True:\n if work[0]-1+cnt >= M:\n break\n elif work_schedule[w... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s585823942', 's631723531', 's263067945'] | [40180.0, 40148.0, 27676.0] | [2106.0, 2109.0, 497.0] | [483, 483, 363] |
p02948 | u256464928 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from collections import defaultdict\nfrom heapq import heappush, heappop\n\nN,M = map(int,input().split())\nd = defaultdict(list)\n\nfor _ in range(N):\n a,b = map(int,input().split())\n d[a].append(b)\n \nh = []\nres = 0\n\nfor a in range(1,M + 1):\n for b in d[a]:\n heappush(h,-b)\n if h > 0:\n c = heapp... | ['Runtime Error', 'Accepted'] | ['s091920675', 's942456056'] | [27632.0, 27812.0] | [364.0, 493.0] | [334, 339] |
p02948 | u260216890 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n,m=map(int, input().split())\nab=[]\nfor _ in range(n):\n tmpa, tmpb=map(int, input().split())\n ab.append((tmpa,tmpb))\nab.sort(reverse=True)\nimport heapq\nh = []\nans = 0\nfor i in range(1, m+1):\n print(h)\n while ab and ab[-1][0] == i:\n heapq.heappush(h,ab.pop()[1]*(-1))\n if h:\n ... | ['Runtime Error', 'Accepted'] | ['s788932420', 's469300912'] | [138100.0, 17244.0] | [2104.0, 501.0] | [338, 325] |
p02948 | u268318377 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['P = []\nn, m = map(int, input().split())\nans = 0\nfor _ in range(n):\n a,b = map(int, input().split())\n P.append([a,b])\nP = sorted(P, key= lambda x: [x[0]*x[1],x[1]], reverse=True)\nprint(P)\n\nfor i,j in P:\n if i > m:\n continue\n ans += j\n m -= 1\n if m == 0:\n break\nprint(ans)... | ['Wrong Answer', 'Accepted'] | ['s378170863', 's434678260'] | [34628.0, 27104.0] | [630.0, 505.0] | [302, 425] |
p02948 | u280938208 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['\nimport heapq\nfrom collections import defaultdict\n\nN, M = map(int, input().split())\n\na_b_dict = defaultdict(list)\nfor _ in range(N):\n a, b = tuple(map(int, input().split()))\n a_b_dict[a].append(b)\n\n\nresult = []\nh = []\nnum_days = 0\nfor i in range(1, 1+M):\n for b in a_b_dict.get(i, []):\n ... | ['Wrong Answer', 'Accepted'] | ['s787872334', 's315296255'] | [30604.0, 30652.0] | [536.0, 510.0] | [476, 406] |
p02948 | u283869437 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import*\n(N,M),*t=[map(int,s.split())for s in open(0)]\nq=[0]\nv=[[]for _ in q]\nz=0\nfor a,b in t:\n\tif a<=M:v[a-1]+=[b]\nfor i in v:\n\tfor j in i:heappush(q,-j)\n\tz-=heappop(q)\nprint(z)', 'from heapq import*\n(N,M),*t=[map(int,s.split())for s in open(0)]\nq=[0]*10**5\nv=[[]for _ in q]\nz=0\nfor a,b i... | ['Runtime Error', 'Accepted'] | ['s557708647', 's701945404'] | [49652.0, 58468.0] | [262.0, 505.0] | [189, 189] |
p02948 | u287132915 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import bisect\nfrom collections import deque\n\nn, m = map(int, input().split())\nlst = []\nfor i in range(n):\n a, b = map(int, input().split())\n lst.append([a, b])\n\nlst.sort(key=lambda x:(x[1]), reverse=True)\nlst.sort(key=lambda x:(x[0]), reverse=False)\n\nans = 0\nind = 0\nkouho = deque([])\nfor i in ran... | ['Runtime Error', 'Accepted'] | ['s223044982', 's157536032'] | [21516.0, 26292.0] | [441.0, 547.0] | [579, 549] |
p02948 | u305366205 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn, m = map(int, input().split())\njobs = [tuple(map(int, input().split())) for i in range(n)]\n\njobs.sort()\n\nmoney = []\nans = 0\n\ni = 0\n\nfor limit in range(1, m + 1):\n \n while i < n and jobs[i][0] <= m:\n a = jobs[i][0]\n b = jobs[i][1]\n \n heapq.heappush(mone... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s321702212', 's853704979', 's612884614'] | [20800.0, 18612.0, 20792.0] | [572.0, 2104.0, 535.0] | [736, 762, 741] |
p02948 | u306950978 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn , m = map(int,input().split())\nkouho = [[] for i in range(m)]\nhosyu = [0 for i in range(m)]\nfor i in range(n):\n a , b = map(int,input().split())\n if a < m:\n kouho[a-1].append(-b)\nfor i in range(m):\n now = i\n p = 0\n heapq.heapify(kouho[i])\n while kouho[i]:\n i... | ['Wrong Answer', 'Accepted'] | ['s196928905', 's192263783'] | [22840.0, 21964.0] | [323.0, 306.0] | [505, 334] |
p02948 | u310023971 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn,m = map(int,input().split())\nl = [0]*n\nfor i in range(n):\n l[i] = list(map(int,input().split()))\nl.sort()\n\nL = [[] for i in range(m+1)]\nfor i in range(n):\n if l[i][0] <= m:\n L[l[i][0]].append(l[i][1])\n\na = []\nans = 0\nfor i in range(m):\n key = i+1\n for j in L[key]:\n heapq.heap... | ['Runtime Error', 'Accepted'] | ['s181792765', 's826267710'] | [35424.0, 18516.0] | [568.0, 432.0] | [393, 280] |
p02948 | u310233294 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N, M = map(int, input().split())\nmemo = [0] * M\nfor _ in range(N):\n a, b = map(int, input().split())\n if M < a:\n continue\n memo[a] = max(b, memo[a])\nans = sum(memo)\nprint(ans)', 'N, M = map(int, input().split())\nAB = [list(map(int, input().split())) for _ in range(N)]\nAB.sort(key=lambda x: x... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s032125486', 's531313654', 's520988242'] | [6772.0, 28980.0, 31884.0] | [309.0, 431.0, 1321.0] | [191, 310, 352] |
p02948 | u316322317 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn,m=map(int,input().split())\nl=[]\nfor i in range(n):\n a,b=map(int,input().split())\n l.append([a,b])\nl.sort()\nl.append([0,0])\nans=0\nk=[]\nj=0\nfor i in range(1,m+1):\n while j<=n and l[j][0]<=i:\n heapq.heappush(k, l[j][1])\n j+=1\n if len(k)!=0:\n \tans+=k[-1]\n \tk.pop(-1)\nprint(an... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s836999504', 's958432867', 's216908269'] | [20680.0, 19920.0, 23880.0] | [546.0, 2105.0, 579.0] | [300, 268, 312] |
p02948 | u318427318 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['def main2():\n n,m=map(int,input().split())\n jobs_list=[list(map(int,input().split())) for _ in range(n)]\n \n banpei_list=[[i,0] for i in range(1,m+2)]\n \n jobs_list.extend(banpei_list)\n jobs_list=sorted(jobs_list)\n print(jobs_list)\n ans=0\n index=0\n que=[]\n while True:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s215661314', 's854883337', 's778768896'] | [48000.0, 168748.0, 42620.0] | [745.0, 2106.0, 717.0] | [1053, 1064, 1009] |
p02948 | u325956328 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nN, M = map(int, input().split())\ndic = {}\nfor i in range(N):\n A, B = map(int, input().split())\n if A not in dic:\n dic[A] = [-B]\n else:\n dic[A] += [-B]\nprint(dic, sorted(dic.keys()))\n\nans = 0\nheap = []\n\nfor i in range(M):\n # print(i)\n if i + 1 in dic:\n ... | ['Wrong Answer', 'Accepted'] | ['s498074319', 's451091833'] | [30624.0, 26020.0] | [2105.0, 448.0] | [424, 447] |
p02948 | u337525741 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\njob = list()\nsalary = list()\nn,m = map(int,input().split())\n\nfor i in range(n):\n a,b = map(int,input().split())\n job.append(a,b)\n \njob.sort(reverse = True)\n\nfor x in job:\n s,t = x\n heapq.heappush(salary,t)\n if s - m > 0:\n heapq.heappop(salary)\n else:\n m... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s073451182', 's615162668', 's895402979'] | [3184.0, 3064.0, 17620.0] | [18.0, 18.0, 472.0] | [327, 316, 325] |
p02948 | u342563578 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n,q = map(int,input().split())\ns = [0 for i in range(n-1)]\nfor i in range(n-1):\n a,b = map(int,input().split())\n s[i] = [a,b]\ns.sort()\nans = [-1 for i in range(n)]\nfor i in range(n-1):\n ans[s[i][1]-1] = s[i][0]-1\ncount = [0 for i in range(n)]\nfor i in range(q):\n p,x = map(int,input().split())\n... | ['Runtime Error', 'Accepted'] | ['s113584041', 's442528222'] | [21760.0, 22436.0] | [478.0, 399.0] | [470, 515] |
p02948 | u346308892 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['def acinput():\n return list(map(int, input().split(" ")))\n\n\nimport heapq\n\nN,M=acinput()\n\nab=[]\nfor i in range(N):\n ab.append(acinput())\n\n\nab=sorted(ab,key=lambda x:x[0])\n\n\nres=0\ndo=[0]*(M+1)\nnowdate=M-1\n\nkoho=[]\nk=0\nwhile True:\n #print(k)\n i=k\n while True:\n if i>=len(ab... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s107969568', 's433016898', 's602473074', 's694337429', 's843405511', 's116391883'] | [29848.0, 29848.0, 38780.0, 29848.0, 29848.0, 32748.0] | [605.0, 598.0, 765.0, 600.0, 615.0, 647.0] | [717, 721, 736, 734, 766, 744] |
p02948 | u346812984 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import sys\n\n\nsys.setrecursionlimit(10 ** 6)\nINF = float("inf")\nMOD = 10 ** 9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef factorization(N):\n d = {}\n for n in range(2, N + 1):\n tmp = n\n for i in range(2, int(n ** 0.5) + 1):\n if tmp % i == 0:\n ... | ['Runtime Error', 'Accepted'] | ['s706271542', 's118732448'] | [3192.0, 27100.0] | [18.0, 295.0] | [1261, 642] |
p02948 | u347640436 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from sys import stdin\ndef main()\n from builtins import int, map, range\n readline = stdin.readline\n from heapq import heappush, heappop\n n, m = map(int, readline().split())\n jobs = {}\n for _ in range(n):\n a, b = map(int, readline().split())\n if a > m:\n continue\n if a in jobs:\n jobs... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s038860279', 's325001974', 's393096176', 's666283492', 's950512309', 's994801286', 's850620799'] | [2940.0, 3064.0, 3064.0, 3064.0, 3064.0, 21056.0, 26072.0] | [17.0, 17.0, 19.0, 17.0, 17.0, 310.0, 442.0] | [600, 647, 909, 505, 767, 517, 488] |
p02948 | u350248178 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n,m=map(int,input().split())\nab=[]\nq=0\nfor i in range(n):\n p=[int(j) for j in input().split()]\n q=max(q,p[0])\n ab.append(p)\nfrom operator import itemgetter\n \nab.sort(key=itemgetter(1))\nab.reverse()\nab.sort(key=itemgetter(0))\nl=[]\nimport bisect\nans=0\nfor i in range(1,m+1):\n while True:\n ... | ['Wrong Answer', 'Accepted'] | ['s961968566', 's013790997'] | [22772.0, 33172.0] | [2105.0, 504.0] | [563, 335] |
p02948 | u353797797 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['def update(i, x):\n i += 1\n while i < m + 1:\n bit[i] += x\n i += i & -i\n\ndef get_sum(i):\n i += 1\n s = 0\n while i > 0:\n s += bit[i]\n i -= i & -i\n return s\n\nn, m = map(int, input().split())\nbit = [0] * (m + 1)\nab = [list(map(int, input().split())) for _ in ran... | ['Runtime Error', 'Accepted'] | ['s227527561', 's124386037'] | [125192.0, 20100.0] | [2106.0, 673.0] | [574, 428] |
p02948 | u364298541 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nN,M=(int(i) for i in input().split())\n\n\n\ntasks=[[] for i in range(10**5+1)]\nfor i in range(N):\n a,b=(int(i) for i in input().split())\n tasks[a-1].append(b)\n\npq=[]\nans=0\nfor i in range(M):\n for b in tasks[i]:\n heappush(pq,b)\n if len(pq)!=0:\n ans+=heappop(pq)\n\npr... | ['Runtime Error', 'Accepted'] | ['s157595817', 's228174798'] | [17992.0, 18480.0] | [391.0, 508.0] | [310, 341] |
p02948 | u371990949 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["def calc_total_reward(m, data):\n \n day_to_rewards = {}\n for row in data:\n day = row['day']\n reward = row['reward']\n if day not in day_to_rewards:\n day_to_rewards[day] = []\n day_to_rewards[day].append(row['reward'])\n\n for day, reward_list in day_to_rewards.i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s695922691', 's721742281', 's233978991'] | [101404.0, 58656.0, 17204.0] | [2107.0, 2107.0, 351.0] | [1028, 1034, 401] |
p02948 | u372259664 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nimport sys\n\nfinput = sys.stdin.readline\n\nn,m = map(int, finput().split())\n\nq = [[] for i in range(m)]\n\nfor i in range(n):\n a,b = [int(j) for j in finput().split()]\n if a>m:\n continue\n q[a-1].append(-b)\n\nhq = []\nheapq.heapify(hq)\nans = 0\nfor i in range(m):\n for j in r... | ['Runtime Error', 'Accepted'] | ['s318803498', 's809929806'] | [17604.0, 17628.0] | [311.0, 324.0] | [402, 447] |
p02948 | u373047809 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import*\n(N, M), *t = [map(int, s.split()) for s in open(0)]\nq, z = [], 0\nv = [q for _ in [0] * 10**5]\nfor a, b in t:\n v[a - 1] += b,\nfor i in v[:M]:\n for j in i:\n heappush(q, -j)\n z += -heappop(q)\nprint(z)', 'from heapq import*\n(N, M), *t = [map(int, s.split()) for s in open(0)]\... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s134973257', 's561727516', 's801866232', 's860465540', 's861582889'] | [556268.0, 551216.0, 61400.0, 61384.0, 62404.0] | [2222.0, 2221.0, 380.0, 352.0, 388.0] | [232, 249, 233, 234, 250] |
p02948 | u375500286 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn,m=map(int,input().split())\nab=[]\nfor i in range(m+2):\n ab.append([])\nfor i in range(n):\n a,b=map(int,input().split())\n ab[a].append(-b)\nh = []\ns=0\nfor i in range(1,m+2):\n for v in ab[i]:\n heapq.heappush(h,v)\n if len(h)!=0:\n s-=heapq.heappop(h)\nprint(s)', 'imp... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s011717975', 's136467194', 's246999066', 's350515550', 's925596974'] | [17604.0, 17476.0, 18540.0, 17476.0, 18376.0] | [450.0, 437.0, 443.0, 399.0, 468.0] | [296, 298, 299, 303, 329] |
p02948 | u385244248 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nN,M = map(int,input().split())\nl = [list(map(int,input().split())) for _ in range(N)]\nl = sorted(l)\nheap = []\na = 0\nb = 0\nfor i in range(1,M+1):\n while l[a][0] <= i:\n a = 0\n heapq.heappush(heap,-(l[a][1]))\n a += 1\n if heap == []:\n continue\n else:\n ... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s525755055', 's767309263', 's285972829'] | [249880.0, 283948.0, 17804.0] | [2122.0, 2122.0, 519.0] | [346, 304, 324] |
p02948 | u401452016 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["#137D\ndef main():\n import sys\n import heapq as h\n from collections import defaultdict\n N, M = map(int, sys.stdin.readline().split())\n L = tuple([tuple(map(int, sys.stdin.readline().split())) for _ in range(N)])\n #print(L)\n D = defaultdict(list)\n for i in range(N):\n D[L[i][0]-1... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s643131457', 's864501093', 's198534442'] | [41064.0, 3064.0, 41064.0] | [315.0, 17.0, 318.0] | [578, 514, 598] |
p02948 | u401487574 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n,m = map(int,input().split())\nl = []\nfor i in range(n):\n a,b = map(int,input().split())\n l.append([a,b])\nl.sort(reverse=True,key= lambda x:x[0])\nl.sort(reverse=True,key= lambda x:x[1])\nprint(l)\nda = 0\nmon = 0\nfor i in range(n):\n a,b = l[i]\n\n if da + a <= m:\n mon += b\n da += 1... | ['Wrong Answer', 'Accepted'] | ['s351394186', 's180615351'] | [24792.0, 17660.0] | [575.0, 557.0] | [342, 348] |
p02948 | u401731473 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N, M = map(int, input().split())\nvaluesDict = {}\nfor _ in range(N):\n A, B = map(int, input().split())\n valuesDict[A] = B if valuesDict[A] >= B else valuesDict[A]\n\nanswer = 0\nfor i in range(M):\n today = i + 1\n answer += valuesDict.get(today) if valuesDict.get(today) is not None else 0\n\nprint(answer)', '... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s034946797', 's452694698', 's959197256', 's824755936'] | [3060.0, 3060.0, 3060.0, 18468.0] | [17.0, 17.0, 17.0, 451.0] | [303, 147, 237, 308] |
p02948 | u408620326 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import sys,heapq\ninput=sys.stdin.readline\nN,M=[int(x) for x in input().strip().split()]\nAB=[list(map(int,input().strip().split())) for _ in range(N)]\nAB.sort()\nprint(AB)\nn=0\nsumB=0\nq=[]\nfor m in range(1,M+1):\n maxB=0\n while n<N and AB[n][0]<=m:\n heapq.heappush(q,-AB[n][1])\n n+=1\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s603970432', 's686142266', 's643242894'] | [32220.0, 29740.0, 31584.0] | [488.0, 451.0, 468.0] | [368, 358, 341] |
p02948 | u419877586 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import bisect\nn, m = map(int, input().split())\nwork = [list(map(int, input().split())) for i in range(n)]\ndic = {}\nfor w in work:\n a, b = w[0], w[1]\n if a not in dic.keys():\n dic[a]=[b]\n else:\n index=bisect.bisect_right(dic[a], b)\n dic[a].insert(index, b)\ndic_=sorted(dic.items... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s461383785', 's778387884', 's840872804', 's845492279', 's090190982'] | [77096.0, 42516.0, 30128.0, 3064.0, 27652.0] | [2106.0, 2106.0, 2105.0, 18.0, 512.0] | [591, 598, 524, 391, 356] |
p02948 | u422590714 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["import sys\n\nsys.setrecursionlimit(10 ** 7)\n\nn, m = input().split(' ')\nN = int(n)\nM = int(m)\n\nsorted_ab = sorted([list(map(int, input().split())) for i in range(N)])\n\n\n\nindex = 0\npool = []\nrewords = 0\nfor i in range(M):\n day = i + 1\n\n while index < N and day >= int(sorted_ab[index][0]):\n ... | ['Wrong Answer', 'Accepted'] | ['s382219043', 's237954816'] | [28764.0, 31964.0] | [2106.0, 644.0] | [719, 664] |
p02948 | u424776185 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["def main():\n [N, M] = [int(number) for number in input().split()]\n part_times = []\n for i in range(N):\n [a, b] = [int(number) for number in input().split()]\n #money_par_day = b / a\n part_times.append([b, a])\n #part_times.sort(reverse=True)\n part_times = sorted(part_time... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s484708961', 's822870606', 's452880572'] | [31156.0, 28396.0, 23568.0] | [509.0, 493.0, 1994.0] | [633, 611, 671] |
p02948 | u425184437 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['mport heapq\nn,m=map(int,input().split())\nlist=[[] for i in range(m)]\nh=[]\nfor i in range(n):\n a,b=map(int,input().split())\n if a<=m:\n list[a-1].append(-b)\nans=0\nfor i in range(m):\n for j in list[i]:\n heapq.heappush(h,j)\n if h:\n ans+=-heapq.heappop(h)\n else:\n continue\nprint(ans) ', 'i... | ['Runtime Error', 'Accepted'] | ['s667128447', 's232499740'] | [8920.0, 21904.0] | [26.0, 340.0] | [297, 299] |
p02948 | u449473917 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nn,m=map(int,input().split())\nl=[[int(_) for _ in input().split()] for __ in range(n)]\n\nl=sorted(l, key=lambda x:x[1], reverse=True)\n\na=[]\nday=0\nans=0\nfor j in range(1,m+1):\n while 1:\n if day>=n:\n break\n if l[day][0]<=j:\n heapq.heappush(a,-l[day][1])\... | ['Wrong Answer', 'Accepted'] | ['s729047402', 's421478416'] | [25720.0, 31948.0] | [475.0, 370.0] | [404, 365] |
p02948 | u452070976 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import numpy as np\nN, M = map(int, input().split())\n\nX = []\n\ni = 0\nwhile i < N:\n X.append(list(map(int, input().split())))\n i += 1\n\nX = np.asarray(X)\n\nX_ind = np.lexsort((X[:,0], -X[:,1]), axis=0)[::-1]\nX = X[X_ind]\n# print(X)\nleast = M - 1\np = 0\nwhile least >= 0:\n last, X = X[-1], X[:-1]\n... | ['Runtime Error', 'Accepted'] | ['s436757028', 's416506113'] | [37848.0, 25324.0] | [793.0, 582.0] | [401, 416] |
p02948 | u461454424 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['#input\nN, M = map(int, input().split())\nA = [0] * N\nB = [0] * N\n\nfor i in range(N):\n A[i], B[i] = map(int, input().split())\n\n#output\nimport heapq\n\n\npoint = [0] * M\nhq = []\n\nfor j in range(0, M):\n for i in range(N):\n if A[i] == j+1:\n heapq.heappush(hq, -B[i])\n if len(hq) >... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s353589176', 's705280433', 's881748865', 's928944448', 's221278808'] | [12532.0, 3064.0, 10868.0, 13300.0, 25936.0] | [2104.0, 18.0, 2104.0, 2108.0, 457.0] | [460, 258, 453, 457, 565] |
p02948 | u471684875 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["n=int(input())\nl=[['0']*10 for _ in range(n)]\nfor i in range(n):\n a=str(input())\n for j in range(10):\n l[i][j]=a[j]\n l[i].sort()\nl.sort()\n\nc=0\nd=[]\nfor j in range(n-1):\n if l[j]==l[j+1] and j==n-2:\n c+=2\n d.append(c)\n elif ... | ['Runtime Error', 'Accepted'] | ['s992629200', 's162137620'] | [3064.0, 17604.0] | [17.0, 457.0] | [489, 375] |
p02948 | u475991121 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import *\nn, m = map(int, input().split())\npay = []\nfor _ in range(n):\n a, b = map(int, input().split())\n pay.append((a, b))\npay = sorted(pay, reverse=True)\nprint(pay)\nq = []\nans = 0\nfor i in range(1, m+1):\n while pay and pay[-1][0] <= i:\n a, b = pay.pop()\n heappush(q, -b... | ['Runtime Error', 'Accepted'] | ['s904556925', 's357759759'] | [138104.0, 17796.0] | [2105.0, 541.0] | [381, 357] |
p02948 | u490553751 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['#template\ndef inputlist(): return [int(k) for k in input().split()]\n#template\n\nN,M = inputlist()\nli = []\nfor i in range(N):\n A,B = inputlist()\n B *= -1\n li.append([A,B])\nans = 0\nfrom heapq import *\nli.sort()\nk = []\nheapify(k)\nflag = 0\nfor i in range(1,M+1):\n if flag == N:\n for t i... | ['Runtime Error', 'Accepted'] | ['s143165058', 's810558457'] | [3060.0, 20824.0] | [17.0, 643.0] | [533, 538] |
p02948 | u496407619 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['\nimport numpy as np\n\nN, M = map(int, input().split())\n\npairs = []\nfor i in range(N):\n pairs.append(list(map(int, input().split())))\n\npairs = sorted(pairs, key=lambda elm: -elm[1])\n\n\nfinish_day = -1\nout = 0\n\n#not_done = [True for _ in range(M)]\n\ncounts = [0 for _ in range(M)]\ncumsum_counts = np.ze... | ['Runtime Error', 'Accepted'] | ['s840781905', 's983243935'] | [42008.0, 17604.0] | [623.0, 434.0] | [997, 524] |
p02948 | u497046426 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import *\nfrom collections import defaultdict\n\nN, M = map(int, input().split())\narbeits = defaultdict(list)\nfor _ in range(N):\n a, b = map(int, input().split())\n arbeits[a].append(b)\nheap = []\nans = 0\nfor i in range(1, M+1):\n for b in arbeits[i]:\n heappush(heap, -b)\n ans += -... | ['Runtime Error', 'Accepted'] | ['s737486628', 's034426504'] | [27616.0, 27800.0] | [438.0, 479.0] | [330, 347] |
p02948 | u504256702 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N, M = map(int,input().split())\nA_B = [list(map(int, input().split())) for i in range(N)]\n\nday = 0\nans = 0\nA_B = sorted(A_B, key=lambda x:(-x[1], -x[0]))\nprint(A_B)\nfor i in range(N):\n print(day)\n if day + A_B[i][0] <= M:\n print("a")\n ans += A_B[i][1]\n day += 1\nprint(ans)', 'N, M = map(int,input... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s048723151', 's546543317', 's701263485'] | [45268.0, 44996.0, 48276.0] | [758.0, 364.0, 551.0] | [281, 747, 751] |
p02948 | u514894322 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["n,m = map(int,input().split())\nl = [list(map(int,input().split())) for _ in [0]*n]\nl.sort(key=lambda x:x[0])\nans = 0\ntmpl = []\nd = 1\nflag = True\n\nwhile d<=m:\n while len(l)>=1 and l[0][0] <= d:\n tmpl.append(l[0][1])\n del l[0]\n if len(tmpl) == 0:\n d+=1\n break\n print('day',d)\n maxindex =... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s373786033', 's500377709', 's421764834'] | [28844.0, 28852.0, 32664.0] | [2105.0, 388.0, 532.0] | [389, 336, 434] |
p02948 | u525227429 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N, M = map(int, input().split())\nAB = [list(map(int, input().split())) for _ in range(N)]\n\nAB.sort()\nB = [[] for _ in range(M + 2)]\ni = 1\nj = 0\nwhile i <= M:\n while j < N or AB[j][0] <= i:\n B[i].append(AB[j][1])\n j += 1\n B[i] = B[i - 1].copy()\n i += 1\n\nans = 0\nfor i in range(1, M + 1):\n if l... | ['Runtime Error', 'Accepted'] | ['s237370930', 's366508077'] | [35960.0, 23748.0] | [550.0, 493.0] | [435, 507] |
p02948 | u528748570 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['\nN, M = map(int, input().split())\n\nData = [list(map(int, input().split())) for _ in range(N)]\n\nans = 0\nfor i in range(1, M+1):\n temp = 0\n index = -1\n for j in range(len(Data)):\n if (Data[j][0] <= i) and (temp < Data[j][1]):\n temp = Data[j][1]\n index = j\n if index ... | ['Wrong Answer', 'Accepted'] | ['s033088353', 's345988989'] | [27324.0, 29484.0] | [2108.0, 664.0] | [446, 416] |
p02948 | u539517139 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n,m=map(int,input().split())\nl=[]\nfor i in range(n):\n a,b=map(int,input().split())\n if a<=m:\n l.append([a,b])\nn=len(l)\nl.sort()\np=0\nt=l[0][0]\nfor i in range(n):\n if l[i][0]!=t:\n p+=l[i-1][1]\n t=l[i][0]\nprint(p)', 'import heapq as h\nn,m=map(int, input().split())\na=[list(map(int, input().spl... | ['Runtime Error', 'Accepted'] | ['s712202279', 's731484270'] | [19992.0, 31924.0] | [472.0, 558.0] | [222, 274] |
p02948 | u540761833 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nN,M = map(int,input().split())\nAB = []\nfor i in range(N):\n a,b = list(map(int,input().split()))\n AB.append([-b,a])\nwork = [0 for i in range(M)]\nfor i in range(1,M+1):\n AB2 = list(filter(lambda x:x[1]<=i+1,AB))\n heapq.heapify(AB2)\n if not AB2:\n continue\n b,a = heapq.he... | ['Wrong Answer', 'Accepted'] | ['s057884351', 's501879201'] | [22996.0, 17600.0] | [2108.0, 456.0] | [373, 369] |
p02948 | u552192779 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nn, m = map(int,input().split())\njoblist = {}\nfor i in range(n):\n a,b = map(int,input().split())\n if a in joblist:\n joblist[a].append(-1*b)\n else:\n joblist[a] = [-1*b]\n\nkouho = []\n \nans =0\n \nfor i in range(1,m+1):\n if i in joblist:\n for j in joblist[i]:\n... | ['Runtime Error', 'Accepted'] | ['s894018017', 's814895535'] | [26020.0, 26020.0] | [423.0, 437.0] | [388, 401] |
p02948 | u552357043 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nN, M = map(int, input().split())\nl = [0 for i in range(N)]\n\nfor i in range(N):\n A, B = map(int, input().split())\n l[i] = [A,-B]\nl.sort()\n\ntmp = []\nans = 0\n\nfor i in range(1, M + 1):\n while l[i][0] <= i:\n heapq.heappush(tmp, l[i])\n ans -= heapq.heappop(tmp)[1]\nprint(an... | ['Runtime Error', 'Accepted'] | ['s601414201', 's912237269'] | [70576.0, 32908.0] | [2108.0, 767.0] | [303, 457] |
p02948 | u571291090 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\ndef main(n,m,c):\n cost_map = dict([(i, [])for i in range(1,m+1)])\n print(cost_map)\n for a, b in c:\n if a <= m:\n cost_map[a].append(b)\n \n hp =[]\n ret = 0\n for i in range(1, m+1):\n costs = cost_map[i]\n [heapq.heappush(hp, -c) for c in cos... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s465345915', 's639598254', 's499820570'] | [56224.0, 55072.0, 55072.0] | [623.0, 617.0, 593.0] | [593, 573, 573] |
p02948 | u572142121 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nN, M = map(int, input().split())\nX = sorted([list(map(int, input().split())) for _ in range(N)], key = lambda x: x[0])\n\nhq = []\nans, j = 0, 0\n\nfor i in range(1, M + 1): \n while (j < N) and (X[j][0] <= i):\n heappush(hq, -X[j][1]) \n j += 1\n if len(hq):\n ans += -heappo... | ['Runtime Error', 'Accepted'] | ['s313399373', 's453820890'] | [29848.0, 31976.0] | [401.0, 554.0] | [323, 509] |
p02948 | u578850957 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N_baito,M_days = map(int,input().split())\nbaitoList = np.array([list(map(int,input().split())) for i in range(N_baito)])\nworkList = []\nhosyu = 0\nfor day in range(M_days+1):\n workList.extend(baitoList[baitoList[:,0]==day][:,1].tolist())\n workList.sort(reverse=True)\n if workList:\n hosyu += workL... | ['Runtime Error', 'Accepted'] | ['s983204845', 's110604329'] | [3060.0, 18376.0] | [18.0, 439.0] | [354, 426] |
p02948 | u580199868 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["Copy\n# -*- coding: utf-8 -*-\n \n \ndef main():\n \n from heapq import heappush, heappop\n \n n, m = map(int, input().split())\n jobs = [[] for _ in range(m)] \n \n # See:\n # https://www.youtube.com/watch?v=1Z6ofKN03_Y\n for i in range(n):\n ai, bi = map(int, input().split())\n \n ... | ['Runtime Error', 'Accepted'] | ['s045977420', 's049814868'] | [3064.0, 17600.0] | [17.0, 413.0] | [1466, 1433] |
p02948 | u593019570 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nn,m = map(int,input().split())\n\na = [[] for i in range(100000)]\nd = []\nheapq.heapify(d)\n\nfor _ in range(n):\n b,c = map(int,input().split())\n a[b-1].append(-1 * c)\n\n#print(a)\n\nans = 0\nfor i in range(m):\n for j in range(len(a[i])):\n heapq.heappush(d,a[i][j])\n if d == [... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s454502631', 's673069496', 's706109876'] | [17856.0, 17476.0, 17856.0] | [461.0, 459.0, 476.0] | [356, 321, 346] |
p02948 | u594244257 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import heappush, heappop\n\ndef solve():\n N, M = map(int , input().split())\n arbeit_A_B = list(list(map(int , input().split())) for _ in range(N))\n arbeit_A_B = sorted(arbeit_A_B, key=lambda x: (x[0], -x[1]))\n \n day = 1\n result = 0\n index_arbeit = 0\n heap_q = []\n while d... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s384103401', 's424343108', 's780116147'] | [39372.0, 3064.0, 39388.0] | [577.0, 18.0, 674.0] | [637, 624, 660] |
p02948 | u595289165 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n, m = map(int, input().split())\nr = [list(map(int, input().split())) for i in range(n)]\nr.sort(key=lambda x: x[1], reverse=True)\nrev = 0\nprint(r)\n#day j\nfor j in range(m):\n if len(r) == 0:\n break\n for i in r:\n if i[0] <= m-j:\n rev += i[1]\n r.remove(i)\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s627135321', 's698607489', 's075850468'] | [32628.0, 32628.0, 24192.0] | [2105.0, 2105.0, 314.0] | [361, 327, 424] |
p02948 | u597622207 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N,M = list(map(int, input().split()))\nX = [list(map(int, input().split())) for i in range(N)]\n\nl = M\nresult = 0\nwhile l > 0:\n index_lis = [i for i, v in enumerate(X) if v[1] == max(X, key=lambda xx: xx[1])[1]]\n if len(index_lis) >= 2:\n a = max(X, key=lambda xx: xx[index_lis][0])\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s378177717', 's573390807'] | [29252.0, 17208.0] | [2105.0, 387.0] | [459, 782] |
p02948 | u598229387 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from collections import defaultdict\nimport heapq\nn,m=map(int,input().split())\ndic=defaultdict(list)\nfor i in range(n):\n a,b=map(int,input().split())\n dic[a]+=[-b]\n \nli=[]\nans=0\nprint(dic)\nfor i in range(1,m+1):\n if dic[i]:\n for j in dic[i]:\n heapq.heappush(li,j)\n if li:... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s443895731', 's837178693', 's705352720'] | [32408.0, 3316.0, 43840.0] | [553.0, 20.0, 520.0] | [346, 336, 353] |
p02948 | u598812605 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import copy\nn, m = map(int, input().split())\nab_lis = []\nfor i in range(n):\n ab_lis.append(list(map(int, input().split())))\ndef rec(ab_lis, path, rew, r_day, m_ans):\n if r_day == 0:\n m_ans[0] = max(m_ans[0], rew)\n return\n for t_lis in ab_lis:\n if t_lis in path:\n con... | ['Runtime Error', 'Accepted'] | ['s682384731', 's105255345'] | [27836.0, 27880.0] | [382.0, 498.0] | [597, 398] |
p02948 | u600402037 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import sys\nfrom heapq import heappush, heappop\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nN, M = lr()\nworks = [[] for _ in range(M+1)]\n\nfor _ in range(N):\n a, b = lr()\n works[a].append(b)\n\ncand = []\nanswer = 0\nfor i in range(1, M... | ['Runtime Error', 'Accepted'] | ['s246244211', 's817478612'] | [23492.0, 23748.0] | [319.0, 347.0] | [417, 494] |
p02948 | u602773379 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['\ndef input2():\n\treturn map(int,input().split())\n\nn,m=input2()\nAB=[[] for _ in range(m)]\n\n\nfor i in range(n):\n\ta,b=input2()\n\tif a-1 < m: \n\t\tAB[a-1].append(-b) \n\nans=0\nheap=[]\nfor i in range(m):\n\tfor b in AB[i]:\n\t\theapq.heappush(heap,b)\n\t\n\tif len(heap)>0:\n\t\tMAX=heapq.heappop(heap)\n\t\ta... | ['Runtime Error', 'Accepted'] | ['s967320083', 's201408887'] | [22048.0, 39136.0] | [260.0, 416.0] | [451, 866] |
p02948 | u617515020 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nn,m=map(int,input().split())\nab=[[] for _ in range(m+1)]\nfor i in range(n):\n a,b=map(int,input().split())\n if a<=m:\n a[i].append(-b)\n\ncand=[]\nheapq.heapify(cand)\nans=0\nfor i in range(1,m+1):\n for j in range(len(ab[i])):\n heapq.heappush(cand,ab[i][j])\n if len(cand)>0:\n ans-=hea... | ['Runtime Error', 'Accepted'] | ['s409186025', 's401085285'] | [10312.0, 17604.0] | [294.0, 484.0] | [331, 332] |
p02948 | u623659526 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import logging\n\nlogging.basicConfig(level=logging.INFO, format="%(message)s")\n\n\ndp = [0 for _ in range(100000)]\n\ndef main():\n N, M = map(int, input().split())\n A_B = [list(map(int, input().split()))[::-1] for _ in range(N)]\n logging.info("Hello!")\n\n sorted_A_B = sorted(A_B, reverse=True)\n ... | ['Runtime Error', 'Accepted'] | ['s008915357', 's842384060'] | [26028.0, 32888.0] | [626.0, 660.0] | [541, 635] |
p02948 | u625554679 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nimport numpy as np\n\nN, M = [int(a) for a in input().split()]\n\njobs = [[] for _ in range(M)]\nprint(jobs)\n\nfor _ in range(N):\n a, b = map(lambda x: int(x), input().split())\n print(a, b, M-a)\n if a > M:\n continue\n jobs[M-a].append(b)\n\nheap = []\nans = 0\nfor i in range(M-1, -... | ['Wrong Answer', 'Accepted'] | ['s931422905', 's494342719'] | [30036.0, 27556.0] | [1344.0, 628.0] | [569, 536] |
p02948 | u637207351 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['from heapq import heappush,heappop\n\nN,M = (int(i) for i in input().split())\nC=[0]*N\nT = []\n\nfor i in range(N):\n C[i] = [int(j) for j in input().split()]\n\nC.sort()\nprint(C)\nk = 0\nans = 0\nfor j in range(1,M+1):\n for i in range(k,N):\n if C[i][0] > j:\n k = i\n break\n ... | ['Wrong Answer', 'Accepted'] | ['s074254257', 's133806529'] | [27204.0, 23132.0] | [645.0, 447.0] | [405, 394] |
p02948 | u642012866 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\nN, M = map(int, input().split())\nAB = [list(map(int, input().split())) for _ in range(N)]\n\nAB = sorted(AB, key=lambda x: x[0])\n\nx = 0\nres = 0\n\nhq = []\nheapq.heapify(hq)\n\nfor i in range(M):\n for j in range(x, N):\n if AB[j][0] > i+1:\n x = j\n break\n he... | ['Runtime Error', 'Accepted'] | ['s118996199', 's619962137'] | [161132.0, 30816.0] | [2002.0, 400.0] | [433, 419] |
p02948 | u651803486 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["N, M = map(int, input().split())\n\nab = []\n\nfor _ in range(N):\n ab.append(tuple(map(int, input().split())))\n\n\nl = sorted(ab, key = lambda x: (x[1], x[0]))\n\nans = 0\n\nprint(';;;;;;;')\n\nfor i in range(1, N+1):\n \n while l:\n a, b = l.pop()\n print(a, b)\n \n if i + a-1 ... | ['Wrong Answer', 'Accepted'] | ['s713450713', 's273634990'] | [25252.0, 24248.0] | [613.0, 662.0] | [389, 500] |
p02948 | u652583512 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['import heapq\n\nN, M = map(int, input().split())\ndata = [[int(x) for x in input().split()] for i in range(N)]\ndata.sort(reverse=True, key=lambda x: (-x[0], x[1]))\n\nday = M\nreward = 0\n\n\nq = []\ni = 0\nfor d in range(1, M + 1):\n print(d)\n for t in range(i, N):\n if data[t][0] > d:\n b... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s290399599', 's300720674', 's736955442'] | [32544.0, 32544.0, 32544.0] | [708.0, 587.0, 611.0] | [442, 416, 429] |
p02948 | u654558363 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['\nif __name__ == "__main__":\n n, m = map(int, input().split())\n jobs = []\n for i in range(n):\n job = tuple(map(int, input().split()))\n if job[0] <= m:\n jobs.append(job)\n jobs.sort(key=lambda tup: tup[1], reverse=True)\n income = 0\n daysUsed = -1\n for job in jobs:... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s520083216', 's530842258', 's535854668', 's755064218', 's887309796', 's639408154'] | [18088.0, 21724.0, 18088.0, 18208.0, 18092.0, 18424.0] | [394.0, 461.0, 401.0, 398.0, 406.0, 535.0] | [510, 634, 586, 595, 584, 612] |
p02948 | u656341025 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['N, M = map(int, input().split())\nAB = [[] for _ in range(M + 10)]\nans = 0\nfor _ in range(N):\n a, b = map(int, input().split())\n if a > m:\n continue\n AB[a].append(b)\nimport heapq\nreward = []\nheapq.heapify(reward)\nfor i in range(1, M + 1):\n for item in AB[i]:\n heapq.heappush(reward, -item)\n if ... | ['Runtime Error', 'Accepted'] | ['s960784741', 's997985105'] | [10288.0, 18472.0] | [37.0, 428.0] | [355, 355] |
p02948 | u657913472 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ["from heapq import*\nN,M,*t=map(int,open(0).read().split())\nv=[[]for _ in'_'*M]\nfor i in range(N):\n\tif M<t[2*i]:v[t[2*i]-1]+=[t[2*i+1]]\nz=0\nq=[]\nfor i in v:\n\tfor j in i:heappush(q,-j)\n\tz-=len(q)and heappop(q)\nprint(z)", "from heapq import*\nN,M,*t=map(int,open(0).read().split())\nv=[[]for _ in'_'*M]\nfor i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s323707355', 's557070485', 's396842253'] | [24932.0, 24932.0, 57700.0] | [117.0, 223.0, 559.0] | [215, 215, 191] |
p02948 | u665038048 | 2,000 | 1,048,576 | There are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it. You can take and complete at most one of these jobs in a day. However, you cannot retake a job that you have already done. Find the maximum total reward that you can ea... | ['n, m = map(int, input().split())\na_b = []\nfor i in range(n):\n a_b.append(list(map(int, input().split())))\na_b = sorted(a_b, key=lambda x:x[1], reverse=True)\nans = 0\nfor i in range(m):\n ans += a_b[i][1]\nprint(ans)', 'import heapq\nn, m = map(int, input().split())\na_b = [[] for _ in range(m)]\nfor i in r... | ['Runtime Error', 'Accepted'] | ['s596671086', 's652111430'] | [29748.0, 17708.0] | [463.0, 461.0] | [218, 356] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.