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
p03032
u686230543
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n, k = map(int, input().split())\nv = list(map(int, input().split()))\nmini = min(n, k)\nvalue = 0\nfor a in range(mini + 1):\n for b in range(mini - a + 1):\n c = k - a - b\n j = v[:a] + v[n-b:]\n j.sort(reverse=True)\n for _ in range(c):\n if j[-1] < 0:\n j.pop()\n else:\n break...
['Runtime Error', 'Accepted']
['s923572278', 's656921457']
[3064.0, 3316.0]
[18.0, 29.0]
[349, 355]
p03032
u687044304
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['# -*- coding:utf-8 -*-\nimport copy\n\ndef solve():\n N, K = list(map(int, input().split()))\n V = list(map(int, input().split()))\n \n ans = 0\n M = min(N,K)\n for l in range(M+1):\n having = []\n for r in range(M+1):\n if l+r > K: break\n if l+r == 0: continue\n...
['Runtime Error', 'Accepted']
['s135436274', 's704904249']
[3700.0, 3188.0]
[31.0, 42.0]
[734, 742]
p03032
u691896522
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n, k = list(map(int, input().split()))\nGem = list(map(int, input().split()))\ngem = []\nMax = Gem[0]\nr = min(n,k)\nfor i in range(r + 1):\n gem = []\n for j in range(r - i + 1):\n gem = Gem[0:i]\n gem += Gem[n - j:n]\n dif = r - (i + j)\n for k in range(dif + 1):\n if le...
['Wrong Answer', 'Accepted']
['s401993126', 's515875590']
[3064.0, 3064.0]
[38.0, 123.0]
[592, 589]
p03032
u692746605
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import heapq\nn,k=map(int,input().split())\nv=[int(x) for x in input().split()]\n\nprint(n,k)\nprint(v)\n\np = list()\nm = min(n,k)\nt = 0\n\nfor h in range(1,m+1):\n for i in range(0,h+1):\n a = b = 0\n p.clear()\n for j in range(0,i):\n if v[j]<0:\n p.append(v[j])\n a += v[j]\n for j i...
['Wrong Answer', 'Accepted']
['s954322279', 's192210201']
[3188.0, 3188.0]
[45.0, 48.0]
[511, 490]
p03032
u696444274
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n, k = list(map(int, input().split()))\nv = list(map(int, input().split()))\nl = 0\nr = 0\na = 0\nm = min(n, k)+1\nhave = []\ntotal = 0\nans = 0\nfor r in range(m):\n for l in range(m-r):\n have = []\n have.append(v[:r])\n if l != 0:\n have.append(v[-l:])\n else:\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s096414199', 's788397829', 's975201797']
[3064.0, 3064.0, 3064.0]
[30.0, 18.0, 32.0]
[576, 554, 574]
p03032
u702582248
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n,k=map(int,input().split())\nv = list(map(int, input().split()))\ncum = [0] * (n+1)\n\nfor i in range(n):\n cum[i+1] = cum[i] + v[i]\n\nans = 0\ncnt = 0\nfor i in range(n):\n for j in range(n):\n if i > j:\n continue\n l = (j - i)\n if n - l > k:\n continue\n a...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s420500204', 's799695579', 's269831888']
[3064.0, 3572.0, 3064.0]
[32.0, 43.0, 30.0]
[597, 804, 484]
p03032
u716530146
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['#!/usr/bin/env python3\nimport sys\ninput = lambda: sys.stdin.readline()[:-1]\nsys.setrecursionlimit(10**8)\n\nn,k=map(int,input().split())\nv1=list(map(int,input().split()))\nv2=v1[::-1]\nr=min(n,k)\nans=0\nfor i in range(r+1):\n for j in range(i+1):\n tmp=v1[:j]+v2[:i-j]\n tmp.sort()\n for k...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s304862320', 's748618830', 's166642658']
[3064.0, 3064.0, 3064.0]
[23.0, 17.0, 30.0]
[418, 481, 418]
p03032
u729133443
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n,k,*v=map(int,open(0).read().split())\nm=0\nfor i in range(n+1):\n for j in range(min(k,n)-i+1):\n t=sorted(v[:i]+v[:~j])\n while t and(k-i-j)*t[0]<0:t.pop(0);j+=1\n m=max(m,sum(t))\nprint(m)', 'n,k,*v=map(int,open(0).read().split())\nm=0\nr=range\nfor i in r(n+1):\n for j in r(min(k,n)-i+1):\n t=sorted(v[:i]+v[...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s009170661', 's273250304', 's514242009', 's539062599']
[3060.0, 3060.0, 3060.0, 3060.0]
[49.0, 19.0, 41.0, 28.0]
[188, 197, 191, 165]
p03032
u767543103
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import numpy as np \n\nN, K = map(int, input().split())\nvs = np.array([int(v) for v in input().split()])\nak = min(N + 1, K + 1)\nmax_value = 0\n\nfor a in range(ak):\n bk = min(N - a + 1, K - a + 1)\n for b in range(bk):\n n_remove = K - a - b\n l = np.sum(vs[:a]) if a > 0 else 0\n r = np...
['Wrong Answer', 'Accepted']
['s298486322', 's022210011']
[14596.0, 12436.0]
[271.0, 240.0]
[1021, 971]
p03032
u774539708
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import heapq as hq\n\nN,K=map(int,input().split())\nV=list(map(int,input().split()))\n\nans=0\nfor i in range(1,min(N,K)+1): \n for j in range(i+1):\n A=[]\n hq.heapify(A) \n for k in range(j):\n hq.heappush(A,V[k])\n for k in range(i-j):\n hq.heappush(A,V[n-k-1])\...
['Runtime Error', 'Accepted']
['s134712836', 's116819947']
[3064.0, 3188.0]
[18.0, 44.0]
[564, 564]
p03032
u778614444
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import sys\nsys.setrecursionlimit(100000)\n\nN, K = map(int, input().split())\nV = list(map(int, input().split())) # N\n\n\nans = 0\nfor i in range(K+1):\n hand = V[:i]\n for j in range(K-i+1):\n if j != 0:\n x = hand + V[max(K-j, i):]\n else:\n x = hand\n rest = K - i - j\n summ = sum(v for i...
['Wrong Answer', 'Accepted']
['s016381156', 's256296092']
[3064.0, 3064.0]
[55.0, 64.0]
[458, 458]
p03032
u780675733
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
["import bisect\nfrom collections import deque\nN, K = map(int, input().split())\nD = list(map(int, input().split()))\n\nans = 0\nfor pull_num in range(K+1):\n \tif pull_num > N:\n continue\n push_num = K - pull_num\n #print('pull_num:{}'.format(pull_num))\n for left_num in range(pull_num+1):\n ...
['Runtime Error', 'Accepted']
['s846736270', 's725431201']
[2940.0, 3316.0]
[17.0, 26.0]
[922, 613]
p03032
u784612287
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import sys\ninput = sys.stdin.readline\nN,K = map(int,input().split())\nV = list(map(int,input().split()))\n\nD = []\nans = 0\n\nfor i in range(K+1):\n for j in range(K-i+1):\n if i + j > N:\n break\n D.append(V[:i]+V[N-j:])\n\nfor d in D:\n for x in range(K-len(d)):\n if d==[]:\...
['Runtime Error', 'Accepted']
['s594556440', 's837915988']
[3444.0, 3444.0]
[101.0, 81.0]
[533, 514]
p03032
u785578220
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import heapq \nN,K = map(int,input().split())\nA = list(map(int,input().split()))\nm = min(N,K) \nM = 0 \nfor i in range(m+1):\n for j in range(m-i+1):\n A1 = A[:i] \n A3 = A[N-j:] \n new_A = A1+A3\n new_A.sort()\n h = K - len(new_A)\n while h >0 and new_A:\n if...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s462082751', 's580414413', 's444132126']
[3064.0, 3064.0, 3064.0]
[31.0, 18.0, 31.0]
[519, 509, 381]
p03032
u792217717
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['N, K = [int(x) for x in input().split(" ")]\nD = [int(x) for x in input().split(" ")]\n\ncombs = []\nlim = min([N, K])\nfor a in range(0, lim + 1):\n for b in range(0, lim - a + 1):\n combs.append((a, b))\n\nmaxres = 0\nfor a,b in combs:\n elems = sorted(D[:a] + D[-b:])\n negative = len([e for e in ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s038868929', 's062348593', 's141023379', 's563215068', 's795337573', 's196181268']
[3064.0, 2940.0, 78156.0, 5848.0, 3316.0, 3064.0]
[26.0, 17.0, 2108.0, 94.0, 2104.0, 26.0]
[439, 855, 873, 476, 853, 438]
p03032
u801049006
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n, k = map(int, input().split())\nv = list(map(int, input().split()))\n\nans = 0\nfor i in range(n):\n for j in range(n):\n if i + j <= k and i + j <= n:\n g = v[:i] + v[n-j:]\n g.sort()\n print(g, min(k-i-j, i+j))\n for l in range(min(k-i-j, i+j)+1):\n ...
['Wrong Answer', 'Accepted']
['s442515033', 's971088022']
[9144.0, 9188.0]
[62.0, 56.0]
[351, 317]
p03032
u806855121
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['from collections import deque\n\nN, K = map(int, input().split())\nV = list(map(int, input().split()))\nans = 0\nO = min(N, K)\nfor i in range(O+1):\n for j in range(O-i+1):\n if i + j > O:\n break\n DV = deque(V)\n S = 0\n nums = []\n for _ in range(i):\n n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s160403958', 's229572075', 's817414435']
[3316.0, 3828.0, 3316.0]
[33.0, 47.0, 40.0]
[576, 691, 591]
p03032
u807772568
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import sys,collections as cl,bisect as bs\nsys.setrecursionlimit(100000)\nMax = sys.maxsize\ndef l():\n\treturn list(map(int,input().split()))\ndef m():\n\treturn map(int,input().split())\ndef s(x):\n\ta = []\n\taa = x[0]\n\tsu = 1\n\tfor i in range(len(x)-1):\n\t\tif aa == x[i+1]:\n\t\t\ta.append([aa,su])\n\t\t\taa ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s282197184', 's461381124', 's363695477']
[3820.0, 3436.0, 3436.0]
[50.0, 21.0, 52.0]
[810, 785, 880]
p03032
u814781830
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['N, K = map(int, input().split())\nV = list(map(int, input().split()))\n\ndef calc(l, r, d):\n hold = V[:l] + V[r:]\n hold.sort()\n return sum(hold[d:]) \n\nret = 0\nK = min(N, K)\nfor l in range(K+1):\n for r in range(K+1-l):\n for d in range(K+1-l-r):\n ret = max(ret, calc(l, r, d))\npr...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s595543875', 's694426362', 's475967844']
[3188.0, 3064.0, 3064.0]
[134.0, 46.0, 69.0]
[312, 286, 277]
p03032
u814986259
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import heapq\nN, K = map(int, input().split())\nV = list(map(int, input().split()))\nans = 0\nfor k in range(K+1):\n for i in range(k+1):\n tmp = 0\n tmp2 = []\n heapq.heapify(tmp2)\n\n for j in range(k-i):\n tmp += V[j]\n if V[j] < 0:\n heapq.heappu...
['Runtime Error', 'Accepted']
['s146133632', 's096211685']
[3064.0, 3188.0]
[52.0, 59.0]
[562, 633]
p03032
u820351940
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
["import numpy as np\nn, k = map(int, input().split())\nv = list(map(int, input().split()))\n\nleft = np.cumsum([0] + v)\nright = np.cumsum([0] + v[::-1])\n\nresults = []\nfor backn in range(k + 1):\n at = k - backn\n\n t = min(n, at)\n # print('----', backn, t)\n for shift in range(t + 1):\n p = v[:...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s149209475', 's959639802', 's662453708']
[12396.0, 12424.0, 14428.0]
[165.0, 164.0, 436.0]
[485, 483, 389]
p03032
u836311327
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
["import sys\nimport heapq\ndef input(): return sys.stdin.readline().rstrip()\n\n\ndef main():\n n, k = map(int, input().split())\n v = list(map(int, input().split()))\n ans = 0\n for i in range(n):\n for j in range(i, n):\n h=[0]\n heapq.heapify(h)\n count = 0\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s106780060', 's362761054', 's250169915']
[9276.0, 9112.0, 9268.0]
[35.0, 27.0, 43.0]
[906, 870, 898]
p03032
u846150137
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['a,k=map(int,input().split())\nL=list(map(int,input().split()))\nans=0\n\nfor i in range(min(k,n)+1):\n for j in range(min(k,n)-i+1):\n S=[0]+L[:i]+L[a-j:]\n S.sort()\n x=0\n while x < k-(j+i):\n if S[x]>=0:\n break\n x+=1\n ans=max(ans,sum(S)-sum(S[:x]))\n \nprint(ans)\n', 'a,k=map...
['Runtime Error', 'Accepted']
['s036569006', 's389816271']
[3064.0, 3064.0]
[17.0, 33.0]
[291, 291]
p03032
u852058690
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import copy\n\nN, K = map(int, input().split())\nV = [int(i) for i in input().split()]\n\nvalue = 0\n\nfor k in reversed(range(K)):\n for ret in range(K-k): \n if (ret < k+1):\n for i in range(k+1+1): \n tmp = []\n V_tmp = copy.copy(V)\n for sp in rang...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s145749547', 's178347440', 's379663251', 's408331380', 's731641216', 's135354137']
[18292.0, 8564.0, 3572.0, 3572.0, 6132.0, 3444.0]
[2104.0, 2104.0, 773.0, 49.0, 2104.0, 39.0]
[801, 1133, 966, 941, 745, 1018]
p03032
u856169020
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['N, K = map(int, input().split())\nV = list(map(int, input().split()))\n\nleft = K\nright = K - left\n\nans = -pow(10, 9)\nwhile left < 0:\n all_get = V[:left] + V[::-1][:right]\n all_get.sort(reverse=True)\n num = 0\n while True:\n if num >= K - (left + right) or all_get[-1] >= 0:\n break\n all_get.pop...
['Wrong Answer', 'Accepted']
['s389533922', 's180967454']
[3064.0, 3064.0]
[18.0, 100.0]
[387, 520]
p03032
u860002137
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n, k = map(int, input().split())\nv = list(map(int, input().split()))\n\nans = 0\nfor left in range(n + 1):\n for right in range(n + 1):\n if left == 0 and right == 0:\n continue\n if left + right > n:\n break\n rest = k - left - right\n arr = v[:left] + v[n - righ...
['Wrong Answer', 'Accepted']
['s328171400', 's438671106']
[9216.0, 9200.0]
[34.0, 36.0]
[505, 517]
p03032
u866769581
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n,k = map(int,input().split())\nv = map(int,input().split())\n\nans = 0\n\nfor l in range(n):\n for r in range(n-l+1):\n if l+r >k:\n break\n nv = v[:l] + v[n-r:]\n nv.sort()\n for i in range(k-l-r):\n if not nv or nv[0] >= 0:\n break\n nv...
['Runtime Error', 'Accepted']
['s177288771', 's351022342']
[3060.0, 3060.0]
[17.0, 31.0]
[354, 360]
p03032
u888337853
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import math\nimport copy\nfrom copy import deepcopy\nimport sys\nimport fractions\nimport numpy as np\nfrom functools import reduce\n# import statistics\nimport heapq\nsys.setrecursionlimit(3000)\n\n# input = sys.stdin.readline\n\n\n# ===FUNCTION===\n\ndef getInputInt():\n inputNum = int(input())\n return input...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s714999959', 's980519540', 's125162935']
[14204.0, 13624.0, 13684.0]
[169.0, 162.0, 164.0]
[1593, 1559, 1358]
p03032
u898336293
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['from collections import deque\n\nN, K =map(int, input().split())\nV=list(map(int, input().split()))\nVd = deque(V)\nscore = 0\n\nfor a in range(min(K,N)+1):\n for b in range(min(K-a+1,N-a+1)):\n print([a,b])\n hou = []\n Vd = deque(V)\n for _ in range(a):\n hou.append(Vd.popleft())\n for _ in ran...
['Wrong Answer', 'Accepted']
['s085292691', 's938776204']
[3572.0, 3444.0]
[46.0, 44.0]
[499, 482]
p03032
u918935103
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n,k = map(int,input().split())\nv = list(map(int,input().split()))\nansl = []\np = 1\nfor i in range(min(k+1,n+1)):\n for j in range(i+1):\n v1 = v[0:j]\n v2 = v[n-(i-j):n] \n v1.extend(v2)\n v1.sort()\n for x in range(k-i-2):\n if len(v1) != 0:\n del...
['Runtime Error', 'Accepted']
['s926078842', 's747421236']
[3064.0, 3064.0]
[34.0, 30.0]
[464, 484]
p03032
u922952729
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['from functools import lru_cache\n\nN,K=[int(i) for i in input().split(" ")]\nV=[int(i) for i in input().split(" ")]\n\n@lru_cache()\ndef value(V,k,hands):\n if k==0:\n return sum(hands)\n else:\n retval=sum(hands)\n try:\n retval=max(value(V[1::],k-1,sorted(hands+[V[0]])),retval)...
['Runtime Error', 'Accepted']
['s111440142', 's484283999']
[3700.0, 14412.0]
[50.0, 202.0]
[780, 423]
p03032
u925364229
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['N, K = map(int, input().split(" "))\nV = list(map(int, input().split(" ")))\nV_rev = list(reversed(V))\nval = [[0] * (N + 1) for _ in range(N + 1)]\n\nfor i in range(N):\n for j in range(N):\n val[i + 1][j] = val[i][j] + V[i]\n val[i][j + 1] = val[i][j] + V_rev[j]\n\nval[N][N] = val[N][N - 1] + V_rev...
['Wrong Answer', 'Accepted']
['s721945411', 's989900516']
[3520.0, 3064.0]
[36.0, 32.0]
[795, 749]
p03032
u941407962
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n,k=map(int,input().split())\nxs=[0]+list(map(int,input().split()))\nfrom itertools import accumulate\nAs=list(accumulate(xs))\nr = 0\nfor i in range(k+1):\n for j in range(i, k+1):\n x = i, j-i, k-j\n m = As[i] + As[n] - As[n-j+i]\n \n# if m > r:\n# print(x, m, m1)\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s562543755', 's757464959', 's945739625']
[3064.0, 3064.0, 3064.0]
[20.0, 54.0, 27.0]
[399, 395, 438]
p03032
u945200821
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
["import sys\nimport collections\n\n\nscan = sys.stdin.readline\n\n\ndef main():\n n, k = map(int, scan().rstrip().split())\n v = collections.deque([int(value) for value in scan().rstrip().split()])\n hands = []\n\n results = []\n\n for a in range(min(n, k) + 1):\n for b in range(min(n, k) - a + 1...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s402570421', 's412361540', 's617140796', 's645339883', 's941834598']
[3316.0, 3316.0, 3316.0, 3316.0, 3572.0]
[21.0, 21.0, 21.0, 21.0, 102.0]
[798, 821, 828, 849, 884]
p03032
u952022797
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['# -*- coding: utf-8 -*-\nimport sys\nimport math\nfrom bisect import bisect_left\nfrom bisect import bisect_right\nimport collections\nimport copy\nimport heapq\ninput = sys.stdin.readline\n \n\n\n\n\n\n\n\n\n\n\ndef main():\n\tN, K = map(int, input().split(" "))\n\t#N = int(input())\n\t#S = input()\n\tV = input().sp...
['Runtime Error', 'Accepted']
['s571718615', 's671929434']
[3444.0, 3700.0]
[24.0, 417.0]
[1032, 854]
p03032
u957084285
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['N, K = map(int, input().split())\nV = list(map(int, input().split()))\n\ndef query(l, r):\n if (l+r > min(N, K)):\n return 0\n rest = K-l-r\n lst = V[:l] + (V[-r:] if r is not 0 else [])\n print(l, r, len(lst))\n lst.sort()\n print([x for i, x in enumerate(lst) if x > 0 or i >= rest])\n re...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s060618884', 's752045284', 's986506068', 's804898268']
[3572.0, 3064.0, 3572.0, 3064.0]
[39.0, 27.0, 40.0, 36.0]
[467, 357, 436, 352]
p03032
u962535482
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['maxi = 0\nfor i in range(N):\n for o in range(i):\n fs = 0\n bs = 0\n hand = []\n for p in range(o):\n fs += V[p]\n hand.append(V[p])\n for p in range(i-o, N):\n bs += V[p]\n hand.append(V[p])\n ts = fs + bs\n if ts > maxi...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s064398007', 's206427468', 's553477767', 's584841744', 's640047875', 's374167249']
[3064.0, 3064.0, 3064.0, 3064.0, 3316.0, 3064.0]
[18.0, 17.0, 17.0, 17.0, 51.0, 45.0]
[578, 1084, 1088, 1111, 731, 798]
p03032
u963903527
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['n, k = map(int, input().split())\nv = list(map(int, input().split()))\nans = 0 \n# left\nfor i in range(min(n, k) + 1):\n # right\n for j in range(min(n, k) - i + 1):\n par_seq = sorted(v[:i] + v[-j:] if j != 0 else v[:i])\n par_seq_sum = sum(par_seq)\n if par_seq_sum > ans:\n an...
['Runtime Error', 'Accepted']
['s518935119', 's614211952']
[3064.0, 3064.0]
[18.0, 49.0]
[475, 581]
p03032
u968846084
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['N,K=map(int,input().split())\nV=list(map(int,input().split()))\nA=0\ns=0\nS=0\nwhile A<=K:\n B=0\n while B<=K-A:\n C=0\n while (C<=K-A-B and C<=A+B):\n if A==0:\n s=0\n else:\n for i in range(A):\n s=s+V[i]\n if B==0:\n s=s\n else:\n for j in range(B):\...
['Runtime Error', 'Accepted']
['s360953615', 's265639335']
[43124.0, 3316.0]
[2104.0, 48.0]
[607, 583]
p03032
u971632623
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import sys\nsys.setrecursionlimit(101)\n\nn, k = list(map(int, input().split()))\nvs = list(map(int, input().split()))\nmemo = {}\n\n\ndef doit(l, r, kk):\n if kk == 0 or l > r:\n return 0\n if (l, r) not in memo:\n memo[(l, r)] = max(vs[l] + doit(l + 1, r , kk - 1),\n ...
['Wrong Answer', 'Accepted']
['s791847073', 's849933015']
[3188.0, 9072.0]
[20.0, 118.0]
[553, 565]
p03032
u993435350
2,000
1,048,576
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The _values_ of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations ...
['import heapq\nfrom collections import deque\nfrom functools import lru_cache\n\nN,K = map(int,input().split())\nV = list(map(int,input().split()))\nans = 0\n\nfor l in range(0,K):\n for r in range(0,K - l):\n d = K - r - l\n tmp = 0\n have = []\n if l + r > N:\n continue\n for i in range(0,l):\n ...
['Wrong Answer', 'Accepted']
['s799091293', 's280252741']
[4072.0, 3572.0]
[56.0, 51.0]
[623, 662]
p03033
u017810624
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\ninput=sys.stdin.readline\nimport heapq\nn,q=map(int,input().split())\nl=[list(map(int,input().split())) for i in range(n)]\nd=[int(input()) for i in range(q)]\nL1=[]\nfor i in range(n):\n L1.append([l[i][0]-l[i][2],1,l[i][2]])\n L1.append([l[i][1]-l[i][2],-1,l[i][2]])\nL1.sort()\nL2=[]\nheapq.heapify(L2...
['Runtime Error', 'Accepted']
['s738519611', 's947891899']
[127204.0, 127196.0]
[2111.0, 1324.0]
[777, 603]
p03033
u021548497
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nfrom heapq import *\ninput = sys.stdin.readline\n\ndef main():\n n, q = map(int, input().split())\n \n key = []\n for i in range(n):\n s, t, x = map(int, input().split())\n l, r = max(0, s-x), max(0, t-x)\n key.append((l, 1, x))\n key.append((r, -1, x))\n\n key.s...
['Runtime Error', 'Runtime Error', 'Accepted']
['s185661187', 's212482585', 's032923292']
[59956.0, 114752.0, 101236.0]
[740.0, 1335.0, 1217.0]
[1241, 1385, 1316]
p03033
u041739330
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['n,q = list(map(int, input().split()))\n\nlist_xst = []\nfor _ in range(n):\n s,t,x = list(map(int, input().split()))\n list_xst.append([x, s-x, t-x])\n\nlist_xst.sort(key=lambda l:l[0])\n\nlist_d = [int(input()) for _ in range(q)]\n\nprint(list_d)\n\nfor d in list_d:\n retn = -1\n for xst in list_xst:\n ...
['Wrong Answer', 'Accepted']
['s386449547', 's260634207']
[59032.0, 62496.0]
[2108.0, 1842.0]
[406, 548]
p03033
u102461423
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["\nimport sys\ninput = sys.stdin.readline\n\nN,Q = map(int,input().split())\nq = []\n\nSTX = [[int(x) for x in input().split()] for _ in range(N)]\nfor s,t,x in STX:\n q.append((s-x,1,x)) \n q.append((t-x,0,x)) \n\nfor i in range(Q):\n d = int(input())\n q.append((d,2,i))\nanswer = [-1]*Q\n\nse = set() \n\nq.sort(...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s172224232', 's298876874', 's367065901', 's381071479', 's584301384', 's586554313', 's868394340', 's920308699', 's188983865']
[141624.0, 122008.0, 142000.0, 3064.0, 134268.0, 132712.0, 132584.0, 121856.0, 146344.0]
[1325.0, 2107.0, 1496.0, 17.0, 2110.0, 2091.0, 2109.0, 2111.0, 1585.0]
[563, 737, 900, 662, 673, 608, 607, 734, 971]
p03033
u130492706
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n"""\nCreated on Sat Jun 15 16:58:00 2019\n\n@author: YudNK\n"""\nimport heapq as hp\nimport bisect as bs\n\nN, Q = map(int, input().split())\nE = []\nfor i in range(N):\n s, t, x = map(int, input().split())\n app = [s - x, 1, x]\n rem = [t - x, -1, x]\n E.a...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s557944271', 's604919208', 's993022194', 's634789000']
[72696.0, 106212.0, 55692.0, 60232.0]
[1607.0, 1708.0, 2107.0, 1859.0]
[783, 732, 593, 658]
p03033
u197300773
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['def main():\n from heapq import heappush, heappop\n import sys\n sys.setrecursionlimit(10 ** 7)\n read = sys.stdin.buffer.read\n readline = sys.stdin.buffer.readline\n readlines = sys.stdin.buffer.readlines\n\n\n n,q=map(int,input().split())\n\n stx=[[int(x) for x in readline().split()] for _ ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s078586852', 's323364326', 's966394825', 's144838055']
[90188.0, 3192.0, 90212.0, 147932.0]
[450.0, 19.0, 490.0, 1998.0]
[863, 1673, 719, 928]
p03033
u202560873
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\ninput=sys.stdin.readline\nfrom bisect import bisect_left\nn,q=map(int,input().split())\nstop=[]\nfor i in range(n):\n\ts,t,x=map(int,input().split())\n\tstop.append((s,t,x))\nstop.sort(key=lambda x:x[2])\nd=[int(input())for i in range(q)]\n\nans=[-1]*q\nfor s,t,x in stop:\n\tl=bisect_left(d,s-x)\n\tr=bise...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s208680807', 's790945610', 's959716941', 's973376023']
[8900.0, 193948.0, 58988.0, 56176.0]
[26.0, 2250.0, 2207.0, 822.0]
[407, 566, 562, 559]
p03033
u226155577
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['from heapq import heappush, heappop\nimport sys\n\nans = [None]*Q\ndef solve():\n readline = sys.stdin.readline\n N, Q = map(int, readline().split())\n qs = [0]*(N+1)\n for i in range(N):\n s, t, x = map(int, readline().split())\n qs[i] = (s-x, t-x, x)\n qs[N] = (10**10, 10**10, 0)\n q...
['Runtime Error', 'Accepted']
['s191104643', 's878836306']
[3064.0, 75220.0]
[18.0, 1218.0]
[810, 819]
p03033
u237362582
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['from bisect import bisect_left\nfrom operator import itemgetter\n\ninput = sys.stdin.readline\n\nN, Q = map(int, input().split(" "))\ncheck_points = [tuple(map(int, input().split(" "))) for _ in range(N)]\nquerys = [int(input()) for _ in range(Q)]\ntime = [-1] * Q\njump = [-1] * Q\ncheck_points = sorted(check_points,...
['Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s177539114', 's831653438', 's290226716']
[3064.0, 53700.0, 54020.0]
[18.0, 2106.0, 1144.0]
[696, 616, 707]
p03033
u284854859
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["def main():\n import sys,heapq\n from collections import defaultdict\n input = sys.stdin.readline\n\n n,q = map(int,input().split())\n \n used = defaultdict(int)\n tank = []\n\n p = []\n for i in range(n):\n s,t,x = map(int,input().split())\n p.append((s-x,x))\n p.appen...
['Runtime Error', 'Accepted']
['s233289773', 's474827278']
[69272.0, 79104.0]
[1654.0, 1634.0]
[981, 955]
p03033
u292810930
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import bisect\nimport copy\nN, Q = map(int, input().split())\nevents = []\nfor i in range(N):\n s,t,x = map(int, input().split())\n events.append([s-x, 1, x])\n events.append([t-x, -1, x])\nevents.sort()\nevents=np.array(events)\nsets = set()\nprev = 0\nfor _ in range(Q):\n d = int(input())\n index = b...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s055639127', 's188663523', 's384768991', 's501623882', 's262602648']
[65352.0, 38052.0, 38056.0, 63252.0, 57636.0]
[1462.0, 672.0, 668.0, 2107.0, 1801.0]
[592, 505, 698, 270, 699]
p03033
u315485238
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['N,Q = list(map(int, input().split()))\nSTX = [list(map(int, input().split())) for _ in range(N)]\nD = [int(input()) for _ in range(Q)]\n\nL = [(max(-0.5,s-x),max(-0.5,t-x),x) for s,t,x in STX] + [(d,-1) for d in D]\nL.sort()\n\nimport heapq\nhp = [] \n\nfor l in L:\n if l[1] == -1:\n while hp and l[0] > hp[0][1]:...
['Wrong Answer', 'Accepted']
['s146916608', 's690406361']
[124488.0, 126024.0]
[2112.0, 1990.0]
[459, 465]
p03033
u316386814
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nsys.setrecursionlimit(10**7)\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().s...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s369731598', 's446625281', 's462861469', 's607391647', 's935653907']
[56380.0, 99192.0, 99192.0, 57512.0, 65564.0]
[2107.0, 1735.0, 1683.0, 2107.0, 1521.0]
[825, 914, 909, 1067, 1077]
p03033
u316464887
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["import heapq\ndef main():\n N, Q = map(int, input().split())\n ls = []\n lt = []\n for _ in range(N):\n s, t, x = map(int, input().split())\n ls.append((s-x, x))\n lt.append((t-x, x))\n heapq.heapify(ls)\n heapq.heapify(lt)\n dl = set()\n for i in range(Q):\n d = in...
['Wrong Answer', 'Accepted']
['s341062242', 's226803424']
[66812.0, 105864.0]
[2107.0, 1826.0]
[655, 652]
p03033
u320567105
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["import sys\ninput = sys.stdin.readline\nri = lambda: int(input())\nrl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]\nrl = lambda: list(input().split()))\nrr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]\nYN = lambda b: print('YES') if b else print('NO')\nyn = lambda b: print('Yes...
['Runtime Error', 'Accepted']
['s395652710', 's359647718']
[3064.0, 93696.0]
[17.0, 1636.0]
[975, 978]
p03033
u324314500
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["import sys\ns2nn = lambda s: [int(c) for c in s.split(' ')]\nss2nn = lambda ss: [int(s) for s in ss]\nss2nnn = lambda ss: [s2nn(s) for s in ss]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]\nii2ss...
['Wrong Answer', 'Accepted']
['s511541999', 's095519083']
[120988.0, 102512.0]
[1527.0, 1487.0]
[1949, 689]
p03033
u325227960
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n \nfrom heapq import heappush, heappop\nfrom collections import defaultdict\n \nn,q = map(int,readline().split())\ndata = list(map(int,read().split()))\nA = data[:3*n]\nD = data[3*n:]\n\nE = []\nF =...
['Runtime Error', 'Accepted']
['s577253457', 's168202108']
[84120.0, 127340.0]
[216.0, 1813.0]
[885, 753]
p03033
u334712262
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, prod...
['Wrong Answer', 'Accepted']
['s331925674', 's633599599']
[173080.0, 148540.0]
[2114.0, 1973.0]
[1888, 1813]
p03033
u353797797
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nfrom bisect import *\n\ninput = sys.stdin.readline\n\ndef f(n, q):\n xst = []\n for i in range(n):\n s, t, x = map(int, input().split())\n xst.append([x, s - x, t - x])\n xst.sort()\n\n ds = []\n ans = [-1] * q\n for i in range(q):\n d = int(input())\n ds.appe...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s130949090', 's202977771', 's223252577', 's697146916', 's813168159', 's533390081']
[53316.0, 58504.0, 100892.0, 81332.0, 3060.0, 62324.0]
[924.0, 2107.0, 2110.0, 2109.0, 17.0, 1132.0]
[569, 633, 657, 742, 307, 663]
p03033
u367130284
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["from bisect import*\nimport sys;input=sys.stdin.readline\n\ndef doevent(lis):\n global stop\n a,b=lis\n if b>=0:\n if stop=={-1}:\n stop=set()\n stop.add(b)\n else:\n if -b in stop:\n stop.remove(-b)\n if stop==set():\n stop={-1}\n return min...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s087062900', 's271060709', 's546697990', 's757307805', 's953588196']
[63540.0, 54388.0, 90448.0, 87484.0, 102628.0]
[659.0, 425.0, 908.0, 2109.0, 1454.0]
[745, 912, 686, 991, 701]
p03033
u389910364
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["import bisect\nimport sys\n\nimport numpy as np\n\nsys.setrecursionlimit(10000)\nINF = float('inf')\nMAXINT = sys.maxsize\n\nN, Q = list(map(int, input().split()))\nSTX = [list(map(int, input().split())) for _ in range(N)]\nD = np.array([int(input()) for _ in range(Q)])\n\nans = np.full(Q, np.inf)\n\nfor s, t, x in S...
['Wrong Answer', 'Accepted']
['s194052404', 's758544828']
[76848.0, 91396.0]
[2112.0, 1389.0]
[528, 791]
p03033
u392319141
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['N , Q = map(int,input().split())\n\nD = [0]*Q\nInput = []\nlength = [-1]*Q\n\nfor i in range(N):\n Input.append(list(map(int,input().split())))\n\n\ndist = lambda A : A[2]\nInput.sort(key=dist)\n\nfor i in range(Q):\n D[i] = [i,int(input())]\n\n\ntime = lambda A : A[1]\nD.sort(key=time)\n\n\nskip = 0\nfor start...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s357182461', 's754740681', 's876305003', 's769225994']
[88260.0, 90284.0, 76248.0, 98176.0]
[2109.0, 2110.0, 2108.0, 1507.0]
[827, 800, 1655, 666]
p03033
u456353530
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['#test\ndef hersCode(L, n):\n ok = len(L)\n ng = l\n while abs(ok - ng) > 1:\n mid = abs(ok + ng) // 2\n if L[mid] >= n:\n ok = mid\n else:\n ng = mid\n return ok\n\ndef main():\n N, Q = list(map(int, input().split()))\n STX = [list(map(int, input().split())) for _ in range(N)]\n D = [int(inp...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s422188177', 's609830190', 's670141434', 's742809599', 's869244280', 's974351737']
[69480.0, 98084.0, 69588.0, 98084.0, 3064.0, 99484.0]
[1260.0, 1549.0, 2108.0, 1521.0, 17.0, 1997.0]
[622, 718, 623, 700, 624, 718]
p03033
u504836877
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\ninput = sys.stdin.buffer.readline\n\nN,Q = map(int, input().split())\nList = []\ndic = {}\nfor _ in range(N):\n s, t, x = map(int, input().split())\n List.append((s-0.5-x, 1, x)\n List.append((t-0.5-x, -1, x))\n dic[x] = False\n\nimport heapq\n \nList.sort()\n\nh = []\nj = 0\nfor _ in range...
['Runtime Error', 'Accepted']
['s196589308', 's971001019']
[2940.0, 68228.0]
[17.0, 1767.0]
[702, 703]
p03033
u533039576
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["from heapq import heappush, heappop\nfrom collections import deque\nimport sys\ninput = sys.stdin.readline\n\nn, q = map(int, input().split())\nevent = []\nstx = []\nfor i in range(n):\n s, t, x = map(int, input().split())\n heappush(event, (s - 0.5 - x, +1, i))\n heappush(event, (t - 0.5 - x, -1, i))\n s...
['Wrong Answer', 'Accepted']
['s073246564', 's287444030']
[183444.0, 132948.0]
[2111.0, 1296.0]
[690, 1062]
p03033
u553623615
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['from ctypes import *\nimport subprocess as sp\nfrom operator import itemgetter\nimport sys\nimport os.path\n\nset_code = r"""\n#include <set>\n\nstd::set<int> s;\n\nvoid add(int x) {\n s.insert(x);\n}\n\nbool find(int x) {\n return s.find(x) != s.end();\n}\n\nvoid remove(int x) {\n s.erase(x);\n}\n\nbool emp...
['Wrong Answer', 'Accepted']
['s462201194', 's234110529']
[111496.0, 126336.0]
[2108.0, 1878.0]
[1688, 2723]
p03033
u562935282
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["def main():\n from bisect import bisect_left\n from collections import namedtuple\n from operator import attrgetter\n import sys\n\n input = sys.stdin.readline\n Event = namedtuple('Event', 'pos start end')\n\n N, Q = map(int, input().split())\n\n events = []\n for _ in range(N):\n s...
['Wrong Answer', 'Accepted']
['s026735472', 's894274188']
[54484.0, 55980.0]
[2106.0, 1692.0]
[1033, 1075]
p03033
u593567568
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nimport bisect\nimport heapq\nsys.setrecursionlimit(10 ** 7)\n\n# TLE\n\nN, Q = map(int, input().split())\nSTX = [[int(x) for x in input().split()] for _ in range(N)]\nEVENT = []\nfor s, t, x in STX:\n EVENT.append((s-x, 0, x))\n EVENT.append((t-x, 1, x))\n\nfor i in range(Q):\n d = int(input())\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s043106273', 's229236878', 's259470919', 's504037017', 's551956469', 's331625061']
[135860.0, 97264.0, 95992.0, 134560.0, 50920.0, 143764.0]
[2111.0, 2113.0, 2114.0, 2112.0, 1156.0, 1540.0]
[585, 560, 587, 673, 699, 765]
p03033
u595289165
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import heapq\nn, q = map(int, input().split())\nevent = []\nfor _ in range(n):\n s, t, x = map(int, input().split())\n event.append((s-x, 1, x))\n event.append((t-x, -1, x))\n\nevent.sort(key=lambda y: y[0])\nheap = []\nxs = set([])\n\nd = [int(input()) for _ in range(q)]\nans = [-1] * q\nindex = 0\nfor t, q...
['Runtime Error', 'Runtime Error', 'Accepted']
['s741083390', 's767622552', 's337578837']
[66560.0, 66288.0, 89328.0]
[950.0, 1003.0, 1500.0]
[834, 983, 943]
p03033
u619458041
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["import numpy as np\nimport sys\n\ndef main():\n input = sys.stdin.readline\n N, Q = map(int, input().split())\n X = []\n for _ in range(N):\n start, end, pos = map(int, input().split())\n X.append((pos, start, end))\n\n X = sorted(X, key=lambda x: x[0])\n positions = np.zeros(N+1, dtyp...
['Wrong Answer', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s012832360', 's349623100', 's752473904', 's332576394']
[57400.0, 55516.0, 61628.0, 52764.0]
[2114.0, 2111.0, 2111.0, 999.0]
[818, 818, 740, 824]
p03033
u669240121
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['N, Q = map(int, input().split())\n# The person start in this location will be stopped.\nwork = []\nfor i in range(N):\n start, end, pos = map(int, input().split())\n work.append((start - pos - 0.5, end - pos - 0.5, pos))\nwork.sort(key=lambda x: x[0])\ndepart_time = [int(input()) for _ in range(Q)]\nheap = []\n...
['Wrong Answer', 'Accepted']
['s924102065', 's764337910']
[75824.0, 64812.0]
[2107.0, 1903.0]
[666, 654]
p03033
u716530146
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["#!/usr/bin/env python3\nimport sys, math, itertools, collections, bisect\ninput = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')\ninf = float('inf') ;mod = 10**9+7\nmans = inf ;ans = 0 ;count = 0 ;pro = 1\n\nclass InverseTable:\n __slots__ = ['In', 'fac', 'Ifac']\n\n def __init__(self, mod, maxnum...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s077676372', 's796281183', 's872547640', 's334968070']
[122556.0, 3064.0, 3188.0, 120112.0]
[1336.0, 18.0, 20.0, 1752.0]
[2190, 795, 767, 762]
p03033
u734548018
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['#!/usr/bin/python3\n# -*- coding: utf-8 -*-\nfrom bisect import bisect_left\nfrom sys import stdin\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\nreadl = stdin.readline\ndef main():\n ## input\n N,Q = map(int, readl().rstrip().split())\n STX = [list(map(int, readl().rstrip().split())) for _ in range...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s341132780', 's426101607', 's473265295', 's528352307', 's558669836', 's743502944', 's827765642', 's017475107']
[76824.0, 2940.0, 2940.0, 85132.0, 3064.0, 2940.0, 23540.0, 75764.0]
[795.0, 17.0, 17.0, 2109.0, 18.0, 17.0, 86.0, 1219.0]
[732, 708, 712, 791, 732, 722, 733, 596]
p03033
u756399469
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nfrom operator import itemgetter\ninputs = sys.stdin.readline\nN, Q= map(int,inputs().split())\nE = [None]*2*N\nfor n in range(N):\n\ta,b,c = map(int,inputs().split())\n\tE[2*n] = (a - c, 1, c)\n\tE[2*n + 1] = (b - c, -1, c)\nE.sort(key=itemgetter(0))\ntuple(E)\nmini = 1000000001\nkouho = {1000000001}\nmy_...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s028512591', 's177559120', 's727021285', 's655791033']
[118456.0, 192500.0, 107920.0, 69268.0]
[2107.0, 2111.0, 2110.0, 1141.0]
[896, 691, 764, 908]
p03033
u807772568
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys,collections as cl,bisect as bs\nsys.setrecursionlimit(100000)\nMax = sys.maxsize\ndef l():\n return list(map(int,input().split()))\ndef m():\n return map(int,input().split())\ndef onem():\n return int(input())\ndef s(x):\n a = []\n aa = x[0]\n su = 1\n for i in range(len(x)-1):\n ...
['Runtime Error', 'Accepted']
['s322866513', 's300138063']
[69564.0, 74476.0]
[1271.0, 1917.0]
[911, 912]
p03033
u832409298
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nsys.setrecursionlimit(10**7)\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef II(): return int(sys.st...
['Runtime Error', 'Runtime Error', 'Accepted']
['s274866150', 's987652492', 's524948126']
[117672.0, 108860.0, 107444.0]
[2111.0, 1223.0, 1710.0]
[10670, 3156, 3446]
p03033
u839188633
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['n, q = map(int, input().split())\nstx = [tuple(map(int, input().split())) for _ in range(n)]\nd = [int(input()) for _ in range(q)]', 'from math import ceil, log2\nimport sys\n\n\ninput = sys.stdin.readline\nn, q = map(int, input().split())\nstx = [tuple(map(int, input().split())) for _ in range(n)]\nd = [int(input())...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s017554597', 's680949323', 's701791347', 's412682162']
[45892.0, 45900.0, 118692.0, 53892.0]
[945.0, 402.0, 1311.0, 1200.0]
[128, 196, 759, 593]
p03033
u844789719
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["import sys\ninput = sys.stdin.readline\nN, Q = [int(_) for _ in input().split()]\nSTX = [[int(_) for _ in input().split()] for _ in range(N)]\nD = [int(input()) for _ in range(Q)]\nevents = []\nfor stx in STX:\n s, t, x = stx\n events += [[s - x, 1, x], [t - x, 0, x]]\nfor i in range(Q):\n events += [[D[i], ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s526032804', 's816538324', 's980914659', 's311666361']
[148660.0, 141108.0, 148660.0, 148660.0]
[1846.0, 1758.0, 2112.0, 1943.0]
[794, 586, 548, 795]
p03033
u870262604
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['class Node: \n def __init__(self, height, key, x):\n self.height = height \n self.key = key \n self.value = x \n self.lst = None \n self.rst = None \n\n\ndef height(t): return 0 if t is None else t.height\n\n\ndef bias(t): return height(t.lst) - height(t.rst...
['Time Limit Exceeded', 'Accepted']
['s199207142', 's871837615']
[100784.0, 102516.0]
[2109.0, 1461.0]
[8569, 689]
p03033
u884982181
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nfrom collections import deque\nfrom collections import defaultdict\nimport math\nsys.setrecursionlimit(20000000)\ninput = sys.stdin.readline\n \nn,q = map(int,input().split())\nx = []\nfor i in range(n):\n x.append(list(map(int,input().split())))\nx.sort(key = lambda x : x[2])\ndd = []\nzaa = []\nf...
['Wrong Answer', 'Accepted']
['s995303844', 's479907483']
[106484.0, 106480.0]
[1640.0, 1739.0]
[1083, 1117]
p03033
u911575040
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
["import sys\nfrom heapq import heappush, heappop\nn,q=map(int,input().split())\na=sorted(((s-x, t-x, x) for _ in range(n) for s, t, x in (map(int, sys.stdin.readline().split()),)), reverse=True)\nheap=[]\nans=[]\nz=list(map(int,sys.stdin))\nfor d in z:\n d=int(input())\n while a and a[-1][0]<=d:\n e=a.pop()\n ...
['Runtime Error', 'Accepted']
['s460177211', 's653781436']
[47400.0, 62568.0]
[664.0, 1443.0]
[473, 456]
p03033
u922449550
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import heapq\n\n\nN, Q = map(int, input().split())\nevent_list = []\nfor i in range(N):\n s, t, x = map(int, input().split())\n event_list.append([s-x, 1, x])\n event_list.append([t-x, -1, x])\n\nevent_list.sort()\nevent_list.append([10**10, 1, 10**10])\ni = 0\nx_set = set()\nx_list = []\ntime = 0\nfor q in range(...
['Runtime Error', 'Accepted']
['s145440802', 's810435758']
[64876.0, 104232.0]
[1652.0, 1831.0]
[652, 667]
p03033
u945181840
2,000
1,048,576
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
['import sys\nfrom operator import itemgetter\nfrom heapq import heapify, heappush, heappop\n\nread = sys.stdin.read\n\nN, Q, *STXD = map(int, read().split())\nSTX = STXD[:3 * N]\nqueue = []\n\nfor S, T, X in zip(*[iter(STX)] * 3):\n s = S - X - 0.5\n t = T - X - 0.5\n queue.append((s, t, X))\n queue.append...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s120578956', 's208312255', 's480279092', 's482435073', 's886423548', 's258647282']
[124076.0, 93620.0, 108324.0, 101208.0, 110812.0, 132396.0]
[1663.0, 498.0, 682.0, 442.0, 1409.0, 1556.0]
[1091, 274, 335, 284, 905, 1114]
p03034
u067983636
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
['import sys\nimport itertools\ninput = sys.stdin.readline\nsys.setrecursionlimit(100000)\n# mod = 10 ** 9 + 7\nmod = 998244353\n\ndef read_values(): return map(int, input().split())\ndef read_index(): return map(lambda x: int(x) - 1, input().split())\ndef read_list(): return list(read_values())\ndef read_lists(N): ret...
['Runtime Error', 'Accepted']
['s741293716', 's828164253']
[3064.0, 14988.0]
[18.0, 978.0]
[1636, 1019]
p03034
u102461423
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
['import numpy as np\n\nN = int(input())\nS = np.array([int(x) for x in input().split()],dtype=np.int64)\n\n\n\n\nanswer = 0\nfor d in range(1,N):\n # d = A-B\n cum_left = np.cumsum(S[::d])\n cum_right = np.cumsum(S[::-1][::d])\n score = cum_left + cum_right \n \n for L,s in enumerate(score):\n ...
['Runtime Error', 'Accepted']
['s330805143', 's220233746']
[3064.0, 21180.0]
[17.0, 911.0]
[961, 436]
p03034
u201234972
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
['from collections import defaultdict\nN = int( input())\nS = list( map( int, input().split()))\n\nans = 0\nfor c in range(1,N):\n now = 0\n for t in range(c ,N, c):\n if ((N-1-t)%c == 0 and N-1-t <= t):\n break\n now += S[t] + S[N-1-t]\n print(now, t)\n if now > ans:\n ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s054497554', 's111632667', 's754505586', 's840375426', 's876405491', 's972181640']
[27772.0, 14588.0, 14588.0, 22960.0, 14588.0, 14588.0]
[2104.0, 48.0, 726.0, 2105.0, 47.0, 855.0]
[332, 440, 406, 515, 447, 328]
p03034
u218843509
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
['n = int(input())\ns = list(map(int, input().split()))\nans = 0\nfor i in range(1, (n-1)//2+1):\n\tif i > 1 and (n-1)%i == 0:\n\t\tcontinue\n\tres = 0\n\tl, r = i, n-1-i\n\twhile r > 0:\n\t\tres += s[l] + s[r]\n\t\tans = max(ans, res)\n\t\tl += i\n\t\tr -= i\nprint(ans)', 'n = int(input())\ns = list(map(int, input().s...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s278658507', 's680694673', 's674848385']
[14332.0, 14332.0, 14860.0]
[931.0, 869.0, 1023.0]
[242, 242, 227]
p03034
u562016607
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
['N=int(input())\ns=[int(i) for i in input().split()]\nans=0\nfor C in range(1,N-1):\n fkC=0\n k=0\n while((N-1-2*k*C)>0):\n fkC+=s[N-1-k*C]+s[k*C]\n print(C,k,fkC)\n ans=max(ans,fkC)\n k+=1\n if k==1:\n break\nprint(ans)', 'N=int(input())\ns=[int(i) for i in input().split...
['Wrong Answer', 'Accepted']
['s845291983', 's532114528']
[20868.0, 14468.0]
[1751.0, 953.0]
[253, 367]
p03034
u619458041
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
["import sys\n\ndef main():\n input = sys.stdin.readline\n N = int(input())\n S = list(map(int, input().split()))\n\n ans = 0\n for C in range(1, N//2):\n n = N // C\n point = 0\n for k in range(1, n):\n A = N - 1 - k*C\n if A < C or ((N-1) % C == 0 and A < k*C)...
['Wrong Answer', 'Accepted']
['s809848014', 's404140535']
[14332.0, 14388.0]
[721.0, 783.0]
[462, 873]
p03034
u754022296
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
['import sys\ninput = sys.stdin.readline\n\nn = int(input())\nS = tuple(map(int, input().split()))\nans = 0\nfor c in range(1, n-1):\n temp = 0\n T = set()\n for k in range(1, (n-2)//c+1):\n d = c*k\n if d in T or n-1-d in T:\n break\n T.add(d)\n T.add(n-1-d)\n temp += S[d]+S[n-1-d]\n ans = ma...
['Wrong Answer', 'Accepted']
['s058064179', 's226547672']
[22904.0, 23052.0]
[1083.0, 1252.0]
[325, 356]
p03034
u940102677
2,000
1,048,576
There is an infinitely large pond, which we consider as a number line. In this pond, there are N lotuses floating at coordinates 0, 1, 2, ..., N-2 and N-1. On the lotus at coordinate i, an integer s_i is written. You are standing on the lotus at coordinate 0. You will play a game that proceeds as follows: * 1. Choo...
['n = int(input())\ns = list(map(int,input().split()))\n\nans = 0\n\nfor c in range(1,n-1):\n if (n-1)%c == 0:\n p = ((n-1)//c-1)//2 \n else:\n p = (n-1)//c-2\n if p <= 1:\n break\n if p <= 1:\n continue\n m = 0\n k = 0\n for i in range(1,p+1):\n k += s[c*i] + s[n-1-c*i]\n m = max(m,k)\n a...
['Wrong Answer', 'Accepted']
['s268883024', 's861201039']
[14468.0, 14468.0]
[814.0, 863.0]
[335, 335]
p03035
u003501233
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['age = 12\nfee = 1000\n\nif age > 13;\n\tprint(fee)\nelse if 6 <= age <= 12;\n\tprint(fee / 2)\nelse;\n\tprint(0)', 'age = 30\nfee = 1000\n\nif int(age) >= 13:\n\tprint(int(fee))\n \nelif 6 <= int(age) <= 12:\n\tprint(int(fee) // 2)\n\nelse:\n\tprint(0)', 'age = 12\nfee = 1000\n\nif age > 13;\n\tprint(fee)\nelse;\n...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s026040337', 's045208924', 's047305360', 's074276098', 's099474101', 's105370636', 's106741954', 's209601770', 's211486541', 's359202438', 's682223931', 's761856750', 's830890758', 's877313276', 's941824544', 's949305176', 's963463524', 's978484719', 's883080104']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 20.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 19.0, 17.0, 17.0, 18.0, 17.0]
[101, 126, 67, 122, 102, 112, 124, 46, 105, 98, 105, 93, 114, 104, 110, 105, 132, 114, 109]
p03035
u003871484
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['yo,ans=map(int, input().split())\nif yo<13:\n if yo>5:\n print(ans//)\n else:\n print(0)\nelse:\n print(ans)', 'yo,ans=map(int, input().split())\nif yo<13:\n if yo>5:\n print(ans//2)\n else:\n print(0)\nelse:\n print(ans)']
['Runtime Error', 'Accepted']
['s849518747', 's428597379']
[2940.0, 2940.0]
[17.0, 17.0]
[124, 125]
p03035
u006883624
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['A, B = map(int, input())\n\nif A >= 13:\n print(B)\nelif A >= 6:\n print(B // 2)\nelse:\n print(0)\n', 'A, B = map(int, input().split())\n\nif A >= 13:\n print(B)\nelif A >= 6:\n print(B // 2)\nelse:\n print(0)\n']
['Runtime Error', 'Accepted']
['s602871516', 's032957300']
[2940.0, 2940.0]
[18.0, 17.0]
[101, 109]
p03035
u014948743
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['import sys\n\nargs = sys.argv\n\nif int(args[1]) == 0:\n\tresult = 0\nelif 13 > int(args[1]):\n\tresult = int(args[2])/2\nelse:\n\tresult = args[2]\n\nprint(result)', 'import sys\n\nargs = sys.argv\n\nif int(args[1]) == 0:\n\tresult = 0\nelif 13 > int(args[1]):\n\tresult = int(args[2])/2\nelse:\n\tresult = args[2]\n\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s568170277', 's675724995', 's858404923']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[150, 150, 99]
p03035
u018679195
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['age = int(input())\nprice = int(input())\nif age >= 13:\n print(age, price)\nelif 6 <= age <= 12:\n print(price // 2)\nelse:\n print(0)', 'age = int(input())\nyen = int(input())\nif 0 <= age <= 5:\n print(0)\nif 6 <= age <= 12:\n print(yen//2)\nif 16 <= age <= 100:\n print(yen)', 'age = int(input("e...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s052544453', 's090223494', 's902308514', 's838494189']
[2940.0, 2940.0, 3060.0, 2940.0]
[18.0, 17.0, 17.0, 17.0]
[137, 141, 480, 122]
p03035
u027675217
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['n,b = map(int, input().split())\nans = 0\nif 6<=n<=12:\n ans = b // 2\nelif n < 6:\n ans = b\nprint(ans)\n', 'n,b = map(int, input().split())\nans = 0\nif n >= 6 and n<=12:\n ans = b // 2\nelif n < 12:\n ans = b\nprint(ans)\n', 'n,b = map(int, input().split())\nans = 0\nif 6<=n<=12:\n ans = b // 2\neli...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s332274334', 's996150158', 's181507580']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 19.0]
[105, 114, 106]
p03035
u028489522
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['x = input()\nli = x.split()\nage = li[0]\nm = li[1]\nif(age <= 5):\n print(0)\nelif(age <= 12):\n printf(m / 2)\nelse:\n print(m)', 'x = input()\nli = x.split()\nage = int(li[0])\nm = int(li[1])\nif(age <= 5):\n print(0)\nelif(age <= 12):\n print(int(m / 2))\nelse:\n print(m)']
['Runtime Error', 'Accepted']
['s511270836', 's142725551']
[3060.0, 3060.0]
[17.0, 17.0]
[123, 137]
p03035
u030726788
2,000
1,048,576
Takahashi, who is A years old, is riding a Ferris wheel. It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currenc...
['a,b = map(int,input().split())\n\nif(a <= 5):\n print(0)\nelif(a < 12):\n print(b//2):\nelse:\n print(b)', 'a,b = map(int,input().split())\n\nif(a <= 5):\n print(0)\nelif(a <= 12):\n print(b//2)\nelse:\n print(b)\n']
['Runtime Error', 'Accepted']
['s550663533', 's738423250']
[2940.0, 2940.0]
[17.0, 18.0]
[106, 107]