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 | u672475305 | 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())\nlst = [list(map(int,input().split())) for _ in range(n)]\n\nlst.sort(key = lambda x:x[0],reverse = True)\nlst.sort(key = lambda x:x[1],reverse = True)\n\ndone = [0 for _ in range(n)]\ngain = 0\n\nfor i in reversed(range(1,m+1)): \n for j in range(n): \n if lst[j][0] <= i and ... | ['Runtime Error', 'Accepted'] | ['s222996275', 's348990808'] | [3064.0, 23752.0] | [17.0, 484.0] | [560, 389] |
p02948 | u682271925 | 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,b = map(int,input().split())\njobs = []\nwhile True:\n try:\n jobs.append(list(map(int,input().split())))\n except:\n break;\nprint(jobs)\nscore = 0\nfor i in range(b):\n max_now = 0\n deli = []\n for j in range(len(jobs)):\n job = jobs[j]\n if job[0] <= i + 1:\n if max_now < job[1... | ['Wrong Answer', 'Accepted'] | ['s891204050', 's076391361'] | [31792.0, 23880.0] | [2105.0, 578.0] | [421, 340] |
p02948 | u686230543 | 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())\njobs = [tuple(map(int, input().split())) for _ in range(n)]\njobs.sort()\n\ni = 0\nworks = []\nreward = 0\nfor d in range(m):\n while i < n and jobs[i][0] <= d + 1:\n heapq.heappush(works, -jobs[i][1])\n i += 1\n if works:\n reward -= heapq.heappop(words)\n... | ['Runtime Error', 'Accepted'] | ['s871380380', 's697381342'] | [16980.0, 20672.0] | [398.0, 522.0] | [316, 316] |
p02948 | u690576712 | 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())\nwork = [list(map(int, input().split())) for i in range(n)]\n#from operator import itemgetter\n\ncount = 0\nfor i in range(1,m+1):\n for j in range(len(work)):\n hit = 0\n if work[j][0] <= i and work[j][1] >= hit:\n hit = work[j][1]\n count += hit\nprint(count)', 'import he... | ['Wrong Answer', 'Accepted'] | ['s012315662', 's514268453'] | [27316.0, 23128.0] | [2105.0, 463.0] | [345, 372] |
p02948 | u693716675 | 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 as hp\n\nn,m =[int(i) for i in input().split()]\nlists = [[] for i in range(m)]\n\nfor _ in range(n):\n a,b = [int(i) for i in input().split()]\n lists[a-1].append(b)\n \nh = []\nans = 0\nfor day in range(m):\n for v in lists[day]:\n hp.heappush(h, -v)\n if h!=None:\n\tans -= hp.heappop(h)\n \np... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s025773081', 's236072910', 's647123986', 's927645897', 's499930954'] | [2940.0, 17480.0, 18376.0, 18384.0, 20424.0] | [18.0, 364.0, 427.0, 422.0, 486.0] | [312, 299, 314, 299, 367] |
p02948 | u698176039 | 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())\nAB = [list(map(int,input().split())) for _ in range(N)]\nimport heapq\nAB.sort()\nheap = []\nheapq.heapify(heap)\nans = 0\ni = 0\nday = 1\nwhile i < N and day <= M:\n while AB[i][0] <= day:\n heapq.heappush(heap,-AB[i][1])\n i += 1\n day += 1\n if not(heap):con... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s282202530', 's487889420', 's635239295', 's298001572'] | [31672.0, 28604.0, 31896.0, 31596.0] | [606.0, 473.0, 2105.0, 606.0] | [351, 318, 367, 336] |
p02948 | u700805562 | 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)]\nfor _ in range(n):\n a, b = map(int, input().split())\n if m > a:\n ab[a-1].append(-b)\nheap = []\nans = 0\nfor i in range(m):\n for j in ab[i]:\n heapq.heappush(heap, j)\n if heap:\n res = heapq.heappop(heap... | ['Wrong Answer', 'Accepted'] | ['s862052255', 's372140880'] | [17604.0, 17604.0] | [448.0, 442.0] | [337, 338] |
p02948 | u704001626 | 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... | ['# -*- coding: utf-8 -*-\nn,m = list(map(int,input().split()))\nd = [list(map(int,input().split())) for i in range(n)]\nd.sort(key = lambda x:x[0])\nd.sort(key = lambda x:x[1],reverse=True)\n\nfrom heapq import heappush, heappop\nhq = []\nfor i,ab in enumerate(d):\n heappush(hq,(i,ab))\n\ncur_dat = 1\nret = 0\nwhil... | ['Runtime Error', 'Accepted'] | ['s424577848', 's354408092'] | [37900.0, 28476.0] | [571.0, 760.0] | [453, 569] |
p02948 | u708255304 | 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()) \nhoge = M+1\narubaito = [list(map(int, input().split())) for _ in range(N)] \n\narubaito = sorted(arubaito, key=lambda x: (x[1], x[0]), reverse=True) \nprint(arubaito)\nans = 0\nfor i in range(len(arubaito)):\n if hoge == arubaito[i][0]:\n continue\n if hoge > arubait... | ['Wrong Answer', 'Accepted'] | ['s325834771', 's153392630'] | [39004.0, 19348.0] | [608.0, 990.0] | [550, 584] |
p02948 | u713492631 | 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\nworks = []\nfor _ in range(N):\n works.append(tuple(map(int, input().split())))\n\nworks.sort(key=lambda x: (x[0], -x[1]))\nprint(works)\n\nselected = [(0, 0)] * M\n\nfor i in range(M):\n for work in works:\n if work[0] + i > M+1:\n if selected[i] in works:\... | ['Wrong Answer', 'Accepted'] | ['s983788360', 's291132918'] | [31220.0, 27352.0] | [2105.0, 494.0] | [548, 376] |
p02948 | u715355213 | 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())\nlis = [[] for _ in range(M)]\nsum = 0\nfor i in range(N):\n a,b = map(int,input().split())\n if a-1 < M:\n lis[a-1].append(-b)\nprint(lis)\nimport heapq\nheap = []\nfor i in range(M):\n for e in lis[i]:\n heapq.heappush(heap,e)\n if len (heap) > 0:\n tm... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s074846965', 's761113944', 's856344992'] | [20116.0, 17712.0, 17688.0] | [503.0, 451.0, 458.0] | [366, 353, 355] |
p02948 | u716530146 | 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 =[tuple(map(int,input().split())) for i in range(n)]\nans,memo=0,0\nhq=[]\nAB.sort(key=lambda tup:tup[0])\nfor day in range(m):\n\tfor i in range(memo,n):\n\t\tif AB[i][0]<=(day+1):\n\t\t\theapq.push(hq,AB[i][1])\n\t\t\tmemo+=1\n\t\telse:\n\t\t\tbreak\n\tans += -heapq.... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s222082801', 's549438798', 's794055124', 's617481084'] | [18156.0, 18156.0, 18160.0, 20428.0] | [360.0, 367.0, 533.0, 544.0] | [315, 330, 334, 335] |
p02948 | u720384347 | 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 = input().split()\nN,M = int(N),int(M)\nf_start = [0 for i in range(N)]\nA,B = [],[]\nfor i in range(N):\n a,b = input().split()\n a,b = int(a),int(b)\n A.append(a)\n B.append(-b)\n \ndef add(q_,add_):\n for i in range(len(add_)):\n heapq.heappush(q_,add_[i])\n\ndef kouho(A,B,m):\n kou... | ['Runtime Error', 'Accepted'] | ['s367482177', 's232955596'] | [11828.0, 23128.0] | [282.0, 481.0] | [625, 685] |
p02948 | u735891571 | 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_list = [list(map(int,input().split())) for i in range(N)]\ncheck = [0]*N\nB = 0\nflag = 0\npayment = 0\nfor i in range(1, M+1):\n for j in range(0, N):\n if (AB_list[j][0] <= i) and (check[j] == 0) and (AB_list[j][1] > B):\n B = AB_list[j][1]\n c ... | ['Wrong Answer', 'Accepted'] | ['s783010537', 's702292457'] | [40508.0, 22112.0] | [2109.0, 201.0] | [473, 418] |
p02948 | u736524428 | 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\nfrom collections import deque\n\nN, M = map(int,input().split())\n\nwork = [list(map(int,input().split())) for _ in range(N)]\n\nwq = deque(sorted(work))\n\npaytree = []\n\nans = 0\n\nfor day in range(M + 1):\n while len(wq) > 0 and wq[0][0] <= day:\n heapq.heappop(paytree, wq.popleft()[1] * (... | ['Runtime Error', 'Accepted'] | ['s503863682', 's907147634'] | [29216.0, 32320.0] | [476.0, 607.0] | [382, 383] |
p02948 | u751724075 | 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... | ['class UnionFind:\n\tdef __init__(self, n):\n\t\tself.groups = [g for g in range(n)]\n\n\tdef get_root(self, i):\n\t\tparent = self.groups[i]\n\t\tif parent == i:\n\t\t\treturn parent\n\t\telse:\n\t\t\troot = self.get_root(parent)\n\t\t\tself.groups[i] = root\n\t\t\treturn root\n\t\n\tdef set_root(self, i, root):\n\t\... | ['Runtime Error', 'Accepted'] | ['s004123126', 's238334086'] | [21796.0, 21796.0] | [715.0, 767.0] | [1374, 1350] |
p02948 | u756829954 | 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 p_d():\n n, m = map(int, input().split())\n ab = [tuple(map(int, input().split())) for _ in range(n)]\n sorted(ab)\n ans = 0\n\n for i in range(1, m + 1):\n idx = -1\n max_value = -1\n for j in range(len(ab)):\n if ab[j][0] <= m:\n if max_value <= ab[j... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s018314828', 's061015115', 's295728061', 's432429547', 's655415219', 's688775521', 's714990874', 's610647320'] | [17708.0, 3064.0, 2940.0, 20756.0, 17752.0, 3316.0, 3064.0, 20680.0] | [2104.0, 18.0, 17.0, 497.0, 1966.0, 21.0, 18.0, 476.0] | [552, 967, 464, 424, 541, 1005, 513, 420] |
p02948 | u759721333 | 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())\nwork_list = [list(map(int, input().split())) for _ in range(n)]\nwork_cand = []\nsalary = 0\nfor j in range(1, m + 1):\n for i in range(n):\n if work_list[i][0] == j:\n work_cand.append(work_list[i])\n del work_list[i]\n else:\n pass\... | ['Runtime Error', 'Accepted'] | ['s086184708', 's269538772'] | [3064.0, 31912.0] | [17.0, 532.0] | [510, 435] |
p02948 | u761989513 | 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 Counter\n\nn, m = map(int, input().split())\nab = sorted([list(map(int, input().split())) for i in range(n)])\nc = [[]] * m\na, b = ab[0]\nlast = a\nad = [b]\nfor i in range(1, n):\n a, b = ab[i]\n if a == last:\n ad.append(b)\n else:\n if last <= m:\n c[last ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s775787605', 's882989863', 's920378823', 's429582641'] | [34440.0, 34824.0, 34480.0, 34368.0] | [588.0, 2105.0, 553.0, 690.0] | [544, 544, 557, 532] |
p02948 | u767664985 | 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\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\nfor _ in range(N):\n A, B = map(int, input().split())\n\nhq = []\nans = 0\n\nfor i in range(1, M + 1):\n while j < N and A[j] <= i:\n heapq.heappush(hq, -B[j])\n j += 1\n if len(hq):\n ans -= heapq.... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s400360953', 's931451768', 's857368900'] | [3060.0, 40752.0, 31976.0] | [121.0, 2106.0, 560.0] | [326, 459, 475] |
p02948 | u772311880 | 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 queue import PriorityQueue\n\n\ndef main():\n N, M = map(int, input().split(\' \'))\n jobs = [[] for _ in range(M + 1)]\n for i in [input() for i in range(N)]:\n A, B = map(int, i.split(\' \'))\n if A > M:\n continue\n jobs[A].append(B)\n\n pq = PriorityQueue()\n re... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s382347465', 's598504405', 's932477414', 's714015790'] | [25536.0, 25540.0, 25540.0, 25544.0] | [916.0, 882.0, 1113.0, 906.0] | [515, 521, 557, 509] |
p02948 | u773265208 | 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 = []\nb = []\nl = []\nans = 0\ncount = 0\n\nfor i in range(n):\n\ta_dash,b_dash = map(int,input().split())\n\ta.append(a_dash)\n\tb.append(b_dash)\n\nc = zip(a,b)\nc = sorted(c)\na,b = zip(*c)\na = list(a)\nb = list(b)\n\nfor i in reversed(range(m)):\n\tfor j in range(count,len(a)):\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s173466522', 's770800838', 's910244670'] | [151308.0, 43144.0, 18352.0] | [2105.0, 2110.0, 511.0] | [532, 609, 350] |
p02948 | u777283665 | 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 heappop, heappush\n\nn, m = map(int, input().split())\n\ntask_list = []\n\nfor _ in range(n):\n a, b = map(int, input().split())\n task_list.append((a, b))\n\ntask_list = sorted(task_list, key = lambda x: x[0])\n\nhq = []\nans, j = 0, 0\n\nprint(task_list)\n\nfor i in range(1, m+1):\n while j < n... | ['Wrong Answer', 'Accepted'] | ['s001223643', 's087123174'] | [21924.0, 20424.0] | [570.0, 518.0] | [424, 406] |
p02948 | u787456042 | 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\nn, m = map(int, input().split())\nabab = [list(map(int, input().split())) for _ in range(n)]\nabab = sorted(sorted(abab, key=itemgetter(0), reverse=True), key=itemgetter(1), reverse=True)\n\ngyara = [0 for _ in range(m+1)]\n\nfor a, b in abab :\n for i in range(a, m+1) :\n i... | ['Wrong Answer', 'Accepted'] | ['s079574808', 's533275617'] | [30456.0, 39664.0] | [2105.0, 492.0] | [401, 330] |
p02948 | u788068140 | 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 calculate(arr,M):\n sum = 0\n for i in range(M):\n index = 0\n value = 0\n for j in range(len(arr)):\n lastDay = i + arr[j][0]\n if lastDay <= M:\n # if arr[j][1] > value:\n # index = j\n # value = arr[j][1]\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s032475763', 's360285138', 's659420118', 's755847229', 's981960422', 's887009500'] | [2940.0, 29840.0, 29816.0, 19512.0, 19524.0, 32736.0] | [17.0, 396.0, 255.0, 2105.0, 436.0, 341.0] | [789, 1093, 1130, 830, 751, 1130] |
p02948 | u790710233 | 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())\nls = [[int(x) for x in input().split()] for _ in range(N)]\n\nq = [[] for _ in range(M)]\nfor a, b in ls:\n if a <= M:\n q[M-a].append(b*-1)\n\n# print(q)\n\nfrom heapq import heappop\n\npool = []\nanswer = 0\nfor x in reversed(q):\n pool.extend(sorted(x))\n m = heapp... | ['Runtime Error', 'Accepted'] | ['s807065315', 's884690294'] | [35812.0, 37416.0] | [468.0, 531.0] | [349, 376] |
p02948 | u794753968 | 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())\nW = {}\nfor _ in range(N):\n a,b = map(int, input().split())\n if a in W:\n W[a].append(b)\n else:\n W[a] = [b]\n\nans = 0\nfor i in range(1, M+1):\n for j in range(1, i):\n if j in W.keys():\n ans += max(W[j])\n W[j].remove(max(W[j]))\nprint(ans)', 'import heap... | ['Runtime Error', 'Accepted'] | ['s913528113', 's331804294'] | [25936.0, 26060.0] | [2104.0, 550.0] | [288, 420] |
p02948 | u813953440 | 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(map(int,input().split())) for _ in range(N)]\n\n\nd_AB = {a:[] for a,b in AB}\nfor a,b in AB:\n d_AB[a].append(-b)\n\nH = [0]\nmoney = 0\nfor i in range(1,M+1):\n if i in d_AB.keys():\n H += d_AB[i]\n #else:\n #H += [0]\n #print(H)\n... | ['Runtime Error', 'Accepted'] | ['s108374748', 's365686470'] | [42908.0, 42908.0] | [2106.0, 576.0] | [365, 389] |
p02948 | u814475088 | 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\n\nN, M = map(int, input().split())\n\nlist = [list(map(int, input().split())) for _ in range(N)]\n\n\nlist.sort(key = lambda x: x[0])\nprint(list)\nans = 0\nheap = []\nfor day in range(1,M+1):\n\tfor i in list:\t\t\n\t\tif i[0] == day:\n\t\t... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s356294272', 's930107350', 's061091084'] | [32736.0, 294152.0, 27104.0] | [2105.0, 2121.0, 470.0] | [406, 352, 384] |
p02948 | u814781830 | 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\ndp = [0] * (M+1)\nfor i in range(1, M+1):\n tmp = 0\n idx = 0\n for idxab, ab in enumerate(AB):\n if ab[0] <= i:\n if tmp < ab[1]:\n idx = idxab\n tmp = max(tmp, ab[1])\n ... | ['Wrong Answer', 'Accepted'] | ['s303954531', 's710920386'] | [29592.0, 28080.0] | [2105.0, 607.0] | [371, 357] |
p02948 | u814986259 | 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 i in range(N):\n AB[i] = list(map(int,input().split()))\n\n\nAB = sorted(AB,key= lambda x:x[1],reverse=True)\nreward = 0\nAB = sorted(AB[:M],reverse = True) + AB[M:]\nwhile(1):\n if M == 0 or len(AB) == 0:\n break\n if AB[0][0] >= M:\n AB.pop... | ['Wrong Answer', 'Accepted'] | ['s429866961', 's188085341'] | [29772.0, 38040.0] | [2105.0, 491.0] | [414, 375] |
p02948 | u820047642 | 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 Lib import heapq\nHeappop=heapq.heappop\nHeappush=heapq.heappush\nN,M=map(int,input().split())\nL=[]\nfor _ in range(N):\n a,b=map(int,input().split())\n L.append([a,-b])\nL.sort()\nq=[0]*10**5\nans=0\nd=1\nmemo=0\nwhile d<=M:\n while memo<=N-1:\n a,b=L[memo]\n if d<a:\n break\n... | ['Runtime Error', 'Accepted'] | ['s321574188', 's183713240'] | [3064.0, 20908.0] | [17.0, 644.0] | [399, 390] |
p02948 | u821284362 | 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\nimport time\nimport heapq\n\n\n\n\nN,M = map(int,input().split(" "))\n\n\n\nA = []\nB = []\nfor _ in range(N):\n a,b = map(int,input().split(" "))\n A.append(a)\n B.append(-b)\n\n\nind_sorted = sorted(range(N), key = lambda x:A[x])\ntmp_a = 0\ntmp_b_ls = [0]\nmoney = 0\ntmp_ind = 0\nfor i in r... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s319102272', 's756470081', 's931578243', 's858003010'] | [16692.0, 108968.0, 3064.0, 16692.0] | [369.0, 2104.0, 17.0, 508.0] | [927, 764, 749, 935] |
p02948 | u833543158 | 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\nimport heapq\n\nN, M = list(map(int, input().split()))\npossiblyValidJobs = {}\nfor line in sys.stdin:\n A, B = map(int, line.split())\n if A > M:\n continue\n\n if A in possiblyValidJobs:\n possiblyValidJobs[A] += 1\n else:\n possiblyValidJobs[A] = 1\n\nvalidJobsOnThisDay... | ['Runtime Error', 'Accepted'] | ['s294834943', 's141870112'] | [15196.0, 26020.0] | [148.0, 270.0] | [609, 616] |
p02948 | u850516963 | 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\nN = int(input())\ndct = defaultdict(int)\n\nfor i in range(N):\n s = input()\n sorted_s = "".join(sorted(s))\n dct[sorted_s] += 1\n\nans = 0\nfor k, v in dct.items():\n ans += v*(v-1)//2\n\nprint(ans)', 'from collections import defaultdict\nimport heapq\nN, M = map(int, input(... | ['Runtime Error', 'Accepted'] | ['s233302541', 's605624028'] | [3316.0, 27680.0] | [20.0, 544.0] | [228, 365] |
p02948 | u864213970 | 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\nsys.setrecursionlimit(10 ** 6)\n\ninputs = [int(x) for x in input().split()]\nn, m = inputs[0], inputs[1]\nconditions = {}\nfor i in range(n):\n inputs = [int(x) for x in input().split()]\n if inputs[0] in conditions.keys():\n conditions[inputs[0]].append(inputs[1])\n else:\n conditions[inputs[0]... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s002751148', 's046242354', 's139212102', 's673252697', 's996990685', 's198317713'] | [25980.0, 25020.0, 28880.0, 25996.0, 22852.0, 26468.0] | [431.0, 2105.0, 465.0, 425.0, 2105.0, 603.0] | [785, 423, 758, 741, 547, 539] |
p02948 | u866124363 | 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] for _ in range(N)]\n\nprint(AB)\n\nfor n in range(N):\n AB[n][0], AB[n][1] = map(int, input().split())\n AB[n][1] = 0 - AB[n][1]\nAB.sort()\n\nearn = 0\nfor m in range(1, M+1):\n max_earn = 0\n max_i = 0\n for i in range(len(AB)):\n if m < AB[i][0] ... | ['Wrong Answer', 'Accepted'] | ['s200191808', 's397785917'] | [22740.0, 17604.0] | [2105.0, 435.0] | [527, 352] |
p02948 | u868628468 | 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())\nA = [[] for i in range(10**5+1)]\n\nfor i in range(M):\n a, b = map(int,input().split())\n A[a].append(-b)\n\nwork_cand = []\nsum = 0\n\nfor i in range(M+1):\n add_jobs = A[i]\n if len(add_jobs) != 0:\n for j in add_jobs:\n heapq.heappush(wo... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s218006390', 's522081368', 's609662896', 's694091467'] | [17736.0, 10312.0, 17704.0, 17864.0] | [448.0, 41.0, 340.0, 460.0] | [419, 453, 361, 453] |
p02948 | u872887731 | 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 heappop,heappush\nfrom collections import defaultdict\nn,m = map(int,input().split())\nab = [list(map(int,input().split())) for _ in range(n)]\nab_sort = sorted(ab,key=lambda x:x[0])\nh_queue = []\nj = 0\nans = 0\nfor i in range(1,m+1):\n while (j < n) and (ab_sort[j] <= i):\n heappush(h_q... | ['Runtime Error', 'Accepted'] | ['s565006616', 's404239930'] | [30056.0, 33596.0] | [395.0, 549.0] | [405, 413] |
p02948 | u886747123 | 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())\nincome = [[] for _ in range(M+1)] \nfor _ in range(N):\n a, b = map(int, input().split())\n if a <= M:\n income[a].append(-b)\n\n\nans = 0\ntmp = []\nfor rest_days in range(1, M+1):\n tmp += income[rest_days]\n heapq.heapify(tmp)\n if tmp:\n ... | ['Runtime Error', 'Accepted'] | ['s485286342', 's511211104'] | [3064.0, 17604.0] | [17.0, 430.0] | [567, 597] |
p02948 | u888337853 | 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 math\nimport copy\nimport sys\nimport fractions\nimport numpy as np\nfrom functools import reduce\nimport statistics\nimport heapq\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**6)\n\n# ===FUNCTION===\n\ndef getInputInt():\n inputNum = int(input())\n return inputNum\n\n\ndef getInputListInt():\... | ['Runtime Error', 'Accepted'] | ['s202165045', 's864324904'] | [46760.0, 47644.0] | [2113.0, 624.0] | [1260, 1310] |
p02948 | u893063840 | 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... | ['# -*- coding: utf-8 -*-\n\ndef my_sort(word):\n sorted_word_list = sorted(word)\n sorted_word = ""\n for letter in sorted_word_list:\n sorted_word += letter\n return sorted_word\n\nn = int(input())\nwords = {}\nfor i in range(n):\n word = my_sort(input())\n if word in words.keys():\n w... | ['Runtime Error', 'Accepted'] | ['s250964407', 's517293569'] | [3060.0, 31684.0] | [20.0, 689.0] | [382, 642] |
p02948 | u898967808 | 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... | ['ab = sorted(ab, key= lambda x:(x[0]))\n\nfrom heapq import heappush,heappop\n\nn,m = map(int,input().split())\nab = [list(map(int,input().split())) for _ in range(n)]\n\nhq = []\nj = 0\nans = 0\n\nfor i in range(m):\n while j<n and ab[j][0] <= i+1:\n heappush(hq,-ab[j][1])\n j+=1\n if len(hq)>0:\n ans += -... | ['Runtime Error', 'Accepted'] | ['s571999383', 's526563423'] | [3064.0, 31900.0] | [17.0, 568.0] | [333, 332] |
p02948 | u910632349 | 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())\nt=[[0] for _ in range(m)]\nfor i in range(n):\n a,b=map(int,input().split())\n if a>m:\n continue\n t[a-1].append(b)\nh=[]\nfor i in range(m):\n t[i].sort(reverse=True)\n for j in range(min(len(t[i]),m-i)):\n h.append(-t[i][j])\nprint(h)\nhe... | ['Wrong Answer', 'Accepted'] | ['s742062453', 's245950712'] | [30252.0, 24348.0] | [431.0, 291.0] | [381, 287] |
p02948 | u919463386 | 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... | ['# -*- coding: utf-8 -*-\nimport heapq\n\nN, M = map(int, input().split())\nWlist = []\nfor i in range(N):\n A, B = map(int, input().split())\n Wlist.append([A,B])\nWlist.sort(key=lambda x:x[0])\n\nh = []\nAns = 0\nIndex = 0\nfor day in range(1,M+1):\n while Index < N:\n if Wlist[Index][0] <= day:\n ... | ['Runtime Error', 'Accepted'] | ['s458542911', 's242223086'] | [21240.0, 24172.0] | [504.0, 527.0] | [443, 462] |
p02948 | u936985471 | 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())\nw=[]\nfor i in range(n):\n w.append(list(map(int,input().split())))\n\ntotal = 0\nfor i in range(m):\n max=0\n max_j=0\n max_day=0\n \n for j in range(len(w)):\n if w[j][0] <= m-i and w[j][1] > max: \n max = w[j][1]\n max_j=j\n max_day=w[j][0]\n elif w[j][0] <=... | ['Runtime Error', 'Accepted'] | ['s307852405', 's816149375'] | [27336.0, 31960.0] | [403.0, 230.0] | [677, 385] |
p02948 | u939581910 | 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={}\nfor i in range(M+1):\n x[i]=[]\nfor i in range(N):\n a,b=map(int,input().split())\n if a>=M:\n continue\n x[a].append(-b)\ny=[]\nan=0\nfor i in range(M+1):\n for n in x[i]:\n heapq.heappush(y,n)\n try:\n an-=heapq.heappop(y)\n ... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s263356571', 's390199705', 's556875401', 's780340263', 's161441325'] | [26088.0, 2940.0, 25960.0, 20716.0, 26088.0] | [479.0, 17.0, 372.0, 112.0, 461.0] | [332, 364, 317, 334, 331] |
p02948 | u952491523 | 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\nn,m = map(int,input().split())\ndic = {}\n\nfor i in range(n):\n a,b = map(int,input().split())\n if b in dic:\n pass\n else:\n dic[b] = []\n \n dic[b].append(a)\n \ndic = dict(sorted(dic.items(),key=lambda x: -x[0]))\n\ncount = 0\n\nfor key in dic.keys():\n lst = dic[key]\n lst = sorted(l... | ['Wrong Answer', 'Accepted'] | ['s408087977', 's792239342'] | [10436.0, 45404.0] | [446.0, 548.0] | [487, 435] |
p02948 | u960552358 | 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... | ['# D - Summer Vacation\n\n_input = list(map(int, input().split()))\nn = _input[0]\nm = _input[1]\njobs = dict()\nfor i in range(n):\n __input = list(map(int, input().split()))\n a = __input[0]\n b = __input[1]\n item = jobs[b] if b in jobs else list()\n item.append(a)\n item.sort(reverse=True)\n j... | ['Runtime Error', 'Accepted'] | ['s561815461', 's803583858'] | [10156.0, 33072.0] | [594.0, 519.0] | [577, 738] |
p02948 | u962138444 | 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... | ['#coding utf-8\nimport heapq\nN,M=map(int,input().split())\nAB= [[int(i) for i in input().split()] for i in range(N)]\nAB.sort(reverse=True)\nwork=[]\nheapq.heapify(work)\nans=0\nfor i in range(1,M+1):\n while AB and AB[-1][0] <=i:\n tmp=AB.pop()\n heapq.heappush(work,-tmp[1])\n if work:\n tmp=heapq.hea... | ['Wrong Answer', 'Accepted'] | ['s992879555', 's422727554'] | [21804.0, 21804.0] | [547.0, 548.0] | [328, 342] |
p02948 | u968846084 | 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())\ns=[]\nfor i in range(N):\n s.append(list(map(int,input().split())))\na=sorted(s,key=lambda x:x[1],reverse=True)\nb=sorted(a,key=lambda x:x[0])\nprint(b)\ndate=M-1\nd=1\nc=0\nwhile date>=0:\n if b[0][0]==d:\n c=c+b[0][1]\n \n \n \n date=date-1\n d=d+1\nprint(c)', 'import heapq\n... | ['Wrong Answer', 'Accepted'] | ['s906052604', 's837949604'] | [34676.0, 31256.0] | [575.0, 709.0] | [282, 328] |
p02948 | u981931040 | 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 = [list(map(int , input().split())) for _ in range(N)]\njobs.sort()\n\nq = []\nindex = 0\nans = 0\nfor limit in range(1 , M + 1):\n while index < N:\n time =jobs[index][0]\n reward = jobs[index][1]\n if limit >= time:\n heapq.he... | ['Runtime Error', 'Accepted'] | ['s183899464', 's014110858'] | [161828.0, 31596.0] | [2106.0, 609.0] | [475, 476] |
p02948 | u982591663 | 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... | ['# ABC-137-D\nimport heapq\nN, M = map(int, input().split())\nBA = []\nfor _ in range(N):\n A, B = map(int, input().split())\n BA.append((-1*B, A))\nheapq.heapify(BA)\n\nans = 0\ncheck_M = 1\nwhile check_M <= M:\n try:\n max_B = heapq.heappop(BA)\n except:\n break\n if max_B[1] <= check_M:... | ['Wrong Answer', 'Accepted'] | ['s223881736', 's544390856'] | [16712.0, 18564.0] | [496.0, 447.0] | [366, 483] |
p02948 | u987164499 | 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\nfrom sys import stdin\n\nn,m = map(int,stdin.readline().rstrip().split())\njobs = [[] for i in range(m)]\n\nfor i in range(n):\n tmp,tmp2 = map(int,stdin.readline().rstrip().split())\n if(tmp>m):\n continue\n jobs[m-tmp].append(tmp2)\nprint(jobs)\nans = 0\nh=[]\nfor i in range(m-1,-1,-1)... | ['Runtime Error', 'Accepted'] | ['s879942643', 's515983988'] | [151504.0, 18620.0] | [2104.0, 307.0] | [446, 421] |
p02948 | u993435350 | 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 + 1)]\n\nfor i in range(N):\n a,b = map(int,input().split())\n if a <= M:\n L[a].append(-b)\n\nwork = []\nheapq.heapify(work)\nans = 0\n\nfor i in range(M,-1,-1):\n for j in range(len(L[i])):\n heapq.heappush(work,L[i][j])\n \n if le... | ['Wrong Answer', 'Accepted'] | ['s021139872', 's141664778'] | [17732.0, 17604.0] | [513.0, 475.0] | [358, 356] |
p02948 | u995102075 | 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())\ncase = []\nfor i in range(N):\n AB = [int(i) for i in input().split()]\n if AB[0] <= M:\n case.append(AB)\n else:\n N -= 1\n\ncase.sort(key=lambda x: (-x[1], x[0]))\nprint(case)\n\nans = 0\ncount, shortest = 0, M\nfor i in range(N):\n if case[i][0] <= M - co... | ['Wrong Answer', 'Accepted'] | ['s412172206', 's440070551'] | [35900.0, 26856.0] | [623.0, 497.0] | [471, 429] |
p02949 | u021548497 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['import sys\nimport numpy as np\nfrom scipy.sparse.csgraph import bellman_ford\nfrom scipy.sparse import csr_matrix\nfrom collections import deque\ninput = sys.stdin.readline\n\n\ndef main():\n n, m, p = map(int, input().split())\n \n inf = 10**9\n l = np.zeros((n, n))\n tree_forth = [[] for _ in range(... | ['Runtime Error', 'Accepted'] | ['s847799820', 's697387440'] | [86792.0, 11404.0] | [2208.0, 1620.0] | [1421, 2656] |
p02949 | u024807881 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ["def validate(paths, start):\n \n\n valid_paths = {start}\n stack = [start]\n\n while stack:\n v = stack.pop()\n if v not in paths:\n continue\n for w in paths[v]:\n if w in valid_paths:\n continue\n valid_paths.add(w)\n stack.... | ['Runtime Error', 'Accepted'] | ['s924055527', 's422848799'] | [5872.0, 5864.0] | [33.0, 1929.0] | [1914, 1928] |
p02949 | u034128150 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['import sys\nimport numpy as np\nfrom scipy.sparse.csgraph import bellman_ford, connected_components\nfrom scipy.sparse.csgraph._shortest_path import NegativeCycleError\n\ninput = sys.stdin.buffer.readline\nepsilon = 2 ** -26 # > 10 ** -8, which is the smallest cost scipy\'s bellman_ford can deal with. \n\nN, M, P = m... | ['Wrong Answer', 'Accepted'] | ['s540536035', 's589974753'] | [227572.0, 227504.0] | [786.0, 667.0] | [1115, 1101] |
p02949 | u075595666 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['import sys\ninput = sys.stdin.readline\nn,m = map(int,input().split())\nchk = []\nfor i in range(n):\n a,b = map(int,input().split())\n if a <= m:\n chk.append((a,b))\n\nfrom heapq import heappop, heappush\nfrom operator import itemgetter\nchk = sorted(chk,key=itemgetter(0),reverse=True)\n\nq = []\nans = 0\nfor... | ['Runtime Error', 'Accepted'] | ['s827105596', 's312924297'] | [3064.0, 11128.0] | [18.0, 1516.0] | [454, 1196] |
p02949 | u102461423 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['print(-1)', 'print(0)', 'import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nimport numpy as np\n\nN,M,P = map(int,readline().split())\nABC = np.array(read().split(),np.int64)\n\nA = ABC[::3]\nB = ABC[1::3]\nC = ABC[2::3]\n\nC = P-C\n\n\n\nINF = 10... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s104538728', 's725672363', 's065374293'] | [2940.0, 2940.0, 14756.0] | [17.0, 17.0, 1580.0] | [9, 8, 724] |
p02949 | u380524497 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['from scipy.sparse import coo_matrix\nfrom scipy.sparse.csgraph import bellman_ford, NegativeCycleError\nimport sys\ninput = sys.stdin.readline\n\n\ndef main():\n n, m, p = map(int, input().split())\n\n edges = []\n routes = [[] for _ in range(n)]\n rev_routes = [[] for _ in range(n)]\n\n\n def get_reac... | ['Runtime Error', 'Accepted'] | ['s383376444', 's651323929'] | [17400.0, 20228.0] | [548.0, 1584.0] | [1612, 725] |
p02949 | u402629484 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ["import sys\nsys.setrecursionlimit(1000000000)\n\nii = lambda: int(input())\nmis = lambda: map(int, input().split())\nlmis = lambda: list(mis())\n\nN, M, P = mis()\n\nto = [[] for _ in range(N)]\not = [[] for _ in range(N)]\nedges = []\n\nfor i in range(M):\n a,b,c = mis()\n a -= 1\n b -= 1\n c = -(c-P)\n ... | ['Wrong Answer', 'Accepted'] | ['s577752620', 's084721368'] | [4468.0, 5236.0] | [262.0, 1456.0] | [1300, 1486] |
p02949 | u539367121 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ["import sys\nimport numpy as np\nfrom scipy.sparse.csgraph import bellman_ford, NegativeCycleError\nfrom scipy.sparse import csr_matrix\n\nsys.setrecursionlimit(10**5)\n\ndef dfs(s):\n for u in to[s]:\n if not toflag[u]:\n toflag[u]=True\n dfs(u)\n\ndef rdfs(s):\n for u in ot[s]:\n if not otflag[u]:\... | ['Wrong Answer', 'Accepted'] | ['s882616052', 's559871446'] | [287372.0, 40444.0] | [2207.0, 302.0] | [955, 1205] |
p02949 | u581187895 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['import numpy as np\nfrom scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson\nfrom scipy.sparse import csr_matrix\n\ndef get_path(start, goal, pred):\n return get_path_row(start, goal, pred[start])\n\ndef get_path_row(start, goal, pred_row):\n path = []\n i = goal\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s487536011', 's663570896', 's688485005', 's830521463'] | [160452.0, 112072.0, 112076.0, 5236.0] | [986.0, 1037.0, 1010.0, 1456.0] | [1337, 1237, 1198, 1325] |
p02949 | u729133443 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ["\ndef dfs(edge, s):\n use = {s}\n q = [s]\n while q:\n v = q.pop()\n for w in edge[v]:\n if w in use:continue\n use.add(w)\n q.append(w)\n return use\n\n\ndef bellman_ford(v, s, t, e):\n INF = 10**18\n \n d = [INF] * v\n \n d[s] = 0\n \n ... | ['Runtime Error', 'Accepted'] | ['s027555164', 's843083653'] | [3060.0, 5276.0] | [17.0, 1916.0] | [1937, 1938] |
p02949 | u839188633 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['N, M, P = map(int, input().split())\nABC = [tuple(map(int, input().split())) for _ in range(M)]\n\nto_w = [set() for _ in range(N)]\nfor a, b, c in ABC:\n to_w[a - 1].add((b - 1, P - c))\nreachable_from_start = {0}\nQ = {0}\nwhile Q:\n u = Q.pop()\n for v, _ in to_w[u]:\n if v not in reachable_from_st... | ['Wrong Answer', 'Accepted'] | ['s186991301', 's951501853'] | [7404.0, 9184.0] | [56.0, 1921.0] | [1175, 1299] |
p02949 | u858742833 | 2,000 | 1,048,576 | There is a directed graph with N vertices numbered 1 to N and M edges. The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge. Additionally, there is a button on Vertex N. We will play a game on this graph. You start the game on Vertex 1 with zero coins, and head for V... | ['from scipy.sparse import csr_matrix\nfrom scipy.sparse.csgraph import bellman_ford, NegativeCycleError\n\n\ndef main():\n N, M, P = map(int, input().split())\n A, B, C = [0] * M, [0] * M, [0] * M\n for i in range(M):\n a, b, c = map(int, input().split())\n A[i], B[i], C[i] = a - 1, b - 1, P - c... | ['Runtime Error', 'Accepted'] | ['s361826408', 's683315816'] | [17564.0, 26644.0] | [517.0, 430.0] | [516, 1186] |
p02950 | u389910364 | 2,000 | 1,048,576 | Given are a prime number p and a sequence of p integers a_0, \ldots, a_{p-1} consisting of zeros and ones. Find a polynomial of degree at most p-1, f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \ldots + b_0, satisfying the following conditions: * For each i (0 \leq i \leq p-1), b_i is an integer such that 0 \leq b_i \... | ['import os\nimport sys\n\nimport numpy as np\n\nif os.getenv("LOCAL"):\n sys.stdin = open("_in.txt", "r")\n\nsys.setrecursionlimit(10 ** 9)\nINF = float("inf")\nIINF = 10 ** 18\nMOD = 10 ** 9 + 7\n\n\n# MOD = 998244353\n\n\ndef get_factorials(max, mod=None):\n \n ret = [1]\n n = 1\n if mod:\n for... | ['Time Limit Exceeded', 'Accepted'] | ['s043141006', 's018764654'] | [14688.0, 83384.0] | [2113.0, 720.0] | [2476, 2724] |
p02950 | u467736898 | 2,000 | 1,048,576 | Given are a prime number p and a sequence of p integers a_0, \ldots, a_{p-1} consisting of zeros and ones. Find a polynomial of degree at most p-1, f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \ldots + b_0, satisfying the following conditions: * For each i (0 \leq i \leq p-1), b_i is an integer such that 0 \leq b_i \... | ['def lagrange_interpolation(X, Y, mod):\n \n \n n = len(X)\n g = [0]*(n+1)\n g[0] = 1\n for i, x in enumerate(X):\n for j in range(i, -1, -1):\n g[j+1] += g[j] * (-x) % mod\n res = [0]*n\n for x, y in zip(X, Y):\n \n f = g[:]\n denom = 0\n v = 1\n ... | ['Time Limit Exceeded', 'Accepted'] | ['s845341289', 's832383447'] | [14664.0, 28008.0] | [2104.0, 286.0] | [1205, 6892] |
p02952 | u000212387 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n=int(input())\ns=len(str(n))\nc=0\n\nfor i in range(s-1):\n if i%2==1:\n c+=9*10**(s-i-2)\nif s%2==0:\n print(c)\nelse:\n c+=n-10**(s-1)+1\n print(c)', 'n=int(input())\ns=len(str(n))\nc=0\nfor i in range(s-1):\n if i%2==0:\n c+=9*10**i\nif s%2==1:\n c+=n-(10**(s-1)-1)\n\nprint(c)'] | ['Wrong Answer', 'Accepted'] | ['s553330958', 's960079502'] | [3060.0, 2940.0] | [17.0, 17.0] | [158, 131] |
p02952 | u003501233 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N=input()\nans=0\n\nfor i in range(1,n+1):\n if len(str(i)) % 2 == 1:\n ans += 1\nprint(ans)', 'n=input()\nans=0\nfor i in range(1,n+1):\n if len(str(i)) % 2 == 1:\n ans += 1\nprint(ans)', 'N=int(input())\nans=0\n\nfor i in range(1,n):\n if len(str(i)) % 2 == 1:\n ans += 1\nprint(ans)', 'n=input()\nan... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s425411782', 's454889549', 's495409571', 's718979786', 's766077894'] | [2940.0, 2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0, 63.0] | [92, 89, 95, 91, 103] |
p02952 | u007263493 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = input()\nl = int(len(n))\nans = 0\nif l == 1:\n print(n)\nelse:\n for i in range(1,l):\n if i %2 ==1:\n ans += 9*(10**(i-1))\n else:\n ans = ans \nans += int(n) - 10**(l-1)\nprint(ans)\n ', 'n = int(input())\n\nans = 0\nfor i in range(1,n+1):\n if len(str(i)) & 1:\n... | ['Wrong Answer', 'Accepted'] | ['s113031725', 's173174726'] | [2940.0, 2940.0] | [17.0, 58.0] | [223, 100] |
p02952 | u014250021 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = int(input())\nd = 0;aux = n\nwhile(aux>0):\n aux//=10\n d+=1\nans = 0\nif(d&1): ans+= d-10**(d-1)+1\nif(d>1): ans+=10\nif(d>3): ans+=1000\nif(d>5): ans+=100000\nprint(ans)\n', 'n = int(input())\nd = 0;aux = n\nwhile(aux>0):\n aux//=10\n d+=1\nans = 0\n\nif(d&1): ans+= n-10**(d-1)+1\nif(d>1): ans+=9\nif(d>3): ... | ['Wrong Answer', 'Accepted'] | ['s936797921', 's329057552'] | [3060.0, 3060.0] | [17.0, 17.0] | [168, 180] |
p02952 | u015187377 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N = int(input())\nif 10000<=N<=99999:\n print(N-9999+900+9)\nelif 1000<=9999:\n print(909)\nelif 100<=N<=999:\n print(N-99+9)\nelif 10<=N<=99:\n print(9)\nelif N==100000:\n print(90909)\nelse:\n print(N)\n \n\n\n', 'N = int(input())\nif 10000<=N<=99999:\n print(N-9999+909)\nelif 1000<=N<=9999:\n print(909)\n... | ['Wrong Answer', 'Accepted'] | ['s540621401', 's844408088'] | [2940.0, 2940.0] | [17.0, 17.0] | [203, 204] |
p02952 | u020959776 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ["import io\nimport sys\n\nMOD = 10 ** 9 + 7\n\n\ndef IN_S():\n return input()\n\n\ndef IN_I():\n return int(input())\n\n\ndef IN_L_I():\n return list(map(int, input().split()))\n\n\ndef IN_L_S():\n return list(map(str, input().split()))\n\n\ndef STR_SPLIT(s, n):\n for l in range(0, len(s), n):\n yield s[0 + l:... | ['Wrong Answer', 'Accepted'] | ['s107996628', 's345070382'] | [3064.0, 3064.0] | [17.0, 17.0] | [737, 739] |
p02952 | u023229441 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n=int(input())\nans=0\nfor i in range(1,n+1):\n if len(str(n))%2==1:\n ans+=1\nprint(ans)\n', 'n=int(input())\nans=0\nfor i in range(1,n+1):\n\tif len(str(i))%2==1:\n\t\tans+=1\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s745646229', 's901847757'] | [2940.0, 2940.0] | [62.0, 69.0] | [89, 86] |
p02952 | u027557357 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N=int(input())\nans=0\nfor i in range(1,N+1) :\n if len(str(i))%2==0 :\n ans+=0\n print(ans)\n else :\n ans+=1\n print(ans)\nprint(ans)\n ', 'N=int(input())\nans=0\nfor i in range(1,N+1) :\n if len(str(i))%2==0 :\n ans+=0\n else :\n ans+=1\nprint(ans)\n '] | ['Wrong Answer', 'Accepted'] | ['s970366241', 's412735282'] | [4008.0, 2940.0] | [139.0, 57.0] | [165, 127] |
p02952 | u027675217 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = int(input())\ncnt=0\nfor i in range(n):\n\tif len(str(i))%2==1:\n\t\tcnt+=1\nprint(cnt)', 'n = int(input())\ncnt=0\nfor i in range(1,n+1):\n\tif len(str(i))%2==1:\n\t\tcnt+=1\nprint(cnt)\n'] | ['Wrong Answer', 'Accepted'] | ['s763781822', 's290272618'] | [2940.0, 2940.0] | [58.0, 57.0] | [83, 88] |
p02952 | u031722966 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N = int(input())\ni = 0\nr = 0\nwhile i < N:\n if len(str(i)) % 2 == 1:\n r += 1\n i += 1\nprint(r)', 'N = int(input())\ni = 0\nr = 0\nwhile i <= N:\n if len(str(i)) % 2 == 1:\n r += 1\n i += 1\nprint(r)', 'N = int(input())\ni = 1\nr = 0\nwhile i <= N:\n if len(str(i)) % 2 == 1:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s073313058', 's187295685', 's220368839'] | [2940.0, 2940.0, 2940.0] | [69.0, 68.0, 68.0] | [105, 106, 106] |
p02952 | u032222383 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n=int(input())\nc=0\nfor i in range(,n):\n if len(str(i+1))%2!=0:\n c+=1\nprint(c)', 'n=int(input())\nc=0\nfor i in range(n):\n if len(str(i+1))%2!=0:\n c+=1\nprint(c)\n'] | ['Runtime Error', 'Accepted'] | ['s939787285', 's440065408'] | [2940.0, 2940.0] | [18.0, 66.0] | [81, 81] |
p02952 | u035445296 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n =int(input())\nprint(len([i for i in range(1, n+1) if int(log10(i)+1) % 2 != 0 and i <= n]))', 'from math import log10\nn =int(input())\nprint(len([i for i in range(1, n+1) if int(log10(i)+1) % 2 != 0 and i <= n]))'] | ['Runtime Error', 'Accepted'] | ['s676223208', 's583029465'] | [3056.0, 6764.0] | [18.0, 62.0] | [93, 116] |
p02952 | u036412778 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['#another way:\ndef count_digits(n):\n d=0\n while(n>0):\n d += 1\n n = n//10\n return d\nc=0\nfor i in range(1,N+1):\n if (count_digits(i)%2==1):\n c += 1\nprint(c)', 'N=int(input())\n#another way:\ndef count_digits(n):\n d=0\n while(n>0):\n d += 1\n n = n//10\n ... | ['Runtime Error', 'Accepted'] | ['s243255122', 's119492465'] | [2940.0, 3060.0] | [17.0, 86.0] | [186, 202] |
p02952 | u039189422 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ["N = int(input())\nn = len(str(N))\n\nif n==1:\n\tprint(N)\nelse:\n\tM = [9,0]*(n//2)\t\t\t\n M.pop()\t\t\t\t\t\t\n M = map(str,M)\t\t\t\t\n M = int(''.join(M))\t\t\t\n if n%2==0:\n\t\tprint(M)\n\telse:\n\t\tM = M + N - 10**n + 1\n print(M)", 'n=int(input())\nl=len(str(n))\nres=0\nfor i in range(1,l... | ['Runtime Error', 'Accepted'] | ['s041324802', 's637996095'] | [2940.0, 2940.0] | [24.0, 18.0] | [402, 124] |
p02952 | u042385277 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N = int(input())\nk = 0\nfor i in range(1, N+1):\n if 1 =< i < 10:\n k += 1\n if 100 =< i < 1000:\n k += 1\n if 10000 =< i < 100000:\n k += 1\nprint(k)\n', 'N =int(input())\nk = 0\nfor i in range(1, N+1):\n if 1 =< i <10:\n k += 1\n if 100 =< i <1000:\n k += 1\n if... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s046266580', 's342735998', 's354068055', 's368475708', 's818354603'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0, 17.0, 44.0] | [173, 168, 176, 177, 177] |
p02952 | u042716570 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N = int(input())\nl = len(str(N))-1\ncount = 0\nfor digit in range(l//2+1):\n count += len(range(10**(digit*2), min(10**(digit*2+1), N+1)))', 'N = int(input())\nl = len(str(N))-1\ncount = 0\nfor digit in range(l//2+1):\n count += len(range(10**(digit*2), min(10**(digit*2+1), N+1)))\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s599244997', 's376207674'] | [2940.0, 2940.0] | [18.0, 17.0] | [138, 151] |
p02952 | u043039923 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = int(input())\n\none = n % 10\nhund = n // 100\nthou = n // 1000\ncnt = 0\n\nif n < 10:\n cnt += n\n\nelif 100 > n >= 10:\n cnt += 9\n\nelif 1000 > n >= 100:\n cnt += (n - 99) + 9\n\nelif 10000 > n >= 1000:\n cnt += 909\n\nelif 100000 > n >= 10000:\n cnt += (n - 9999) + 909\n\nelif n = 100000:\n ... | ['Runtime Error', 'Accepted'] | ['s367816832', 's262437685'] | [2940.0, 3060.0] | [17.0, 17.0] | [321, 323] |
p02952 | u045408189 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n=int(input())\nlist=filter(lambda x:x%2==1,range(1,n+1))\nprint(list.count())', 'n=int(input())\nlist=filter(lambda x:x%2==1,range(1,n+1))\nprint(len(list))\n', 'n=int(input())\nans=0\nfor i in range(1,n+1):\n if len(str(i))%2==1:\n ans=ans+1\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s213922588', 's644287942', 's106135263'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 63.0] | [76, 74, 91] |
p02952 | u048214692 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | [' n = int(input())\n \n cnt = 0\n for i in range(1, n+1):\n str_n = str(i)\n if len(str_n) % 2 != 0:\n cnt += 1\n \n print(cnt)', 'n = int(input())\n\ncnt = 0\nfor i in range(1, n):\n str_n = str(i)\n print(str_n)\n if len(str_n) % 2 != 0:\n cnt += 1\... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s014534401', 's163079560', 's393884733', 's093251371'] | [2940.0, 3920.0, 3920.0, 2940.0] | [17.0, 121.0, 130.0, 64.0] | [170, 148, 128, 142] |
p02952 | u050914494 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['import math\nn = int(input())\nprint(math.ceil(n/2))\n', 'def get_ander_odds_digits(n):\n return [i for i in range(1, n + 1) if i % 2 == 1]\n\ndef get_number_of_odds(odd_list):\n return sum([9 * 10 ** (i - 1) for i in odd_list])\n\nn = int(input())\nnumber_of_digits = len(str(n))\nanswer = 0\nif number_of_digit... | ['Wrong Answer', 'Accepted'] | ['s049258229', 's554140495'] | [2940.0, 3064.0] | [17.0, 17.0] | [51, 457] |
p02952 | u056659569 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N = int(input())\n ans = 0\nfor i in range(1, N + 1):\n\tif len(str(i)) % 2 == 1:\n\tans += 1\nprint(ans)\n', 'N = int(input())\nans = 0\nfor i in range(1, N + 1):\n\tif len(str(i)) % 2 == 1:\n\t\tans += 1\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s498458427', 's736533779'] | [2940.0, 2940.0] | [17.0, 57.0] | [99, 98] |
p02952 | u062604519 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n=int(input())\nif n/10 < 10:\n print(n)\n exit()\nelif n/10 < 1000:\n print(n-90)\n exit()\nelif n==100000:\n print(90909)\nelse:\n print(n-9090)\n ', 'N = int(input())\nn = len(str(N))\nif n == 1:\n print(N)\nelif n == 2:\n print(9)\nelif n == 3:\n print(N-90)\nelif n == 4:\n print(909)\nelif n == 5:\n ... | ['Wrong Answer', 'Accepted'] | ['s379460440', 's416483470'] | [2940.0, 3060.0] | [17.0, 17.0] | [145, 181] |
p02952 | u066111527 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N = int(input())\ncount = 0\n\nwhile N > 0:\n if N%10 == 0:\n count +=9\n else:\n count +=N%10\n N = N//100 \nprint(count)', 'n = int(input())\n\nif n <10:\n count += n\nelif n <100:\n count += 9\nelif n <1000:\n count += n-90\nelif n < 1000:\n count += 909\nelif n < 10000:\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s416452454', 's593272613', 's913765427'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [139, 245, 205] |
p02952 | u068142202 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = int(input())\nod = len(n)\ni = 0\nfor i in range(1,n +1):\n if od % 2 ==1:\n i += 1\nprint(i) ', 'n = int(input())\nans = 0\nfor i in range(1, n + 1):\n if len(str(i)) % 2 == 1:\n ans += 1\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s758726841', 's064917428'] | [2940.0, 2940.0] | [17.0, 57.0] | [102, 101] |
p02952 | u076996519 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ["n = input()\nl = len(n)\n\n# print(l)\ntemp=''\nans=0\n\nif l==1:\n\t# print(int(n))\nelse:\n\tfor i in range(1,l):\n\t\tif i%2==1:\n\t\t\ttemp='9'\n\t\t\ttemp+='0'*(i-1)\n\t\t\tans+=int(temp)\n\t\t\t# print(ans)\n\n\tif l%2==1:\n\t\tans+=(int(n)-int('9'*(l-1)))\n\nprint(ans)", "n = input()\nl = len(n)\n\n# print(l)\... | ['Runtime Error', 'Accepted'] | ['s836985315', 's453963604'] | [2940.0, 3060.0] | [17.0, 17.0] | [237, 236] |
p02952 | u077075933 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = int(input())\nc=0\nfor r in [i+1 for in range(len(str(n))) if i%2==1]:\n for i in range(10**(r-1), min(n+1, 10**r)):\n c++n\nprint(c)', 'n = int(input())\nc=0\nfor r in [i+1 for i in range(0, len(str(n))) if i%2==0]:\n for i in range(10**(r-1), min(n+1, 10**r)):\n c+=1\nprint(c)\n'] | ['Runtime Error', 'Accepted'] | ['s936877255', 's107588141'] | [2940.0, 2940.0] | [17.0, 26.0] | [136, 142] |
p02952 | u079543046 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = input()\nif 1<=len(n)<=2:\n print(int(n))\nelif 3<=len(n)<=4:\n \n print(10+int(n)-100)\nelif 5<=len(n)<= 6:\n print(110)', 'n = int(input())\ncount = 0\nfor i in range(1, n+1):\n if len(str(i))%2 == 1:\n count+=1\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s495431443', 's076764190'] | [3060.0, 2940.0] | [17.0, 58.0] | [131, 107] |
p02952 | u080477366 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['N = int(input())\ncount = 0\nfor i in range(N + 1):\n if i % 2 == 0:\n continue\n else:\n count += 1\nprint(count)', 'N = int(input())\ncount = 0\nfor i in range(N):\n if i % 2 == 0:\n continue\n else:\n count += 1\nprint(count)', 'N = int(input())\ncount = 0\nfor i in range(1, N+1):\n if len(str(i))... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s081478159', 's784225331', 's550848528'] | [2940.0, 2940.0, 2940.0] | [33.0, 33.0, 60.0] | [115, 111, 126] |
p02952 | u087373960 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['def uneven(number):\n result = []\n for x in range(1, number + 1):\n numberOfDigits = 1\n y = x\n\n if(y >= 100000):\n numberOfDigits = numberOfDigits + 5\n y = y / 100000\n\n if(y >= 10000):\n numberOfDigits = numberOfDigits + 4\n y = y / ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s125384004', 's484002650', 's563190472'] | [3064.0, 3064.0, 2940.0] | [17.0, 17.0, 47.0] | [665, 688, 98] |
p02952 | u088115428 | 2,000 | 1,048,576 | Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros). | ['n = int(input())\nans = 0\nfor i in range(0,n+1):\n if len(str(i))%2 ==1:\n ans+=1\nprint(ans)', 'n = int(input())\nans = 0\nfor i in range(1,n+1):\n if len(str(i))%2 ==1:\n ans+=1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s351784495', 's134890985'] | [2940.0, 3316.0] | [63.0, 64.0] | [99, 99] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.