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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03031 | u903005414 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["import numpy as np\nN, M = map(int, input().split())\nbulbs = []\nfor _ in range(M):\n bulbs.append(list(map(int, input().split()))[1:])\nP = list(map(int, input().split()))\n\nprint('bulbs', bulbs)\nprint('P', P)\n\n\ndef f(state):\n for bulb, p in zip(bulbs, P):\n if state[[bulb]].sum() % 2 != p:\n ... | ['Wrong Answer', 'Accepted'] | ['s384537046', 's604067530'] | [12632.0, 3064.0] | [181.0, 29.0] | [535, 485] |
p03031 | u908349502 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["\nimport sys \ninput = sys.stdin.readline\n\nn, m = map(int,input().split())\n\nli = []\n\nfor i in range(2**n):\n i_bin = format(i, 'b').zfill(n)\n li.append(i_bin)\n \nS = []\nfor i in range(m):\n s = list(map(int,input().split()))[1:]\n S.append(s)\n \np = list(map(int,input().split()))\n\nfor i in range(m)... | ['Wrong Answer', 'Accepted'] | ['s518215347', 's254464177'] | [3064.0, 3064.0] | [39.0, 36.0] | [458, 493] |
p03031 | u912650255 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input().split())\nlamps = [list(map(int,input().split())) for i in range(M)]\np = list(map(int,input().split()))\n\nans = 0\n\nfor i in range(1<<N):\n for r in range(M):\n on_sum = 0\n for j in range(N):\n if (i >> j) & 1 and j in lamps[r]:\n on_sum += 1\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s133677993', 's287232919', 's335973920', 's656360289', 's886588921', 's121697447'] | [9192.0, 9112.0, 9228.0, 9080.0, 9200.0, 9240.0] | [36.0, 47.0, 41.0, 30.0, 44.0, 49.0] | [388, 467, 399, 344, 391, 469] |
p03031 | u920977317 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['def main():\n N,M=map(int,input().split())\n\n k_list=[]\n swiches=[]\n for i in range(M):\n inp=list(map(int,input().split()))\n k_list.append(inp[0])\n swiches.append(inp[1:])\n P=list(map(int,input().split()))\n\n res=0\n for SwichStatus in range(pow(2,N)):\n flag=0... | ['Wrong Answer', 'Accepted'] | ['s182187526', 's431991145'] | [3064.0, 3064.0] | [31.0, 31.0] | [740, 750] |
p03031 | u921773161 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["N, M = map(int, input().split())\ntmp = [0] * M\nk = [0] * M\ns = [0] * M\nfor i in range(M):\n tmp[i] = list(map(int, input().split()))\n k[i] = tmp[i][0] \n s[i] = tmp[i][1:]\np = list(map(int, input().split()))\nans = 0\n\nfor i in range(2**N):\n x = ('00000000' + str(bin(i))[2:])[-10:]\n countM = 0... | ['Wrong Answer', 'Accepted'] | ['s705576540', 's774240037'] | [3064.0, 3192.0] | [49.0, 52.0] | [576, 669] |
p03031 | u932868243 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\nn,m=map(int,input().split())\nl=[list(map(int,input().split())) for i in range(m)]\np=list(map(int,input().split()))\nsss=0\nfor c in itertools.product([0,1],n):\n for i in range(m):\n cnt=0\n for j in range(l[i][0]):\n if c[l[i][j+1]-1]==1:\n cnt+=1\n if cnt%2==p[i]:\n an... | ['Runtime Error', 'Accepted'] | ['s172297682', 's774152180'] | [3064.0, 3064.0] | [18.0, 47.0] | [345, 360] |
p03031 | u934052933 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['\n\n\ndef main():\n n, m = map(int, input().split())\n \n s = []; k = [] \n for _ in range(m):\n tmp_k, *tmp_s = list(map(int, input().split()))\n k.append(tmp_k); s.append(tmp_s)\n p = list(map(int, input().split()))\n\n res = 0\n \n for bit in range(2**n):\n ok = True\n ... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s006571073', 's321378447', 's621371515', 's671318798', 's582977758'] | [3060.0, 3064.0, 3064.0, 3064.0, 3188.0] | [17.0, 31.0, 17.0, 31.0, 32.0] | [1178, 1275, 1181, 1265, 1198] |
p03031 | u934693611 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['from itertools import product\nN,M=map(int,input().split())\nA=[]\nfor _ in range(M):\n A.append(list(map(int,input().split()))[1:])\nP=list(map(int,input().split()))\n\nans=0\n\nfor st in product([0,1],repeat=N):\n f=True\n for i in range(M):\n k=0\n for j in A[i]:\n k+=st[j-1]\n ... | ['Wrong Answer', 'Accepted'] | ['s983023364', 's083269541'] | [3064.0, 3064.0] | [23.0, 28.0] | [394, 393] |
p03031 | u940096920 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["import itertools\n\ndef is_lit(i, bit):\n l = [bit[j-1] for j in sockets[i]]\n return p[i] == l.count(True) // 2\n\ncount = 0\nN, M = map(int, input().split())\nbit_list = list(itertools.product([True, False], repeat = N))\n\nsockets = []\nfor i in range(M):\n args = input().split(' ')\n k = int(args[0])\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s092661079', 's146560241', 's454869580'] | [3188.0, 3188.0, 3188.0] | [33.0, 33.0, 34.0] | [522, 521, 531] |
p03031 | u942479185 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\nN,M=map(int,input().split())\nkslist=[(list(map(int,input().split()))) for i in range(M)]\nplist=list(map(int,input().split()))\nls=list((itertools.product(range(2),repeat=N)))\nn=0\nfor tup in ls:\n if [tup[kslist[j][k in range(1,kslist[j][0]+1)]-1]%2 for j in range(M)]==plist:\n n+=1\npr... | ['Runtime Error', 'Accepted'] | ['s456625756', 's028440307'] | [3188.0, 3188.0] | [18.0, 33.0] | [320, 427] |
p03031 | u944643608 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["N, M = map(int, input().split())\ns = [list(map(int, input().spllit())) [1:] for i in range(M)]\np = list(map(int, input().split()))\ntotal = 0\nj = 0\nfor i in range(2 ** N):\n now = format(i, '10b')\n for k in range(M):\n tmp = 0\n for l in s[k]:\n tmp += int(now[-l])\n if tmp % 2 == p[k]:\n j ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s003820321', 's064682924', 's254738976', 's290807804', 's398565043', 's532817295', 's625933477', 's704747933', 's708261262', 's801816420', 's924540624', 's972787543', 's364610596'] | [3064.0, 3188.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3188.0] | [18.0, 17.0, 18.0, 17.0, 17.0, 18.0, 17.0, 18.0, 17.0, 20.0, 17.0, 18.0, 33.0] | [361, 397, 390, 360, 359, 449, 360, 449, 437, 400, 448, 361, 448] |
p03031 | u946996108 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['mod = 10 ** 9 + 7\nmod2 = 2**61+1\nfrom collections import deque\nimport heapq\nfrom bisect import bisect_left, insort_left, bisect_right\n\ndef iip(listed=True):\n ret = [int(i) for i in input().split()]\n if len(ret) == 1 and not listed:\n return ret[0]\n return ret\n\ndef iip_ord():\n return [or... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s024439261', 's071582322', 's244152500', 's732205673', 's916208440'] | [4476.0, 3956.0, 3444.0, 4476.0, 3444.0] | [110.0, 40.0, 28.0, 109.0, 38.0] | [3670, 3671, 3575, 3670, 3672] |
p03031 | u947523546 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['def light(l,i):\n k=1<<i\n if l&k:\n return 1\n else:\n return 0\n\nN, M = map(int,input().split())\ns=list()\nfor j in range(0,M):\n s.append(0)\nfor j in range(0,M):\n s[j]=list(map(int,input().split()))\np=list(map(int,input().split()))\n\na=0\nfor l in range(0,1<<N):\n b=0\n for... | ['Wrong Answer', 'Accepted'] | ['s718874718', 's366148988'] | [9228.0, 9104.0] | [58.0, 58.0] | [490, 476] |
p03031 | u974792613 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['def judgeAllBulbsOn(switchOn, conds, p):\n m = len(conds)\n flag = True\n for i in range(m):\n k = conds[i][0]\n numOfBulbOn = 0\n for i in range(k):\n if switchOn[conds[i][k]] == True:\n numOfBulbOn +=1\n if numOfBulbOn % 2 != p[m]:\n flag = False\n break\n return flag\n \n... | ['Runtime Error', 'Accepted'] | ['s859458194', 's984532944'] | [3064.0, 3064.0] | [18.0, 28.0] | [718, 870] |
p03031 | u981931040 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["N , M = map(int , input().split())\nswitch = []\nbit_switch = []\nfor _ in range(M):\n switch = list(map(int ,input().split()))\n del switch[0]\n k = 0\n for i in switch:\n k += 1 << (i - 1)\n bit_switch.append(k)\np = list(map(int,input().split()))\ncnt = 0\ndp = [[] for _ in range(M + 1)]\ndp[... | ['Wrong Answer', 'Accepted'] | ['s962770147', 's891122054'] | [3188.0, 3064.0] | [22.0, 21.0] | [525, 528] |
p03031 | u993435350 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input().split())\ntarget = [[num-1 for num in list(map(int,input().split()))[1:]] for _ in range(M)]\n\njudge = list(map(int,input().split()))\n\ncnt = 0\n\nfor i in range(2 ** N):\n\n\n\tswitches = [0] * M\n\tfor k in range(M):\n\t\n\t\tfor j in range(N):\n\t\t\n\t\t\tif ((i >> j) & 1) and j in target[... | ['Wrong Answer', 'Accepted'] | ['s115819671', 's406479693'] | [3188.0, 3064.0] | [53.0, 51.0] | [1188, 351] |
p03031 | u998741086 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["#!/usr/bin/env python\n\n# input\nn, m = map(int, input().split())\nt = [list(map(int, input().split())) for _ in range(m)]\np = list(map(int, input().split()))\nk = [t[i][0] for i in range(m)]\ns = [t[i][1:] for i in range(m)]\n\n# calc\n# bit full search\nans = 0 \nfor i in range(2**n):\n tmp = i \n sw = []\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s247448637', 's953269932', 's760901198'] | [9180.0, 9136.0, 9120.0] | [32.0, 35.0, 36.0] | [797, 798, 802] |
p03032 | u001272273 | 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 itertools\nimport numpy as np\nimport copy\n\ndef main():\n\tN, K = map(int,input().split())\n\n\tVs = list(map(int,input().split()))\n\n\tallCandidates = []\n\tfor i in range(int(K / 2) + 1):\n\t\tfor one in range(0, K - i + 1):\n\t\t\tallCandidates.extend([[0] * one + [1] * (K - i - one) + [-1] * i])\n\n\tma... | ['Wrong Answer', 'Accepted'] | ['s209421210', 's236254598'] | [15520.0, 16608.0] | [314.0, 1388.0] | [933, 905] |
p03032 | u021019433 | 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 itertools import islice\n \nR = lambda: map(int, input().split())\nn, k = R()\nv = list(R())\na = sorted((x, i) for i, x in enumerate(v) if x < 0)\nans = max(sum(v[:i - j] + v[n - j:])) -\n sum(islice((x for x, m in a if m < i - j or m >= n - j), k - i))\n for i in range(1, min(n, k) + 1) for j... | ['Runtime Error', 'Accepted'] | ['s839706043', 's346820018'] | [2940.0, 3060.0] | [17.0, 24.0] | [335, 250] |
p03032 | u026155812 | 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 = [int(i) for i in input().split()]\nans = 0\nfor M in range(K+1):\n for m in range(M+1):\n ls = []\n cur1 = 0\n for i, x in enumerate(V):\n if i < m:\n ls.append(x)\n cur += 1\n cur2 = 0\n for i, x in e... | ['Runtime Error', 'Accepted'] | ['s624295028', 's528562429'] | [9208.0, 9056.0] | [29.0, 173.0] | [583, 496] |
p03032 | u028217518 | 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 ... | ['read = input \nrn = lambda :list(map(int, read().split()))\n# O(N^2)\nn, k = rn()\nV = rn() # 0 ~ n-1\nbest = 0\nfor i in range(0, n + 1): # [0, n]\n for j in range(i + 1, n+1): # [i + 1, n]\n # take [0,i), [j, n)\n yes = V[0:i] + V[j: n]\n if len(yes) > k:\n continue\n lefto... | ['Wrong Answer', 'Accepted'] | ['s840285557', 's268645516'] | [3064.0, 3064.0] | [28.0, 28.0] | [632, 630] |
p03032 | u037430802 | 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\nnums = min(N, K)\nfor i in range(nums+1): \n for j in range(nums+1-i): \n for k in range(nums+1-i-j): \n L = V[:i]\n R = V[N-j:]\n print(L, R, i, j, k)\n\n LR = L + R\n LR.... | ['Wrong Answer', 'Accepted'] | ['s468448411', 's548994244'] | [9776.0, 3188.0] | [321.0, 35.0] | [691, 770] |
p03032 | u039360403 | 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()))\nR=min(N,K)\nL=[]\nfor r in range(R+1):\n for A in range(R -r + 1):\n B = R - r-A\n I = sorted((V[:A] + V[::-1][:B]))\n for i in range(len(I)):\n p=K-A-B\n if I[i] >= 0:\n p = i\n ... | ['Runtime Error', 'Accepted'] | ['s125106876', 's915579270'] | [3884.0, 3064.0] | [68.0, 38.0] | [454, 459] |
p03032 | u046187684 | 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 ... | ['def solve(string):\n n, k, *v = map(int, string.split())\n lefts = [0] * (k + 1)\n rights = [0] * (k + 1)\n """\n for i in range(k + 1):\n for j in range(k - i + 1):\n base = sorted(v[:i] + v[max(n - k + i + j, i):])\n ans = max(ans, sum([b for l, b in enumerate(base) if b ... | ['Runtime Error', 'Accepted'] | ['s553678732', 's138318717'] | [3060.0, 3064.0] | [17.0, 21.0] | [2006, 982] |
p03032 | u054825571 | 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()))\nr,ans=min(N,K),0\nfor a in range(r+1):\n for b in range(r-a+1):\n tmp,minus=0,[]\n for i in range(a):\n tmp+=V[i]\n if V[i]<0:\n minus.append(V[i])\n for j in range(b):\n tmp+=V[j]\n if V[j]<0:\n minus.append(V... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s590033842', 's651681946', 's738371534'] | [9228.0, 9224.0, 9228.0] | [43.0, 38.0, 40.0] | [379, 507, 391] |
p03032 | u060938295 | 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 -*-\n"""\nCreated on Mon May 27 22:13:19 2019\n\n@author: Yamazaki Kenichi\n"""\n\nN, M = map(int,input().split())\nks = [list(map(int,input().split())) for i in range(M)]\np = list(map(int,input().split()))\n\nS = [0 for i in range(M)]\nfor i in range(M):\n for j in range(1,ks[i][0]+1):\n ... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s212560627', 's791943320', 's970261112', 's122657552'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 29.0, 54.0, 35.0] | [629, 656, 638, 530] |
p03032 | u062459048 | 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\nN, K = map(int,input().split())\nV = list(map(int,input().split()))\n\nV = deque(V)\n\nans = []\nfor i in range(min(N,K)):\n for j in range(min(N,K)-i):\n Vc = V.copy()\n cal = deque([])\n for k in range(i):\n cal.append(Vc.popleft())\n for l in range(j):\n cal.ap... | ['Runtime Error', 'Accepted'] | ['s819189855', 's076149990'] | [3316.0, 3436.0] | [21.0, 41.0] | [485, 484] |
p03032 | u071680334 | 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\ndef main():\n n, k = map(int, input().split())\n v = list(map(int, input().split()))\n# v_cum = [x for x in v]\n\n# v_cum[i] += v_cum[i-1]\n ans = 0\n for L_i in range(min(k+1, n)):\n R_i_max = k - L_i+1\n if n < L_i + R_i_max:\n R_i_max = n - L_i + 1\n ... | ['Runtime Error', 'Accepted'] | ['s093291444', 's644282805'] | [3064.0, 3188.0] | [17.0, 42.0] | [2148, 953] |
p03032 | u075012704 | 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\n\n\nans = 0\nfor pop_cnt in range(K + 1):\n enqueue_cnt = K - pop_cnt\n if (pop_cnt > N) or (enqueue_cnt > pop_cnt):\n continue\n\n for l in range(pop_cnt + 1):\n holding = []\n\n r = pop_cnt - l\n holding +=... | ['Wrong Answer', 'Accepted'] | ['s308536733', 's126857045'] | [3064.0, 3064.0] | [21.0, 37.0] | [756, 724] |
p03032 | u076512055 | 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\nvalue = 0\n\nfor cd in range(K):\n ab = min(N, K-cd)\n for left_ab in range(ab+1):\n right_ab = ab - left_ab\n pick = V[:left_ab] + V[-right_ab:]\n pick.sort()\n neg = 0\n while True:\n if pick... | ['Runtime Error', 'Accepted'] | ['s224389944', 's559160440'] | [3064.0, 3064.0] | [47.0, 63.0] | [487, 572] |
p03032 | u102278909 | 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\n\nimport sys\ninput = sys.stdin.readline\n\n# N = int(input())\nN, K = map(int, input().split())\nD = [int(x) for x in input().split()]\n# S = input()\n\nans = 0\nfor l in range(N + 1):\n if l > K:\n break\n\n for r in range(N - l + 1):\n if l + r > K:\n break\n\n ... | ['Runtime Error', 'Accepted'] | ['s803650210', 's545919228'] | [3064.0, 3064.0] | [17.0, 74.0] | [481, 482] |
p03032 | u102461423 | 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\n\nN,K = map(int,input().split())\nV = [int(x) for x in input().split()]\n\nmax_value = 0 \n\nfor L in range(N):\n for R in range(N):\n if L+R > K:\n break\n if L+R > N:\n break\n #get = V[:L] + V[-R:]\n get = V[:L].copy()\n if R > 0:\n get += V[-R:].copy()\n get.sort()\n rest ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s668049979', 's680619092', 's860047118'] | [3572.0, 3572.0, 3064.0] | [39.0, 38.0, 28.0] | [721, 708, 571] |
p03032 | u108617242 | 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()))\nVi = [i+1 for i in range(len(V))]\nV.extend(V)\nVi.extend(Vi)\nans = 0\nfor k in range(1, min(K+1, N+1)):\n for s in range(len(V)):\n part_Vi = Vi[s:s+k]\n if 1 not in part_Vi and N not in part_Vi:\n continue\n c... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s075890497', 's280293093', 's668182429', 's300953689'] | [3064.0, 3064.0, 3064.0, 3064.0] | [41.0, 44.0, 39.0, 41.0] | [663, 659, 663, 659] |
p03032 | u113971909 | 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())\nA=list(map(int,input().split()))\nret = 0\nfor a in range(min(N,K)+1):\n for b in range(min(N,K)-a+1):\n W=A[:a]+A[N-b:]\n W.sort()\n sl=min(sum([1 for i in W if i<0]),K-a-b)\n print(W,W[sl:],a,b,K-a-b)\n ret=max(ret,sum(W[sl:]))\nprint(ret)', 'N,K=map(int,input().split()... | ['Wrong Answer', 'Accepted'] | ['s855391070', 's137001026'] | [3956.0, 3064.0] | [38.0, 26.0] | [277, 365] |
p03032 | u124498235 | 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\nfor i in range(k+1):\n for j in range(k+1):\n if i+j > k or i+j > n:\n continue\n t = k-(i+j)\n s = v[:i] + v[(n-j):]\n s.sort()\n u = 0\n print (s,t)\n while u < t:\n u += 1\n if len(s) < 1:\n ... | ['Wrong Answer', 'Accepted'] | ['s649645394', 's379654272'] | [9232.0, 9144.0] | [41.0, 41.0] | [409, 411] |
p03032 | u151625340 | 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\nR = min(N,K)\nfor A in range(R+1):\n for B in range(R-A+1):\n s = V[:A]+V[N-B:]\n print(s)\n s.sort()\n S = sum(s)\n for k in range(min(K-A-B,len(s))):\n if s[k] < 0:\n S -= s[k... | ['Wrong Answer', 'Accepted'] | ['s806442063', 's556273295'] | [3444.0, 3064.0] | [37.0, 32.0] | [344, 344] |
p03032 | u160244242 | 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())\nlst = list(map(int, input().split()))\n\ndef heap_push(my_lst, a):\n heapq.heappush(my_lst, a)\n return my_lst\n\n\ndef dfs(k, lst, my_lst):\n if k == 0:\n return max(sum(my_lst), 0)\n \n if len(my_lst) == 0:\n a = dfs(k-1, lst[1:], heap_push(my_lst[:], l... | ['Runtime Error', 'Accepted'] | ['s908849786', 's654530615'] | [3064.0, 3064.0] | [18.0, 43.0] | [887, 551] |
p03032 | u172035535 | 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()))\nKK = K\nK = min(N,K)\n\nans = 0\nfor k in range(1,K):\n for i in range(k+1):\n R = V[-(k-i):]\n if len(R) == N:\n R = []\n print(R)\n L = V[:i]+R+[0]\n L.sort()\n zero_index = min(L.index(0),KK-... | ['Wrong Answer', 'Accepted'] | ['s398188779', 's202813516'] | [3316.0, 3064.0] | [29.0, 24.0] | [394, 346] |
p03032 | u174394352 | 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 itertools import combinations\nfrom bisect import bisect_left\nN, K = map(int,input().split())\nA = list(map(int,input().split()))\n\nans=0\n\nfor i,j in combinations(range(N+2),2):\n l = sorted(A[0:i]+A[j-1:N])\n if len(l)<=K:\n m = bisect_left(l,0)\n \tans = max(ans,sum(l[min(K-len(l),m):]))\nprint(ans)\... | ['Runtime Error', 'Accepted'] | ['s468430271', 's000577856'] | [3064.0, 3064.0] | [18.0, 24.0] | [305, 306] |
p03032 | u190406011 | 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\nn, k = [int(i) for i in sys.stdin.readline().split()]\nv_ls = [int(i) for i in sys.stdin.readline().split()]\ninv_v_ls = v_ls[::-1]\nsum_a_b = min(n, k) + 1\nbest = 0\nfor a in range(sum_a_b):\n for b in range(sum_a_b - a):\n ls = v_ls[:a] + inv_v_ls[:b]\n ls.sort()\n for c in rang... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s100724127', 's852093464', 's254184373'] | [3064.0, 3348.0, 3064.0] | [52.0, 48.0, 54.0] | [522, 553, 526] |
p03032 | u210827208 | 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(min(k,n)+1):\n for j in range(min(k,n)-i+1):\n print(v[:i])\n print(v[:~j:-1])\n t=sorted(v[:i]+v[:~j:-1])\n for l in range(min(min(n,k)-i-j,len(t))):\n if t[l]<0:\n t[l... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s228058737', 's501033878', 's538971412'] | [3572.0, 3188.0, 3064.0] | [36.0, 29.0, 40.0] | [350, 300, 283] |
p03032 | u211160392 | 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()))\nL,R = [0]*(K),[0]*(K)\nL[0] = max(0,V[0])\nR[0] = max(0,V[-1])\nfor i in range(min(N,K)+1):\n part = V[:i]\n part.sort()\n for j in range(min(K-i,i)):\n if part[0] < 0:\n part.pop(0)\n L[i+j] = max(L[i+j],sum(part))... | ['Runtime Error', 'Accepted'] | ['s173459361', 's776597790'] | [3064.0, 3064.0] | [17.0, 35.0] | [630, 377] |
p03032 | u213401801 | 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\n\nfor a in range(50):\n for b in range(50):\n if a+b <= min(n,k):\n li=v[:a]+v[n-b:]\n sumv = sum(li)\n li.sort()\n for i in range(min(k-a-b,len(li))):\n if li[i] < 0:\n li[i] = 0:\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s153130099', 's792563451'] | [3060.0, 3064.0] | [17.0, 28.0] | [376, 356] |
p03032 | u223904637 | 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,ki=map(int,input().split())\nv=list(map(int,input().split()))\n\nm=min(n,ki)\nans=0\n\nfor i in range(m+1):\n for j in range(i+1):\n q=[]\n tmp=0\n for k in range(j):\n if len(v)>0:\n q.append(v[k])\n for kz in range(i-j):\n if len(v)>0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s398034802', 's590408636', 's810297504'] | [3064.0, 3064.0, 3064.0] | [39.0, 23.0, 51.0] | [455, 457, 502] |
p03032 | u228223940 | 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 numpy as np\nsys.setrecursionlimit(1000000)\n \nN,K = map(int,input().split())\nVN = [int(i) for i in input().split()]\n\nans = 0\ntemp = 0\n\nfor i in range(min(N,K)):\n for j in range(min(K-i,N-i)):\n now = 0\n if i + j > K-2:\n break\n \n tmp_list = []\n... | ['Wrong Answer', 'Accepted'] | ['s186881888', 's919019239'] | [12520.0, 14424.0] | [172.0, 177.0] | [755, 760] |
p03032 | u231685196 | 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())\n\narr = list(map(int,input().split()))\ns = [0 for i in range(n)]\ntemp = 0\n\nans = 0\nfor i in range(n):\n temp += arr[i]\n s[i] = temp\n\nfor i in range(1,k+1):\n upper = min(n,i)\n for j in range(upper+1):\n v = 0\n a = []\n for ... | ['Runtime Error', 'Accepted'] | ['s023862433', 's387610324'] | [12668.0, 12500.0] | [174.0, 241.0] | [737, 644] |
p03032 | u239528020 | 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\n\nimport heapq\n\nn, k = list(map(int, input().split()))\nv = list(map(int, input().split()))\n\nmax_try = min(n, k)\nans = 0\n\nfor a in range(0, max_try+1):\n for b in range(0, max_try+1-a):\n c = k-(a+b)\n # print(a, b, c, "", end="")\n # print(a, b, c)\n ans_... | ['Wrong Answer', 'Accepted'] | ['s241598771', 's547742218'] | [3316.0, 3188.0] | [60.0, 59.0] | [978, 980] |
p03032 | u241190159 | 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\n\n\ndef main():\n \n input = sys.stdin.readline\n \n N, K = map(int, input().split())\n\n \n V_A = [inp for inp in map(int, input().split())]\n V_B = V_A.copy()[::-1]\n \n ret = 0\n for A in range(K + 1):\n if A < K:\n for B in range(K - A + 1):\n ... | ['Wrong Answer', 'Accepted'] | ['s521433029', 's242577955'] | [3064.0, 3064.0] | [62.0, 26.0] | [1230, 1069] |
p03032 | u271469978 | 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\nfor pull in range(k + 1):\n for back in range(k):\n if pull + back != k:\n continue\n if pull >= n:\n hand = V\n else:\n for l in range(pull+1):\n r = pull - l\n ... | ['Wrong Answer', 'Accepted'] | ['s755990062', 's633986604'] | [3064.0, 3188.0] | [20.0, 80.0] | [689, 695] |
p03032 | u281303342 | 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 ... | ['# python 3.4.3\nimport sys\ninput = sys.stdin.readline\n\n# -------------------------------------------------------------\n# library\n# -------------------------------------------------------------\n\n\n\n# -------------------------------------------------------------\n# main\n# --------------------------------------... | ['Runtime Error', 'Accepted'] | ['s567715885', 's601058058'] | [3316.0, 3316.0] | [21.0, 39.0] | [1218, 1208] |
p03032 | u282228874 | 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()))\nrV = V[::-1]\nQ = []\nm = min(n,k)\nres = 0\nfor i in range(m+1):\n for j in range(m-i+1):\n Q.extend(V[:i])\n Q.extend(rV[:j])\n if not Q:\n continue\n s = sum(Q)\n Q.sort()\n for k in range(mi... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s159763959', 's314498894', 's819282456', 's877931634', 's182589079'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 27.0, 23.0, 17.0, 31.0] | [425, 425, 429, 427, 426] |
p03032 | u285443936 | 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 heapq import heappop, heappush\nfrom collections import deque\nN, K = map(int, input().split())\nV = [int(i) for i in input().split()]\nQ = deque()\nans = 0\nR = min(N,K)\nfor l in range(R):\n H = []\n if l >= 1:\n for i in range(l):\n heappush(H,V[i])\n for r in range(R-l):\n if r >= 1:\n for... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s056518277', 's189478755', 's666136567', 's861125545'] | [3564.0, 3316.0, 3316.0, 3064.0] | [43.0, 88.0, 94.0, 34.0] | [479, 524, 574, 420] |
p03032 | u292810930 | 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\nfor i in range(1,K+1):\n for j in range(i+1):\n rec = V[:i-j]+V[N-j:]\n rec.sort(reverse=True)\n away = max(min(0, i, K-i),0)\n for l in range(away+1):\n recsum = sum(rec[:i-l])\n if re... | ['Wrong Answer', 'Accepted'] | ['s311367473', 's432126089'] | [3064.0, 3188.0] | [56.0, 50.0] | [357, 369] |
p03032 | u305422591 | 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,a)+1):\n for j in range(min(k,a)-i+1):\n S=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)', 'a,k=map(int,... | ['Runtime Error', 'Accepted'] | ['s119364607', 's174754043'] | [3064.0, 3064.0] | [17.0, 33.0] | [287, 291] |
p03032 | u310233294 | 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 = 0\nfor i in range(K+1):\n j = K - i\n for k in range(i+1):\n if (k == 0) and (i != 0):\n v_tmp1 = sum(V[-i:])\n v_tmp2 = [e for e in V[-i:] if e < 0]\n v_tmp2.sort()\n v_tmp = v_tmp1 - (... | ['Wrong Answer', 'Accepted'] | ['s159117658', 's330088411'] | [3064.0, 3060.0] | [56.0, 70.0] | [837, 288] |
p03032 | u312148740 | 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()))\nhand = []\nps = []\ndef func(V, hand, K):\n if K < 1:\n ps.append(hand)\n return\n if len(hand) > 0 and min(hand) < 0:\n hand_ = hand[:]\n hand_, min_val = handPop(hand_)\n C = func([min_val] + V, hand_, K-... | ['Runtime Error', 'Accepted'] | ['s160873823', 's308483906'] | [3140.0, 3064.0] | [22.0, 31.0] | [625, 381] |
p03032 | u314930630 | 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 ... | ['[_, input_k] = map(int, input().split())\n\ninput_v = list(map(int, input().split()))\n\nmax_value = 0\n\nfor a in range(min(input_v, input_k + 1)):\n for b in range(min(input_v, input_k - a + 1)):\n if (b != 0):\n hold_jewelries = input_v[:a] + input_v[-b:]\n else:\n hold_jewel... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s237934954', 's514475061', 's845530831', 's388265076'] | [3064.0, 6260.0, 3064.0, 3064.0] | [18.0, 113.0, 73.0, 26.0] | [651, 689, 636, 656] |
p03032 | u327248573 | 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 sys import stdin\nn, k = map(int, stdin.readline().rstrip().split())\ngems = list(map(int, stdin.readline().rstrip().split()))\ntotal = -99999999999\nfor i in range(min(n, k)+1):\n for j in range(min(n, k)+1):\n if i + j <= min(n, k):\n tmp = gems[:i] + gems[n-j:]\n tmp.sort()\n ... | ['Wrong Answer', 'Accepted'] | ['s499412479', 's109993750'] | [3064.0, 3188.0] | [31.0, 29.0] | [528, 474] |
p03032 | u327532412 | 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\nfor pick in range(min(K+1, N+1)):\n for right in range(pick+1):\n left = pick - right\n pick_list = V[:right] + V[N-left:]\n\n pick_list.sort()\n tmp_ans = sum(pick_list)\n rem = min(K - pick, len(pick_list)... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s368885915', 's540866381', 's876176535', 's347834177'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 18.0, 19.0, 30.0] | [494, 508, 494, 501] |
p03032 | u340781749 | 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 itertools import accumulate\n\n\ndef make_dp(vvv, n, k):\n dp = [-(10 ** 9) * (k + 1)]\n dp[0] = 0\n\n for i in range(min(n, k)):\n i += 1\n vv = vvv[:i]\n vv.sort(reverse=True)\n sm = sum(vv)\n dp[i] = max(dp[i], sm)\n while i < k and vv and vv[-1] < 0:\n ... | ['Runtime Error', 'Accepted'] | ['s329972821', 's516275862'] | [3064.0, 3064.0] | [18.0, 19.0] | [672, 672] |
p03032 | u343523393 | 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 math \nni = lambda: int(ns())\nna = lambda: list(map(int, input().split()))\nns = lambda: input()\n\nN,K = na()\nque = na()\nrevque = que[::-1]\n\nans = 0\nfor a in range(min(N,K)+1):\n for b in range(min(K-a,N-a)+1):\n sum_q = que[:a] + revque[:b] if b>0 else que[:a]\n r = sum(sum... | ['Wrong Answer', 'Accepted'] | ['s126700703', 's838771839'] | [3064.0, 3064.0] | [25.0, 30.0] | [623, 649] |
p03032 | u346812984 | 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\n\nsys.setrecursionlimit(10 ** 6)\nINF = float("inf")\nMOD = 10 ** 9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N, K = map(int, input().split())\n V = list(map(int, input().split()))\n\n ans = 0\n for a in range(min(N, K) + 1):\n for b in range(K - ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s327733451', 's925698992', 's192980888'] | [3064.0, 3064.0, 3064.0] | [29.0, 18.0, 30.0] | [916, 834, 866] |
p03032 | u350248178 | 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=[int(i) for i in input().split()]\nans=[]\n\nfor i in range(min(n,k)+1):\n for j in range(min(n,k)-i+1):\n d=k-i-j\n l=v[0:i]\n r=v[n-j:n]\n p=r+l\n q=[]\n s=sum(p)\n for x in p:\n if x<0:\n q.append(x)\n ... | ['Runtime Error', 'Accepted'] | ['s934551277', 's928873502'] | [3064.0, 3064.0] | [17.0, 34.0] | [414, 426] |
p03032 | u367130284 | 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 ... | ['#include <bits/stdc++.h>\nusing namespace std;\n\n\n\n#define append(a) push_back(a)\n\n#define str(a) to_string(a)\n\n\nint main(void){\n int n,k,tmp;\n vector<int> v,motimono,ans;\n cin>>n>>k;\n for(int i=0 ;i<n ;i++){\n cin>>tmp;\n v.push_back(tmp);\n }\n \n \n if (k>=n){\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s541913632', 's795065143', 's930758727', 's269047218'] | [2940.0, 3064.0, 3064.0, 4904.0] | [17.0, 19.0, 21.0, 46.0] | [1392, 878, 745, 334] |
p03032 | u376328830 | 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())\nD =map(int,input().split())\nans = 0\n\nfor toridasukaisu in range(min(k,n)+1):\n for i in range(toridasukaisu+1):\n value = []\n l = i\n r = toridasukaisu - i\n for j in range(l):\n value.append(D[j])\n ... | ['Runtime Error', 'Accepted'] | ['s032926215', 's824418079'] | [3316.0, 3316.0] | [21.0, 37.0] | [847, 853] |
p03032 | u377415042 | 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 ... | ['def main():\n N, K = map(int, input().split())\n V = [int(v) for v in input().split()]\n\n m = 0\n\n r = min(N, K)\n for a in range(r+1):\n for b in range(r+1-a):\n if b == 0:\n v = V[:a]\n else:\n v = V[:a] + V[-b:]\n v.sort() \n... | ['Runtime Error', 'Accepted'] | ['s416907786', 's806757080'] | [3064.0, 3064.0] | [18.0, 24.0] | [489, 550] |
p03032 | u386782537 | 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 ... | ['\nN, M=map(int, input().split())\nV = input().split()\nV_i = [int(i) for i in V]\n\nans = 0\nfor i in range(M):\n for j in range(M-i):\n if i+j >N:\n break;\n num = 0\n dump_num = []\n for k in range(i):\n num += V_i[k]\n dump_num.append(V_i[k])\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s470992730', 's681427040', 's471808987'] | [3064.0, 3572.0, 3064.0] | [18.0, 55.0, 50.0] | [676, 707, 683] |
p03032 | u405483159 | 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 \nmax_number = 0\nfor A in range( K ):\n for B in range( K ):\n J = K - A - B\n if J < 0:\n continue\n if A + B >= N:\n hand = V\n else:\n hand = sorted( set( V[ : A ] + V[ N - B : ] ))\n max_number = max( max... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s548419080', 's949950564', 's186687934'] | [3064.0, 7412.0, 3064.0] | [30.0, 119.0, 58.0] | [357, 385, 495] |
p03032 | u417365712 | 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 copy import deepcopy\nfrom collections import deque\nfrom functools import partial, lru_cache\nfrom heapq import heappush, heappop\n\ninputs = open(0).readlines()\nn, k = map(int, inputs[0].split())\nV = deque(map(int, inputs[1].split()))\nW = []\n\ndef dfs(root, option, function):\n nodes, stack = [], [root]... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s402041997', 's576449383', 's837397700', 's339761392'] | [3740.0, 3700.0, 3680.0, 3316.0] | [2104.0, 23.0, 24.0, 366.0] | [1233, 1314, 1180, 362] |
p03032 | u419877586 | 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\nimport heapq\n\nN, K=map(int, input().split())\nV=list(map(int, input().split()))\nlim=min(N, K)\nans=0\nfor num in range(lim+1):\n for A in range(num+1):\n B=num-A\n d=deque(V)\n hands=[]\n while d and len(h)<A:\n hands.append(d.popleft())\n ... | ['Runtime Error', 'Accepted'] | ['s552126865', 's188096507'] | [3316.0, 3444.0] | [20.0, 54.0] | [560, 568] |
p03032 | u426764965 | 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 ... | ["def abc128_d():\n n, k = map(int, input().split())\n v = list(map(int, input().split()))\n ans = 0\n\n for a in range(max(1, k+1)): \n for b in range(max(1, k-a+1)): \n arr = []\n if a > 0: arr += v[:a]\n if b > 0: arr += v[-b:]\n arr.sort()\n ... | ['Wrong Answer', 'Accepted'] | ['s817881385', 's483085619'] | [84612.0, 9168.0] | [959.0, 54.0] | [611, 664] |
p03032 | u454735747 | 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\nfor l in range(k + 1):\n\tfor r in range(k - l + 1):\n\t\thand = []\n if l + r > n:\n break\n\t\t\n\t\thand = v[: l]\n \n\t\thand.extend(v[n - r:])\n \n\t\thand_sum = sum(hand) \n\t\thand.sort()\n \... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s376127705', 's586341381', 's601781725'] | [2940.0, 3064.0, 3064.0] | [17.0, 17.0, 30.0] | [547, 504, 540] |
p03032 | u465699806 | 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 itertools as it\nimport collections as col\nimport heapq\nimport sys\nsys.setrecursionlimit(10**9)\n"""\nN=int(input())\nD=[]\nfor i in range(N):\n s,p=input().split()\n D.append((s, int(p), i+1))\nD.sort(key=lambda d: (d[0], -d[1], d[2]))\n\nfor d in D:\n print(d[2])\n"""\n"""\nN,M=map(int, input().split()... | ['Wrong Answer', 'Accepted'] | ['s654969894', 's289052755'] | [3828.0, 3316.0] | [57.0, 36.0] | [1248, 1098] |
p03032 | u480200603 | 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()))\nM = 0\n\nfor left in range(k + 1):\n for right in range(k - left + 1):\n if left + right > n:\n break\n hold = []\n hold.extend(v[:left])\n hold.extend(v[n-right:])\n hold.sort()\n total = su... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s144724374', 's642541395', 's968736634', 's996654121', 's559396612'] | [3064.0, 3572.0, 3064.0, 3064.0, 3188.0] | [18.0, 35.0, 17.0, 18.0, 29.0] | [478, 608, 525, 473, 492] |
p03032 | u494379309 | 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 ... | ['def v_and_num(queue):\n output = [(0,0)]\n for i in range(len(queue)+1):\n hand = queue[:i]\n hand = sorted(hand)\n for j in range(len(hand)):\n output.append((i+j,sum(hand[j:])))\n if hand[j] > 0:\n break\n return output\n\n\nn,k = list(map(int,input().split(" ")))\nD = list(map(int,in... | ['Wrong Answer', 'Accepted'] | ['s988493130', 's696395894'] | [3572.0, 3188.0] | [34.0, 27.0] | [847, 831] |
p03032 | u499381410 | 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()))\nque = list(map(int, input().split()))\nans = 0\npop_push = [(i, k-i) for i in range(k, math.ceil(k/2)-1, -1)]\nfor pop, push in pop_push:\n left_right = [(j, pop-j) for j in range(pop+1)]\n for left, right in left_right:\n ans = max(ans, sum(sorted(que[:left] + lis... | ['Runtime Error', 'Accepted'] | ['s243317273', 's100857395'] | [3064.0, 3064.0] | [18.0, 385.0] | [356, 552] |
p03032 | u518042385 | 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\nn,k=map(int,input().split())\nl=list(map(int,input().split()))\nlr=[[0,[]]]\nll=[[0,[]]]\nsumr,suml=0,0\nlrr=[]\nllr=[]\nfor i in range(n):\n suml+=l[i]\n sumr+=l[-1-i]\n if l[i]<0:\n llr.append(l[i])\n if l[-1-i]<0:\n lrr.append(l[-1-i])\n llr1=copy.deepcopy(llr)\n lrr1=copy.deepcopy(lrr)\n ... | ['Wrong Answer', 'Accepted'] | ['s322348652', 's204202311'] | [3572.0, 3444.0] | [36.0, 36.0] | [750, 730] |
p03032 | u532966492 | 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]\nfor i in range(K+1):\n #print(i)\n for j in range(i+1):\n if N<=j:\n temp=sorted(V)\n elif j-i!=0:\n temp=sorted(V[:j]+V[max(i,j-i):])\n else:\n temp=sorted(V[:j])\n t=0\n ... | ['Runtime Error', 'Accepted'] | ['s804585947', 's554658519'] | [3064.0, 3064.0] | [26.0, 58.0] | [941, 423] |
p03032 | u556225812 | 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())\nlst = list(map(int, input().split()))\nans = 0\nfor l in range(K+1):\n for r in range(K+1-l):\n if l + r > N:\n break\n get = lst[:l]\n get.extend(lst[N-r:])\n cnt = sum(get)\n get.sort()\n for i in range(min(K-l-r, l+r)):\n ... | ['Runtime Error', 'Accepted'] | ['s380343993', 's838383664'] | [3064.0, 3064.0] | [18.0, 30.0] | [416, 416] |
p03032 | u570018655 | 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\nfrom copy import deepcopy\n\nN, K = map(int, input().split())\nV = list(map(int, input().split()))\nq = deque()\nfor v in V:\n q.append(v)\nans = 0\njotai = []\nfor l in range(K + 1):\n for r in range(K + 1 - l):\n if l + r <= N and 2 * l + 2 * r > K:\n jotai.app... | ['Wrong Answer', 'Accepted'] | ['s506410224', 's453188070'] | [3444.0, 3572.0] | [51.0, 167.0] | [683, 683] |
p03032 | u571075527 | 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 -*-\n\nn,k=list(map(int, input().split()))\nd=list(map(int, input().split()))\nanswer=0\nfor a in range(k+1):\n for b in range(k-a+1):\n print(a,b,k-a-b)\n in_hand=d[:a]\n in_hand.extend(list(reversed(d[a:]))[:b])\n in_hand=sorted(in_hand)\n if k-a-b<0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s041523256', 's343655736', 's702232203', 's786219972'] | [3604.0, 3060.0, 3064.0, 3064.0] | [56.0, 41.0, 18.0, 659.0] | [432, 330, 432, 475] |
p03032 | u572142121 | 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\nn,k=map(int, input().split())\nV=list(map(int, input().split()))\nans=0\nfor i in range(k+1):\n for j in range(k+1-i):\n if i+j>n:\n break \n \n A=sorted(V[:i]+V[n-j:])\n a=min(n-i-j,bisect.bisect_left(A, 0))\n ans=max(ans,sum(S[a:]))\nprint(ans)', 'import bisect\nn,k=map(int, inp... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s080653534', 's241901644', 's642768752'] | [3064.0, 3064.0, 3064.0] | [18.0, 24.0, 24.0] | [299, 299, 299] |
p03032 | u572193732 | 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(min(N, K) + 1):\n for j in range(i+1):\n Juel = V[:j] + V[N-i+j:]\n Juel.sort()\n sum_v = 0\n for k in range(min(K-i, i)):\n Juel[k] = max(Juel[k], 0)\n ans = max(ans, sum(... | ['Wrong Answer', 'Accepted'] | ['s710928034', 's150409739'] | [3064.0, 3064.0] | [35.0, 35.0] | [339, 324] |
p03032 | u581187895 | 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\n\nN, K = map(int, input().split())\nV = list(map(int, input().split()))\n\nmax_value = 0\n\nfor L in range(N+1):\n for R in range(N+1):\n if L+R > K:\n break\n if L+R > N:\n break\n get = V[:L]\n if R > 0:\n get += V[-R:]\n get.sort()\n print(get) ###\n \n rest = K - (L+R) ... | ['Wrong Answer', 'Accepted'] | ['s733204616', 's234240369'] | [3572.0, 3064.0] | [35.0, 28.0] | [795, 780] |
p03032 | u582333355 | 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\nops = min(N,K)\n\nans = 0\nfor A in range(0,ops+1):\n l = V[:A]\n l.sort()\n for B in range(0,ops+1-A):\n ll = l[:]\n if B > 0:\n ll = l + V[-B:]\n ll.sort()\n for i in range(0,min(K-(A+B),A+B))... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s356623206', 's951641729', 's887119625'] | [3444.0, 3700.0, 3064.0] | [33.0, 32.0, 27.0] | [463, 369, 441] |
p03032 | u595952233 | 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(min(n, k)):\n for right in range(min(n-left+1, k-left+1)):\n l = v[:left]\n l+=v[::-1][:right]\n l.sort()\n temp = sum(l)\n for t in range(max(0, min(len(l), k-left-right+1))):\n ... | ['Wrong Answer', 'Accepted'] | ['s401209374', 's718837920'] | [3064.0, 3064.0] | [30.0, 32.0] | [395, 395] |
p03032 | u608327706 | 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()))\nrevV = list(reversed(V))\n\nN = N + 1 \nres = 0\nAB = []\nif N < K:\n\tAB = V\n\tk = min(K-len(AB), len(AB))\n\tfor idx in range(k):\n\t\tif AB[idx] < 0:\n\t\t\tAB[idx] = 0\n\tres = max(res, sum(AB))\nelse:\n\tfor a in range(N):\n\t\tfor b in rang... | ['Wrong Answer', 'Accepted'] | ['s666156685', 's445143490'] | [3188.0, 3064.0] | [25.0, 21.0] | [544, 526] |
p03032 | u623687794 | 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())\nd=list(map(int,input().split()))\nd=d*2\nans=0\nfor i in range(k):\n \n for j in range(i+1):\n have=[d[n+c-j] for c in range(i)] \n have.sort()\n for h in range(k-i):\n if have[0]>=0:\n break\n del have[0]\n \n if sum(have)>ans:\n ans=sum(have)\npri... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s382586761', 's706414678', 's936516464'] | [3064.0, 3444.0, 3064.0] | [17.0, 42.0, 32.0] | [396, 452, 445] |
p03032 | u626000772 | 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())\n*V, = map(int, input().split())\n#N, K = 6, 4\n#V = [-10, 8, 2, 1, 2, 6]\nmotimono = []\nans = []\n\nif K >= N: \n K -= N\n heapq.heapify(V)\n ans.append(sum(V))\n for i in range(K):\n if len(V)>0:\n heapq.heappop(V)\n ans.append(sum(... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s612206359', 's942056890', 's865607733'] | [3064.0, 3064.0, 3316.0] | [18.0, 18.0, 25.0] | [996, 996, 1008] |
p03032 | u626337957 | 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())\nA = list(map(int, input().split()))\n\nans = 0\nmax_ope = min(N, K)\nfor put in range(K+1):\n if put > K//2:\n break\n get = min(K-put, N)\n for right in range(get+1):\n left = get - right\n jewels = A[:right] + A[N-left:]\n jewels.sort()\n ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s173999795', 's250893266', 's941682882', 's140105015'] | [3064.0, 3064.0, 3064.0, 3064.0] | [57.0, 48.0, 19.0, 34.0] | [510, 531, 432, 506] |
p03032 | u633051991 | 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 ... | ['\nimport numpy as np\nimport copy\n# N,K = map(int,input().split())\n# V = list(map(int,input().split()))\nN = 17\nK = 100\nV = [i for i in range(N)]\n\nV = [0 for i in range(N)] + V + [0 for i in range(N)] \n\ndp = {}\n\n\ndef search(start, end, k, own, discard=False):\n if k==K:\n return sum(own)\n key... | ['Time Limit Exceeded', 'Accepted'] | ['s533193934', 's826664028'] | [33824.0, 3064.0] | [2109.0, 58.0] | [1335, 485] |
p03032 | u652081898 | 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()))\nlim = min(n, k)\nans = [0]\n\nfor a in range(lim+1):\n for b in range(lim-a+1):\n hand = sorted(v[:a]+v[n-b:])\n hs = sum(hand)\n for i in range(min(lim-a-b+1, a+b)):\n test = hand[i]\n if test < 0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s628248209', 's638511761', 's023002103'] | [3064.0, 3572.0, 3064.0] | [27.0, 37.0, 31.0] | [370, 398, 366] |
p03032 | u655975843 | 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\nfrom collections import deque\nns = lambda: sys.stdin.readline().rstrip()\nni = lambda: int(ns())\nnm = lambda: map(int, sys.stdin.readline().split())\nnl = lambda: list(nm())\nnsm = lambda: map(str, sys.stdin.readline().split())\n\nn, k = nm()\nv = nl()\nd = deque(v)\nans = 0\nfor m in range(k + 1):\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s345471969', 's545351844', 's363324984'] | [3316.0, 3316.0, 3436.0] | [21.0, 22.0, 161.0] | [946, 968, 958] |
p03032 | u656845405 | 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 ... | ['class MyClass():\n maxNumber = 0\n\n def roop(self, baseList, opeCount):\n listCount = len(baseList)\n roopMax = listCount if listCount < opeCount else opeCount\n for leftCount in range(1, roopMax):\n for rightCount in range(0, roopMax - leftCount -1):\n leftList =... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s701065374', 's837593319', 's867955731', 's989717834', 's845639003'] | [3064.0, 3064.0, 3192.0, 3572.0, 3188.0] | [25.0, 17.0, 22.0, 2104.0, 26.0] | [1119, 1100, 1128, 1345, 1309] |
p03032 | u661707952 | 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.4\n\n# abc128_d\n\nimport collections\nimport itertools\n\ndef find_index(iterable, func):\n i = 0\n for it in iterable:\n if func(it):\n break\n i += 1\n return i\n\ndef slice_deq(deq, n):\n return itertools.islice(deq, 0, n)\n\ndef main():\n # Input\n ... | ['Wrong Answer', 'Accepted'] | ['s530868680', 's858642312'] | [3820.0, 3316.0] | [40.0, 30.0] | [979, 951] |
p03032 | u664373116 | 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=list(map(int,input().split()))\na=list(map(int,input().split()))\nans=0\nfor i in range(k+1):\n a_cp=a.copy()\n\n tmp=a_cp[:i]\n a_cp[i:]\n for j in range(k+1-i):\n cal=tmp+a_cp[min(n-j,0):]\n \n heapq.heapify(cal)\n ans=max(ans,sum(cal))\n for _ in ran... | ['Wrong Answer', 'Accepted'] | ['s333361494', 's368584263'] | [3064.0, 3444.0] | [201.0, 154.0] | [465, 994] |
p03032 | u667024514 | 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())\nlis = list(map(int,input().split()))\nans = 0\nfor i in range(n):\n for j in range(n-i+1):\n num = lis[:i]\n if j > 0:\n num += lis[-j:]\n if len(num) <= k:\n cnt = min(len(num),k-len(num))\n num.sort()\n for h in rang... | ['Runtime Error', 'Accepted'] | ['s947752234', 's283156387'] | [3064.0, 3064.0] | [17.0, 36.0] | [404, 400] |
p03032 | u667084803 | 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())\nA = list(map(int,input().split()))\n\nans = - 10**7\nfor i in range(min(N,K)+1):\n for j in range(min(N,K)+1-i\n if j == 0:\n st = A[:i]\n else:\n st = A[:i]+ A[-j:]\n st.sort(reverse = 1)):\n for suteru in range(K - i - j):\n ans = max(ans, sum(st[:i+j-sut... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s835335116', 's892179352', 's179865261'] | [3064.0, 3064.0, 3064.0] | [17.0, 89.0, 89.0] | [328, 328, 325] |
p03032 | u673361376 | 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\n\nN,K = map(int,input().split())\nV = list(map(int,input().split()))\nans = -float('inf')\nfor ai in range(K+1):\n for bi in range(K+1):\n if ai+bi > min(K,N): continue\n have = []\n if ai != 0: [heapq.heappush(have, v) for v in V[:ai]]\n if bi != 0: [heapq.heappush(have, v) for v in V[-bi:... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s279250733', 's660864416', 's889608583'] | [3064.0, 3064.0, 3188.0] | [49.0, 76.0, 46.0] | [426, 439, 579] |
p03032 | u684120680 | 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(i) for i in input().split()]\nv = [int(i) for i in input().split()]\n\n\n# 0<=i<=k//2\n\n\n\nans = 0\nfor k_i in range(k):\n for i in range(k_i//2+1):\n \n for j in range(k_i-i+1):\n #print(j)\n hand_tmp = v[:j] + v[::-1][:k_i-i-j]\n hand_tmp.sort()\n #print(hand_tmp)\n han... | ['Wrong Answer', 'Accepted'] | ['s155953325', 's731634186'] | [3060.0, 3064.0] | [796.0, 203.0] | [517, 757] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.