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
p02727
u620464724
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import sys\nsys.setrecursionlimit(4100000)\n\nx,y,a,b,c = map(int,input(),split())\np = sort(list(map(int,input(),split())))\nq = sort(list(map(int,input(),split())))\nr = list(map(int,input(),split()))\nans = 0\n\nfor k in range(1,x+1):\n r.append(p[-k])\nfor v in range(1,y+1):\n r.append(p[-v])\n\nrs = sort(r...
['Runtime Error', 'Runtime Error', 'Accepted']
['s688941157', 's701106743', 's678434347']
[3064.0, 3064.0, 23200.0]
[17.0, 18.0, 320.0]
[365, 322, 371]
p02727
u621225737
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = list(map(int,input().split()))\np = list(map(int,input().split()))\nq = list(map(int,input().split()))\nr = list(map(int,input().split()))\n\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\nZ = 0\nwhlie True:\n if max(p[X - 1], q[Y - 1], r[Z]) == r[Z]:\n if p[X - 1] < q[Y - 1]:...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s078200605', 's138325295', 's258574971', 's446775060', 's898548112', 's300160557']
[3060.0, 22560.0, 3064.0, 3064.0, 22720.0, 23328.0]
[17.0, 235.0, 17.0, 17.0, 268.0, 297.0]
[436, 390, 436, 393, 431, 479]
p02727
u646130340
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\npx = p[:X]\nqy = q[:Y]\nprint(qy)\nwhile r and min(px[-1], qy[1]) < r[0]:\n px.sort(reverse=Tru...
['Runtime Error', 'Accepted']
['s125422503', 's959931427']
[22720.0, 22504.0]
[2105.0, 235.0]
[450, 263]
p02727
u647287452
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\np = sorted(map(int, input().split()), reverse=True)[: X]\nq = sorted(map(int, input().split()), reverse=True)[: Y]\nr = list(map(int, input().split()))\n\nall = p + q + r\nall.sort(reverse=True)\nprint((all[:X + Y]))', 'X, Y, A, B, C = map(int, input().split())\np = sorted(m...
['Wrong Answer', 'Accepted']
['s093117325', 's696048376']
[26016.0, 22548.0]
[262.0, 242.0]
[252, 255]
p02727
u649326276
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c = list(map(int,input().split()));\np = list(map(int,input().split()));\nq = list(map(int,input().split()));\nr = list(map(int,input().split()));\n\numami = [[0]*2 for i in range(a+b+c)];\n\nfor i in range(a) :\n umami[i][0] = 0;\n umami[i][1] = p[i];\nfor i in range(b) :\n umami[a+i][0] = 1;\n u...
['Wrong Answer', 'Accepted']
['s766519391', 's797448300']
[51476.0, 53520.0]
[1112.0, 969.0]
[832, 1095]
p02727
u652892331
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['na, nb, a, b, c = map(int, input().split())\nab_list = [0 for i in range(na + nb)]\nab_list[:na] = sorted(list(map(int, input().split())), reverse=True)[:na]\nab_list[na:] = sorted(list(map(int, input().split())), reverse=True)[:nb]\nc_list = sorted(list(map(int, input().split())), reverse=True)[:min(na + nb, c)]\n\n...
['Wrong Answer', 'Accepted']
['s620306275', 's301692936']
[22492.0, 22212.0]
[269.0, 254.0]
[566, 371]
p02727
u677121387
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c = map(int,input().split())\np = [int(i) for i in input().split()]\nq = [int(i) for i in input().split()]\nr = [int(i) for i in input().split()]\np.sort(reverse=True)\nq.sort(reverse=True)\nfor i in range(x): r.append(p[i])\nfor i in range(y): r.append(q[i])\nr.sort(reverse=True)\nprint(sum(r[:x+y])', 'x,y,a...
['Runtime Error', 'Accepted']
['s715396837', 's939394388']
[3064.0, 23644.0]
[17.0, 275.0]
[300, 301]
p02727
u686036872
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\n\nP = list(map(int, input().split()))\nQ = list(map(int, input().split()))\nR = list(map(int, input().split()))\n \nP.sort(reverse=True)\nQ.sort(reverse=True)\nR.sort(reverse=True)\n\nA=P[:X]+Q[:Y]+R\n\nA.sort(reverse=True)\n\nprint(A[X+Y])', 'N, Y, A, B, C = map(int,...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s468242445', 's594000399', 's561511553']
[22720.0, 22720.0, 22720.0]
[254.0, 194.0, 259.0]
[276, 276, 282]
p02727
u693007703
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = [int(i) for i in input().split()]\nreds = sorted([int(i) for i in input().split()], reverse=True)\ngreens = sorted([int(i) for i in input().split()], reverse=True)\nclears = sorted([int(i) for i in input().split()], reverse=True)\n\nclear_acc = [0]\n\nfor i in clears:\n clear_acc.append(rr[-1]+i)\n...
['Runtime Error', 'Accepted']
['s944686152', 's538053241']
[22460.0, 33568.0]
[209.0, 331.0]
[596, 603]
p02727
u693391925
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x, y, a, b, c = map(int, input().split())\narrayP = list(map(int, input().split()))\narrayQ = list(map(int, input().split()))\narrayR = list(map(int, input().split()))\narrayP.sort(reverse=True)\narrayQ.sort(reverse=True)\narrayR.sort(reverse=True)\narrayAns = []\nfor i in range(x):\n arrayAns.append(int(arrayP[i]...
['Runtime Error', 'Accepted']
['s170764236', 's778158470']
[23328.0, 23328.0]
[297.0, 233.0]
[533, 259]
p02727
u693933222
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x, y, a, b, c = map(int, input().split())\np = sorted(list(map(int, input().split())),reverse = True)\nq = sorted(list(map(int, input().split())),reverse = True)\nr = sorted(list(map(int, input().split())),reverse = True)\n\n\nans = 0\n\nwhile (p[0] > r[0]):\n ans += p.pop(0)\n x -= 1\n if (x == 0):\n ...
['Wrong Answer', 'Accepted']
['s648792535', 's863454825']
[30988.0, 23584.0]
[2105.0, 258.0]
[551, 308]
p02727
u698919163
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X,Y,A,B,C = map(int,input().split())\np = list(map(int,input().split()))\nq = list(map(int,input().split()))\nr = list(map(int,input().split()))\n\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\nalist = []\nans = 0\n\nfor i in range(X):\n alist.append(p[i])\n \nfor j in range(Y):\n alist...
['Runtime Error', 'Accepted']
['s740694993', 's337623177']
[27312.0, 23328.0]
[375.0, 301.0]
[569, 450]
p02727
u703214333
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import sys\n#from collections import deque\ninput = sys.stdin.buffer.readline\n\nx, y, a, b, c = map(int, input().split())\np = sorted(list(map(int,input().split())),reverse=True)\nq = sorted(list(map(int,input().split())),reverse=True)\nr = sorted(list(map(int,input().split())),reverse=True)\nans = p[:x]\nans[x:x] =...
['Runtime Error', 'Accepted']
['s032480211', 's766709853']
[21596.0, 22340.0]
[268.0, 247.0]
[498, 377]
p02727
u707124227
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['#n,x,y=map(int,input())\n\nfrom collections import deque\n\nx,y,a,b,c=map(int,input().split())\np=list(map(int,input().split()))\nq=list(map(int,input().split()))\nr=list(map(int,input().split()))\np.sort()\nq.sort()\np=deque(p[a-x:])\nq=deque(q[b-y:])\nr.sort()\nfor ri in r:\n if ri > p[0] and q[0] >= p[0]:\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s501746267', 's789666343', 's994346623']
[23616.0, 23616.0, 29688.0]
[222.0, 315.0, 161.0]
[557, 559, 236]
p02727
u707808519
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import bisect\nX, Y, A, B, C = map(int, input().split())\nred = [int(x) for x in input().split()]\ngre = [int(x) for x in input().split()]\nnon = [int(x) for x in input().split()]\nred.sort(reverse=True)\ngre.sort(reverse=True)\nnon.sort()\nans = red[:X] + gre[:Y]\nans.sort(reverse=True)\nif non[-1] > ans[-1]:\n c...
['Runtime Error', 'Accepted']
['s617242432', 's450553002']
[22592.0, 24064.0]
[232.0, 252.0]
[431, 273]
p02727
u711340028
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import sys\nimport heapq\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nX,Y,A,B,C = map(int, readline().split())\n\nP = list(map(int, readline().split()))\nQ = list(map(int, readline().split()))\nR = list(map(int, readline().split()))\n\nprint(len(P), ...
['Wrong Answer', 'Accepted']
['s254185908', 's162230271']
[21212.0, 22720.0]
[399.0, 246.0]
[785, 389]
p02727
u711693740
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\ngoukei = X + Y\ndelicious = 0\nred = 0\ngreen = 0\n\n\ndef max_pop(p):\n pidx = p.index(max(p))\n maxp = p.pop(pidx)\n return maxp\n\n\nmaxp = max_pop(p)...
['Runtime Error', 'Accepted']
['s197183187', 's629250853']
[22720.0, 23328.0]
[2109.0, 351.0]
[820, 626]
p02727
u720636500
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x, y, a, b, c = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\np.sort(reverse = True)\nq.sort(reverse = True)\nr.sort(reverse = True)\npp = p[:x]\nqq = q[:y]\nrr = r[:(x+y)]\nppqq = pp + qq\nppqq.sort()\nfor i in range(len(ppqq...
['Runtime Error', 'Runtime Error', 'Accepted']
['s082988116', 's089415600', 's759144831']
[23328.0, 23328.0, 23328.0]
[1703.0, 1707.0, 242.0]
[382, 412, 360]
p02727
u726285999
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import sys\nsys.setrecursionlimit(10**6)\n\n\nmod = 10 ** 9 + 7\nN = 2* 10 ** 5 \nfact = [1, 1] # fact[n] = (n! mod p)\nfactinv = [1, 1] # factinv[n] = ((n!)^(-1) mod p)\ninv = [0, 1] \n\nfor i in range(2, N + 1):\n fact.append((fact[-1] * i) % mod)\n inv.append((-inv[mod % i] * (mod // i)) % mod)\n fact...
['Runtime Error', 'Accepted']
['s439570670', 's881668335']
[27132.0, 23340.0]
[261.0, 291.0]
[1859, 373]
p02727
u727057618
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
["def main():\n X, Y, A, B, C = [int(i) for i in input().split()]\n red = [int(i) for i in input().split()]\n blue = [int(i) for i in input().split()]\n noc = [int(i) for i in input().split()]\n red = sorted(red)[-X:]\n blue = sorted(blue)[-Y:]\n rb = sorted(red + blue)\n score = sum(rb)\n no...
['Wrong Answer', 'Accepted']
['s771212151', 's815929036']
[23340.0, 23340.0]
[223.0, 247.0]
[568, 568]
p02727
u728566015
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\np = sorted(list(map(int, input().split())), reverse=True)\nq = sorted(list(map(int, input().split())), reverse=True)\nr = sorted(list(map(int, input().split())), reverse=True)\n\nRed = p[:X]\nGreen = q[:Y]\n\nApple = sorted(Red + Green)\nfor i in range(C):\n print(Apple[i...
['Runtime Error', 'Accepted']
['s402362084', 's024801193']
[23200.0, 23456.0]
[406.0, 255.0]
[382, 330]
p02727
u736641785
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = input().split()\nP = list(map(int,input().split()))\nQ = list(map(int,input().split()))\nR = list(map(int,input().split()))\nP.sort(reverse=True)\nQ.sort(reverse=True)\nR.sort(reverse=True)\n\nANS_list = P[:X]\nANS_list.extend(Q[:Y])\nANS_list.sort()\nc = 0\nfor i in range(len(R)):\n if ANS_list[i]...
['Runtime Error', 'Accepted']
['s442693484', 's459873856']
[23328.0, 23328.0]
[205.0, 246.0]
[409, 407]
p02727
u738898077
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['from collections import deque\nx,y,a,b,c = map(int,input().split())\np1 = list(map(int,input().split()))\nq1 = list(map(int,input().split()))\nr1 = list(map(int,input().split()))\nans = []\np1.sort(reverse=1)\nq1.sort(reverse=1)\nr1.sort(reverse=1)\n\n\np=deque(p1[0:x])\nq=deque(q1[0:y])\nr=deque(r1[0:x+y])\n\nlp = p...
['Wrong Answer', 'Accepted']
['s383230884', 's029165367']
[26144.0, 23616.0]
[572.0, 329.0]
[922, 922]
p02727
u740284863
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X,Y,A,B,C = map(int,input().split())\nA = list(map(int,input().split()))\nB = list(map(int,input().split()))\nC = list(map(int,input().split()))\nA.sort()\nB.sort()\nC.sort(\nans = 0\n\nfor i in range(X):\n if A[-1] >= C[-1]:\n ans += A[-1]\n A.pop()\n else:\n ans += C[-1]\n C.pop()\...
['Runtime Error', 'Accepted']
['s243587445', 's785404197']
[8868.0, 28008.0]
[26.0, 321.0]
[449, 592]
p02727
u741612283
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c = (int(x) for x in input().split())\n\nfrom bisect import insort\n\np_list = []\nq_list = []\nr_list = []\n\nfor value in input().split():\n insort(p_list, int(value))\n\nfor value in input().split():\n insort(q_list, int(value))\n \nfor value in input().split():\n insort(r_list, int(value))\n \nred...
['Wrong Answer', 'Accepted']
['s949782484', 's409681132']
[23232.0, 22720.0]
[2104.0, 428.0]
[792, 734]
p02727
u747391638
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c = map(int, input().split(" "))\nplist= list(map(int, input().split(" ")))\nqlist= list(map(int, input().split(" ")))\nrlist= list(map(int, input().split(" ")))\n\nplist.extend(qlist)\nplist.sort()\n\nrlist.sort(reverse=True)\n\nn = min(len(plist),len(rlist))\nslist = plist[0:x+y-1]\nulist = plist[0:x+y-1]\n...
['Runtime Error', 'Accepted']
['s690565852', 's907378289']
[23472.0, 22504.0]
[2105.0, 244.0]
[445, 429]
p02727
u751717561
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['\nimport numpy as np\nX, Y, A, B, C = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\n\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\n\nA = A[0:X]\nB = B[0:Y]\n#C = np.array(C)\n\narr = A+B\n\nflag = 1\n\nwhi...
['Time Limit Exceeded', 'Accepted']
['s368132292', 's998321552']
[31308.0, 31276.0]
[2111.0, 371.0]
[556, 315]
p02727
u758475901
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X,Y,A,B,C = map(int,input().split())\np = list(map(int,input().split()))\nq = list(map(int,input().split()))\nr = list(map(int,input().split()))\nL = p + r\nL.sort(reverse = True)\nans = 0\nfor i in range(X):\n ans += int(L[i])\nfor i in range(X): \n L.remove(L[i])\nset(L) = set(L)-set(p) \nM = q + list(L)\nM.sor...
['Runtime Error', 'Accepted']
['s553132610', 's029255812']
[3064.0, 23328.0]
[17.0, 235.0]
[389, 254]
p02727
u759518460
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x, y, na, nb, nc = map(int, input().split()) \na = [int(i) for i in input().split()]\nb = [int(i) for i in input().split()]\nc = [int(i) for i in input().split()]\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\na = a[:x]\nb = b[:y]\n\nai = len(a) - 1\nbi = len(b) - 1\nprint(a, b)\nprint(ai, bi)\nfo...
['Wrong Answer', 'Accepted']
['s595511349', 's955435463']
[23644.0, 23232.0]
[272.0, 253.0]
[738, 713]
p02727
u759718348
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\nAA = list(map(int, input().split()))\nBB = list(map(int, input().split()))\nCC = list(map(int, input().split()))\na = sorted(AA, reverse=True)\nb = sorted(BB, reverse=True)\nc = sorted(CC, reverse=True)\n\nif X < A:\n del a[X:]\n\nif Y < B:\n del b[Y:]\nprint(a)\nprint(b)\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s228863580', 's268498923', 's844222776']
[25688.0, 25276.0, 23728.0]
[263.0, 228.0, 248.0]
[403, 363, 385]
p02727
u762540523
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
["def resolve():\n x, y, a, b, c = map(int, input().split())\n p = sorted(list(map(int, input().split())))[-x:]\n q = sorted(list(map(int, input().split())))[-y:]\n r = sorted(list(map(int, input().split())), reverse=True)\n\tp = sorted(p + q)\n for i in range(min(a + b, c)):\n if p[i] < r[i]:\n ...
['Runtime Error', 'Accepted']
['s962290241', 's207648851']
[2940.0, 21608.0]
[17.0, 374.0]
[424, 475]
p02727
u769870836
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['s,y,a,b,c=map(int,input().split())\np=sorted(list(map(int,input().split())))[-x-y:]\nq=sorted(list(map(int,input().split())))[-x-y:]\nr=sorted(list(map(int,input().split())))\nfor i in range(len(p)):\n r.append(p[i])\n r.append(q[i])\nr=sorted(r)[-x-y:]\nprint(sum(r))\n\n', 'x,y,a,b,c=map(int,input().split())\np=so...
['Runtime Error', 'Runtime Error', 'Accepted']
['s046093225', 's241571808', 's988900138']
[14400.0, 22616.0, 22504.0]
[78.0, 292.0, 244.0]
[264, 260, 188]
p02727
u785573018
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x, y, a, b, c = map(int, input().split())\nLista = sorted(list(map(int, input().split())), reverse = True)\nListb = sorted(list(map(int, input().split())), reverse = True)\nListc = sorted(list(map(int, input().split())), reverse = True)\nif x < a:\n del Lista[x:a]\nif y < b:\n del Listb[y:b]\nwhile len(Listc) >...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s571524260', 's958995052', 's258910116']
[22720.0, 22720.0, 23200.0]
[2104.0, 2105.0, 238.0]
[756, 534, 528]
p02727
u788703383
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['from collections import deque\nx,y,a,b,c = map(int,input().split())\n\np = deque(sorted(list(map(int,input().split()))))\nq = deque(sorted(list(map(int,input().split()))))\nr = deque(sorted(list(map(int,input().split()))))\n\nans = deque(maxlen=(x+y))\n\ndef insertion(z):\n\tglobal x,y\n\tif z == p:\n\t\tx -= 1\n\tel...
['Runtime Error', 'Accepted']
['s152069640', 's459814765']
[23712.0, 23328.0]
[347.0, 250.0]
[569, 262]
p02727
u806779442
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c = map(int,input().split())\nP = list(map(int,input().split()))\nQ = list(map(int,input().split()))\nR = list(map(int,input().split()))\nrlen = len(R)\nif (rlen < x + y):\n max = rlen\nelse:\n max = x + y\n\nP.sort(reverse=True)\nQ.sort(reverse=True)\nR.sort(reverse=True)\n\np = P[:x]\nq = Q[:y]\nr = R...
['Wrong Answer', 'Accepted']
['s369103030', 's080029017']
[29708.0, 22560.0]
[304.0, 271.0]
[505, 469]
p02727
u815218584
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\nP = list(map(int, input().split()))\nQ = list(map(int, input().split()))\nR = list(map(int, input().split()))\n\nR += sorted(R)[-X:]\nR += sorted(Q)[-Y:]\nans = sum(sorted(R)[-(X+Y):])\nprint(ans)\n\n', 'X, Y, A, B, C = map(int, input().split())\nP = list(map(int, input().sp...
['Wrong Answer', 'Accepted']
['s877051072', 's958221834']
[23328.0, 23328.0]
[229.0, 239.0]
[233, 232]
p02727
u821441703
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import sys\nimport numpy as np\n\nX, Y, A, B, C = map(int, sys.stdin.readline().rstrip().split())\nP = list(map(int, sys.stdin.readline().rstrip().split()))\nQ = list(map(int, sys.stdin.readline().rstrip().split()))\nR = list(map(int, sys.stdin.readline().rstrip().split()))\n\nif A == 1 and B == 1 and C == 1:\n an...
['Runtime Error', 'Accepted']
['s267777738', 's964332856']
[171456.0, 41404.0]
[2110.0, 923.0]
[1813, 1922]
p02727
u823885866
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import sys\nX, Y, A, B, C = sys.stdin.readline().split()\nX = int(X)\nY = int(Y)\nC = int(C)\nscoreA = map(int, sys.stdin.readline().split())\nscoreB = map(int, sys.stdin.readline().split())\nscoreC = map(int, sys.stdin.readline().split())\nscoreA.sort(reverse=True)\nscoreB.sort(reverse=True)\nscoreC.sort(reverse=Tru...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s043759560', 's089876239', 's884978188', 's812724686']
[26528.0, 3064.0, 23184.0, 23312.0]
[44.0, 18.0, 243.0, 248.0]
[448, 405, 466, 460]
p02727
u837673618
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['from itertools import *\n\ndef merge(x,y):\n while 1:\n if x and y and x[0] >= y[0] or (not (x and y)) and x:\n yield x.pop(0)\n else y:\n yield y.pop(0)\n else:\n return\n\nX, Y, A, B, C = map(int, input().split())\nP = sorted(map(int, input().split()), reverse=True)\nQ = sorted(map(int, inp...
['Runtime Error', 'Runtime Error', 'Accepted']
['s484876272', 's647585927', 's694271772']
[2940.0, 23372.0, 23428.0]
[17.0, 256.0, 322.0]
[458, 708, 309]
p02727
u840958781
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c=map(int,input().split()) \np=list(map(int,input().split()))\nq=list(map(int,input().split()))\nr=list(map(int,input().split()))\np=sorted(p)[x:]\nq=sorted(q)[y:]\nprint(sum(p+q+r[x+y:]))', 'x,y,a,b,c=map(int,input().split()) \np=list(map(int,input().split()))\nq=list(map(int,input().split()))\nr=list(map(in...
['Wrong Answer', 'Accepted']
['s947432994', 's804570267']
[23328.0, 23328.0]
[177.0, 230.0]
[209, 257]
p02727
u841856382
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\nP = sorted(list(map(int, input().split())), reverse=True)\nQ = sorted(list(map(int, input().split())), reverse=True)\nR = sorted(list(map(int, input().split())), reverse=True)\n\nred = sorted(P[:X])\ngre = sorted(Q[:Y])\nans = sum(red) + sum(gre) \nj, k = 0, 0\n\nfor i in ra...
['Runtime Error', 'Runtime Error', 'Accepted']
['s465293651', 's600501117', 's184917928']
[22720.0, 23200.0, 23604.0]
[216.0, 261.0, 278.0]
[603, 596, 368]
p02727
u864202285
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\n \np = sorted(list(map(int,input().split())), reverse=True)[:X]\nq = sorted(list(map(int,input().split())), reverse=True)[:Y]\nr = sorted(list(map(int,input().split())), reverse=True)\n \nfor i in r:\n p_min = p[X - 1]\n q_min = q[Y - 1]\n \n if p_min > i and q_min ...
['Runtime Error', 'Accepted']
['s424413125', 's999644765']
[22504.0, 23008.0]
[2104.0, 274.0]
[608, 606]
p02727
u865383026
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\ns = p + q + r\nS = sorted(s, reverse = True)\ni = 0\nj = 0\nans = 0\na = 0\nb = 0\nc = 0\nwhile i < (X + Y):\n if S[j] in r:\n c += 1\n r.remove(s[j])\n a...
['Runtime Error', 'Runtime Error', 'Accepted']
['s028598251', 's861863127', 's152690330']
[22924.0, 33440.0, 22720.0]
[2105.0, 2105.0, 249.0]
[513, 522, 293]
p02727
u872158847
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\na = [int(i) for i in input().split()]\nb = [int(i) for i in input().split()]\nc = [int(i) for i in input().split()]\na = sorted(a, reverse=True)\nb = sorted(b, reverse=True)\nc = sorted(c, reverse=True)\na2 = a[:]\nb2 = b[:]\nc2 = c[:]\nsum1 = 0\nfor i in range(X):\n if a...
['Runtime Error', 'Runtime Error', 'Accepted']
['s436475587', 's539706204', 's540755030']
[23372.0, 23200.0, 23340.0]
[2105.0, 2105.0, 252.0]
[755, 754, 270]
p02727
u879266613
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X,Y,A,B,C = map(int,input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\n\np.sort(reverse = True)\nq.sort(reverse = True)\nr.sort(reverse = True)\nl = p[:X] + q[:Y]\nl.sort()\nprint(l)\nfor i in range(min(C,X+Y)):\n if r[i] > l[i]:\n ...
['Wrong Answer', 'Accepted']
['s175486824', 's564387122']
[24816.0, 23328.0]
[296.0, 250.0]
[332, 323]
p02727
u924273546
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['#coding:utf-8\nx, y, a, b, c = map(int, input().split())\np = [int(i) for i in input().split()]\nq = [int(i) for i in input().split()]\nr = [int(i) for i in input().split()]\np[0:x]\nq[0:y]\n\np.extend(q)\np.extend(r)\np.sort(reverse = True)\nprint(p)\n\nans = 0\n\nfor i in range(x + y):\n ans += p[i]\n \nprint("{}...
['Wrong Answer', 'Accepted']
['s927782929', 's228234125']
[30936.0, 23340.0]
[304.0, 290.0]
[314, 360]
p02727
u928784113
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import itertools\nfrom collections import deque,defaultdict,Counter\nfrom itertools import accumulate\nimport bisect\nfrom heapq import heappop,heappush,heapify\nfrom fractions import gcd\nfrom copy import deepcopy\nimport math\nimport queue\nimport numpy as np\n\nMod = 1000000007\nimport sys\nsys.setrecursionlimit(1...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s248264856', 's366970787', 's844624796', 's641478773']
[34028.0, 34072.0, 34076.0, 31316.0]
[387.0, 519.0, 393.0, 374.0]
[2357, 2114, 2360, 1799]
p02727
u934868410
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c = map(int,input().split())\np = sorted(list(map(int,input().split())), reverse=True)\nq = sorted(list(map(int,input().split())), reverse=True)\nr = sorted(list(map(int,input().split())), reverse=True)\npq = sorted(p[:x] + q[:y])\nans = sum(pq)\ni = 0\nwhile i < min(a+b, c):\n if r[i] <= pq[i]:\n break\n...
['Time Limit Exceeded', 'Accepted']
['s706649860', 's728779775']
[29364.0, 29320.0]
[2206.0, 197.0]
[340, 349]
p02727
u941047297
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
["def main():\n x, y, a, b, c = list(map(int, input().split()))\n P = list(map(int, input().split()))\n Q = list(map(int, input().split()))\n R = list(map(int, input().split()))\n P = sorted(P, reverse = True)[:x]\n Q = sorted(Q, reverse = True)[:y]\n ans = P + Q + R\n print(sum(ans[:x + y]))\n\...
['Wrong Answer', 'Accepted']
['s165175165', 's085600231']
[29540.0, 29364.0]
[125.0, 151.0]
[347, 371]
p02727
u944643608
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['from sys import stdin\ninput = stdin.readline\nX, Y, A, B, C = map(int, input().split())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\nr = list(map(int, input().split()))\nred = sorted(p)\ngreen = sorted(q)\nno = sorted(r)\nred.reverse()\ngreen.reverse()\nno.reverse()\n\nc_r = 0\nc_g = 0\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s274343415', 's359970157', 's360887801', 's593152651', 's712933733', 's963872298', 's258590975']
[22720.0, 96176.0, 98280.0, 96176.0, 28732.0, 22720.0, 23328.0]
[311.0, 1019.0, 1042.0, 1039.0, 90.0, 316.0, 241.0]
[943, 988, 303, 1020, 259, 953, 266]
p02727
u948522631
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c=map(int,input().split())\np=list(map(int,input().split())).sort()\nq=list(map(int,input().split())).sort()\nr=list(map(int,input().split())).sort()\n\n\nred=0\nfor _ in range(x):\n\tpMax=max(p)\n\trMax=max(r)\n\tif pMax >rMax:\n\t\tred+=pMax\n\t\tp.pop(p.index(pMax))\n\telse:\n\t\tred+=rMax\n\t\tr.pop(r.ind...
['Runtime Error', 'Accepted']
['s976507829', 's966344713']
[15440.0, 23328.0]
[190.0, 244.0]
[465, 475]
p02727
u948779457
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X,Y,A,B,C = map(int,input().split())\np = list(map(int,input().split()))\nq = list(map(int,input().split()))\nr = list(map(int,input().split()))\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\nZ = X+Y\nP = p[:X]\nQ = q[:Y]\nR = r[:Z]\nans = 0\nif X <= Y:\n S = P + R\n S.sort(reverse=True)\n a = ...
['Wrong Answer', 'Accepted']
['s138611232', 's740084499']
[28772.0, 23596.0]
[294.0, 252.0]
[565, 554]
p02727
u951113446
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['def MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\n\nif __name__ == "__main__":\n X, Y, A, B, C = MI()\n p = LI()\n p.reverse()\n q = LI()\n q.reverse()\n pq = p[:X] + q[:Y] + LI()\n pq.reverse()\n print(sum(pq[:X+Y]))', 'def MI(): return map(int, inp...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s086772997', 's618213730', 's657257422', 's978923010']
[23968.0, 23968.0, 23968.0, 23968.0]
[99.0, 100.0, 237.0, 245.0]
[274, 257, 271, 301]
p02727
u952669998
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c= list(map(int,input().split()))\n\np = list(map(int,input().split()))\nq = list(map(int,input().split()))\nr = list(map(int,input().split()))\np.sort()\nq.sort()\nr.sort()\n\nt=p[0:x] + q[0:y] + r\nt.sort()\nprint(sum(t[0:(x+y)]))', 'X,Y,A,B,C = list(map(int,input().split()))\np = list(map(int,input().split...
['Wrong Answer', 'Accepted']
['s014410933', 's875936265']
[23328.0, 23328.0]
[242.0, 258.0]
[229, 295]
p02727
u954489496
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['from sys import stdin, stdout \n\nX,Y,A,B,C = [int(c) for c in input().split()]\n\np= [int(c) for c in input().split()]\nq= [int(c) for c in input().split()]\nr= [int(c) for c in input().split()]\n\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\np=p[:X]\nq=q[:Y]\n \np.sort()\nq.sort()\nres=su...
['Runtime Error', 'Accepted']
['s133246142', 's567776987']
[22992.0, 22992.0]
[214.0, 323.0]
[1140, 1156]
p02727
u958053648
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X,Y,A,B,C=map(int,input().split())\np=sorted(map(int,input().split()))\nq=sorted(map(int,input().split()))\nr=sorted(map(int,input().split()))\nans=[]\nans+=p[A-X:]\nans+=q[B-Y:]\nans.sort()\ni=0\nj=0\nfor i in ans:\n\tj=max(r)\n\tif i<j:\n\t\tans[i]=r.pop()\nprint(sum(ans))\n\n', 'X,Y,A,B,C=map(int,input().split())\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s234096638', 's334002882', 's596671319', 's946479613', 's067250108']
[22560.0, 23328.0, 23328.0, 23328.0, 23328.0]
[2104.0, 215.0, 2105.0, 263.0, 266.0]
[259, 264, 301, 271, 336]
p02727
u960524878
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c=map(int,input().split())\np,q,r=[reversed(sorted(list(map(int,input())))) for i in range(3)]\np=p[0:x]\nq=q[0:y]\np.append(0)\nq.append(0)\nr.append(0)\n\ns=0\ni,j,k=0,0,0\n\nfor _ in range(x+y):\n if p[i]>=q[j] and p[i]>=r[k]:\n s+=p[i]\n i+=1\n elif q[j]>=r[k]:\n s+=q[j]\n j+=1\n else:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s781101928', 's896335076', 's096799883']
[5236.0, 23200.0, 22720.0]
[22.0, 203.0, 298.0]
[331, 339, 345]
p02727
u961674365
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c=map(int,input().split())\nre=list(map(int,input().split()))\ngr=list(map(int,input().split()))\nmu=list(map(int,input().split()))\nre.sort(reverse=1)\ngr.sort(reverse=1)\nmu.sort(reverse=1)\nans=sum(re[:x])\nind=0\nfor i in range(x):\n v=re[x-1-i]\n if i+1>c:\n break\n w=mu[i]\n if v<w:\n ans+=w-v...
['Wrong Answer', 'Accepted']
['s302066186', 's961640212']
[23328.0, 22720.0]
[301.0, 239.0]
[513, 305]
p02727
u970523279
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x, y, a, b, c = map(int, input().split())\np = sorted(map(int, input().split()))[::-1]\nq = sorted(map(int, input().split()))[::-1]\nr = sorted(map(int, input().split()))[::-1]\n\nz = 0\nred, green = 0, 0\nans = 0\nwhile True:\n finish = True\n if p[x] <= q[y]:\n if z < c and p[x] < r[z]:\n x ...
['Runtime Error', 'Accepted']
['s242480686', 's163920752']
[23248.0, 23072.0]
[268.0, 273.0]
[539, 590]
p02727
u977193988
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['import sys\nimport heapq\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\nMOD = 10 ** 9 + 7\nsys.setrecursionlimit(20000000)\n\n\ndef main():\n X, Y, A, B, C = map(int, input().split())\n red = list(map(int, input().split()))\n green = list(map(int, input().split()))\n nocolor = list(map(in...
['Wrong Answer', 'Accepted']
['s077747058', 's944654391']
[23456.0, 23456.0]
[315.0, 323.0]
[833, 858]
p02727
u985972698
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['def input_multiple_number():\n return map(int, input().split())\ndef input_multiple_number_as_list():\n return list(map(int, input().split()))\n\nxgiven,ygiven,agiven,bgiven,cgiven = input_multiple_number()\n\np_array = input_multiple_number_as_list()\nq_array = input_multiple_number_as_list()\nr_array = input_...
['Wrong Answer', 'Accepted']
['s998202689', 's770482217']
[23328.0, 23328.0]
[271.0, 276.0]
[647, 696]
p02727
u989345508
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['\nx,y,a,b,c=map(int,input().split())\ndef _int(x):\n return -int(x)\np=sorted(list(map(_int,input().split())),reverse=True)[:x]\nq=sorted(list(map(_int,input().split())),reverse=True)[:y]\nr=sorted(list(map(_int,input().split())),reverse=True)\n\np.extend(q)\nans=sorted(p)\n\n\nfor i in range(x+y):\n if len(r)=...
['Runtime Error', 'Accepted']
['s736752396', 's774629980']
[22504.0, 22616.0]
[317.0, 261.0]
[468, 423]
p02727
u991269553
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['x,y,a,b,c = map(int,input().split())\n\np = list(map(int,input().split()))\nq = list(map(int,input().split()))\nr = list(map(int,input().split()))\n\np.sort(reverse=True)\nq.sort(reverse=True)\nr.sort(reverse=True)\n\nred = []\ngreen = []\n\n\n# red.append(p[i])\n# for j in range(y):\n\n\n# print(p[:x])\n# print(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s556231126', 's617037829', 's238159024']
[3064.0, 22560.0, 23328.0]
[18.0, 2105.0, 250.0]
[737, 757, 266]
p02727
u995102075
2,000
1,048,576
You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A, B green apples of deliciousness q_1,q_2, \dots, q_B, and C colorless apples of deliciousness r_1,r_2, \dots, r_C. Before eating a colorless apple, you can paint it red or green, and it will count as a r...
['X, Y, A, B, C = map(int, input().split())\np = sorted([int(i) for i in input().split()], reverse=True)\nq = sorted([int(i) for i in input().split()], reverse=True)\nr = sorted([int(i) for i in input().split()])\n\np = p[:X]\nq = q[:Y]\nplus_r = []\n\nwhile r != [] and (p != [] and r[-1] > p[-1]) or (q != [] and r[-1]...
['Runtime Error', 'Accepted']
['s816996261', 's325231558']
[23200.0, 23200.0]
[266.0, 279.0]
[449, 614]
p02728
u193182854
3,000
1,048,576
We have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i. For each k=1, ..., N, solve the problem below: * Consider writing a number on each vertex in the tree in the following manner: * First, write 1 on Vertex k. * Then, for each of the numbers 2, ..., N in thi...
['import sys\nsys.setrecursionlimit(10**7)\nMOD = 10**9+7\n\nn = int(input())\ng = [[] for _ in range(n)]\nfor _ in range(n-1):\n a, b = map(int, input().split())\n a -= 1; b -= 1\n g[a].append(b)\n g[b].append(a)\n\nlim = 10**6 * 2\nfact = [1, 1] + [0] * (lim-1)\nfact_inv = [1, 1] + [0] * (lim-1)\ninv = [0...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s563193271', 's903235600', 's853172257']
[309160.0, 472316.0, 105896.0]
[3172.0, 3171.0, 2265.0]
[1194, 1190, 1363]
p02728
u532966492
3,000
1,048,576
We have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i. For each k=1, ..., N, solve the problem below: * Consider writing a number on each vertex in the tree in the following manner: * First, write 1 on Vertex k. * Then, for each of the numbers 2, ..., N in thi...
['def main():\n from sys import stdin\n input=stdin.readline\n n = int(input())\n ab = [list(map(int, input().split())) for _ in [0]*(n-1)]\n\n g = [set() for _ in [0]*n]\n for a, b in ab:\n g[a-1].add(b-1)\n g[b-1].add(a-1)\n\n mod = 10**9+7\n fact = [1, 1]\n inv = [pow(i, mod-...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s221017513', 's994410978', 's682869646']
[136288.0, 272132.0, 169824.0]
[1390.0, 3172.0, 2828.0]
[3064, 4082, 3060]
p02728
u608088992
3,000
1,048,576
We have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i. For each k=1, ..., N, solve the problem below: * Consider writing a number on each vertex in the tree in the following manner: * First, write 1 on Vertex k. * Then, for each of the numbers 2, ..., N in thi...
['import sys\nfrom collections import deque\nsys.setrecursionlimit(1000000)\n\ndef comb(n, r, fact, revfact, mod):\n return (fact[n] * (revfact[n-r] * revfact[r]) % mod) % mod\n\ndef dfs(i, parent, DP, sNum, E, fact, revfact, mod):\n Ans = 1\n sonNode = 1\n S = []\n for e in E[i]:\n if e != parent...
['Wrong Answer', 'Accepted']
['s925746042', 's367744056']
[94916.0, 92372.0]
[2151.0, 2116.0]
[2003, 1757]
p02728
u638795007
3,000
1,048,576
We have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i. For each k=1, ..., N, solve the problem below: * Consider writing a number on each vertex in the tree in the following manner: * First, write 1 on Vertex k. * Then, for each of the numbers 2, ..., N in thi...
['class treedp_rerooting():\n def __init__(self, N, V, MOD):\n self.N = N\n self.V = V\n self.mod = MOD\n self.rep = [0] * N\n self.children = [-1] * N\n self.A = [0] * N\n self.C = combination(N, MOD)\n return\n\n \n def dfs(self, s):\n size = 1\n...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s140212333', 's577412951', 's648426711', 's832222397', 's998726565', 's447087715']
[76500.0, 74856.0, 74852.0, 74852.0, 74856.0, 116840.0]
[1108.0, 718.0, 696.0, 653.0, 717.0, 2980.0]
[3940, 3930, 3881, 3930, 3919, 5105]
p02728
u837673618
3,000
1,048,576
We have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i. For each k=1, ..., N, solve the problem below: * Consider writing a number on each vertex in the tree in the following manner: * First, write 1 on Vertex k. * Then, for each of the numbers 2, ..., N in thi...
['from functools import *\nfrom collections import *\nimport sys\nsys.setrecursionlimit(10**6)\ninput = sys.stdin.buffer.readline\n \nM = 10**9+7\nN = int(input())\n\n@lru_cache(maxsize=None)\ndef mod_inv(x):\n if x == 1:\n return 1\n return M // x * -mod_inv(M%x) % M\n\nweght = [0]*(N+1)\nsize = [0]*(N+1)\ndef ca...
['Runtime Error', 'Accepted']
['s432994152', 's989044095']
[86144.0, 80336.0]
[770.0, 1401.0]
[902, 887]
p02728
u968404618
3,000
1,048,576
We have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i. For each k=1, ..., N, solve the problem below: * Consider writing a number on each vertex in the tree in the following manner: * First, write 1 on Vertex k. * Then, for each of the numbers 2, ..., N in thi...
["import sys\n\n\ndef solve():\n input = lambda: sys.stdin.readline().rstrip()\n sys.setrecursionlimit(10 ** 7)\n mod = 10 ** 9 + 7\n\n def comb(n, r):\n if r > n: return 0\n return fac[n] * inv[r] * inv[n - r] % mod\n\n def dfs(v, Pa=-1):\n for u in to[v]:\n if u == Pa: c...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s117440027', 's517667015', 's913756424', 's115897981']
[72760.0, 72760.0, 2940.0, 82136.0]
[694.0, 709.0, 17.0, 2384.0]
[1351, 1350, 1121, 1348]
p02729
u004271495
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['"""\n"""\n\nfrom math import factorial\n\n\ndef int_as_array(num): return list(map(int, [y for y in str(num)]))\n\n\ndef array_as_int(arr): return int(\'\'.join(map(str, arr)))\n\n\ndef read_int(): return int(input())\n\n\ndef read_array(): return list(map(int, input().split(\' \')))\n\n\ndef array_to_string(arr, sep...
['Runtime Error', 'Accepted']
['s556960746', 's940249905']
[3064.0, 3064.0]
[19.0, 18.0]
[730, 738]
p02729
u004482945
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nprint(n*(n-1)/2 + m*(m-1)/2)', 'n, m = map(int, input().split())\nprint(int(n*(n-1)/2 + m*(m-1)/2))']
['Wrong Answer', 'Accepted']
['s635065061', 's415523650']
[2940.0, 2940.0]
[17.0, 18.0]
[61, 66]
p02729
u004823354
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m = map(int,input().split())\nprint(n*(n-1)/2+m*(m-1)/2)', 'n,m = map(int,input().split())\nn=n*(n-1)\nm=m*(m-1)\nprint(n/2+m/2)', 'n, m = map(int, input().split())\nif n >= 2:\n a = n * (n - 1) / 2\nelse:\n a = 0\nif m >= 2:\n b = m * (m - 1) / 2\nelse:\n b = 0 \nprint(int(a + b))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s155876232', 's202758909', 's745079752']
[9152.0, 9156.0, 9032.0]
[29.0, 31.0, 24.0]
[57, 65, 156]
p02729
u007263493
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n , m = map(int,input().split())\nprint(n*(n-1)/2 + m*(m-1)/2)', 'n , m = map(int,input().split())\nprint(n*(n-1)//2 + m*(m-1)//2)']
['Wrong Answer', 'Accepted']
['s441375051', 's294259658']
[2940.0, 2940.0]
[18.0, 17.0]
[61, 63]
p02729
u007738720
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int,input().split())\nn=N*(N-1)/2\nm=M*(M-1)/2\nprint(n+m)', 'N,M=map(int,input().split())\nprint((N*(N-1)+M*(M-1))/2)', 'N,M=map(int,input().split())\nprint(N*(N-1)/2+M*(M-1)/2)', 'N,M=map(int,input().split())\nprint(int(N*(N-1)+M*(M-1))/2)', 'N,M=map(int,input().split())\nprint(int(N*(N-1)/2+M*(M-1)/2))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s068611730', 's177715970', 's393381413', 's975622559', 's321938537']
[2940.0, 3064.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 17.0, 17.0]
[63, 55, 55, 58, 60]
p02729
u008911501
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n=int(input())\nm=int(input())\nc=int((n*(n-1))//2)\nd=int((m*(m-1))//2)\nprint(c+d)\n', 'n=int(input())\nm=int(input())\nif n>1:\n c=int((n*(n-1))/2)\nelse:\n c=0\nif m>1:\n d=int((m*(m-1))/2)\nelse:\n d=0\nprint(c+d)\n', 'n=int(input())\nm=int(input())\nif n>1:\n c=int((n*(n-1))/2)\nelse:\n c=int(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s182940676', 's309387148', 's523311018', 's806334847', 's871639870', 's977970310', 's993489940', 's358717953']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3060.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 19.0, 18.0, 17.0]
[81, 131, 149, 155, 111, 141, 58, 57]
p02729
u011277545
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int, input().split())\nA=N*(N-1)/2\nB=M*(M-1)/2\nprintint((A+B)', 'import math\n\nnum=int(input())\ntarget=list(map(int, input().split()))\ndef comb(N, r):\n return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))\n\nfor i in range(num):\n A=target.copy()\n A.pop(i)\n B=[x for x in...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s243084285', 's538188506', 's642123987', 's035294761']
[2940.0, 3064.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 17.0]
[68, 365, 65, 70]
p02729
u012955130
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["L = map(int, input())\n\nl = L/3\n\nl*l*l\n\nprint('{:.0f}'.format(l*l*l))", "import math\n\nN, M = map(int, input().split(' '))\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\ncnt = 0\n\nif N > 1:\n cnt += combinations_count(N, 2)\nif M > 1:\n cnt ...
['Runtime Error', 'Accepted']
['s684907615', 's552577428']
[2940.0, 3060.0]
[18.0, 17.0]
[68, 268]
p02729
u016323272
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["S = list(input())\nN = len(S)\n\nS1 = S[:(N-1)//2]\nS2 = S[((N+3)//2)-1:]\nS2.reverse()\n\nS3 = S[:(N-3)//4]\nS4 = S[(N+1)//4:(N-1)//2]\nS4.reverse()\n\nS5 = S[(N+1)//2:(3*N-1)//4]\nS6 = S[(3*N+3)//4:]\nS6.reverse()\n\nif S1 ==S2 and S3 ==S4 and S5 == S6:\n print('Yes')\nelse:\n print('No')\n ", 'N,M = map(i...
['Wrong Answer', 'Accepted']
['s032670020', 's702166773']
[3064.0, 2940.0]
[18.0, 17.0]
[346, 67]
p02729
u017624958
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['from math import factorial\n\ninputted = list(map(int, input().split()))\nN = inputted[0]\nM = inputted[1]\n\nnPk = lambda n, k: 0 if n - k <= 0 else factorial(n) / (factorial(k) * factorial(n - k))\n\nanswer = nPk(N, 2) + nPk(M, 2)\nanswer = int(answer)\n\nprint(answer)\n', 'from math import factorial\n\ninputted =...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s167652040', 's892148663', 's404344627']
[3060.0, 3060.0, 3060.0]
[17.0, 18.0, 18.0]
[262, 241, 261]
p02729
u018771977
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['#! env/bin/local python3\n# -*- coding: utf-8 -*-\n\nn, m = map(int, input().split())\n\npick_up_from_n = n * (n - 1) / 2\npick_up_from_m = m * (m - 1) / 2\n\nprint(pick_up_from_m + pick_up_from_n)', '#! env/bin/local python3\n# -*- coding: utf-8 -*-\n\nn, m = map(int, input().split())\n\npick_up_from_n = n * (n - 1)...
['Wrong Answer', 'Accepted']
['s044888161', 's270203674']
[2940.0, 2940.0]
[17.0, 17.0]
[189, 191]
p02729
u024340351
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import operator as op\nfrom functools import reduce\n\ndef ncr(n, r):\n r = min(r, n-r)\n numer = reduce(op.mul, range(n, n-r, -1), 1)\n denom = reduce(op.mul, range(1, r+1), 1)\n return numer / denom\n \nN, M = map(int, input().split())\n\nif N < 2:\n\tif M < 2:\n\t\tprint(0)\n\telse:\n\t\tprint(ncr(M,2...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s544482498', 's803009431', 's863723769', 's054656668']
[3700.0, 3572.0, 3572.0, 9080.0]
[25.0, 22.0, 23.0, 32.0]
[365, 353, 269, 84]
p02729
u025287757
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nfrac = [1]\nfor i in range(max(n, m)):\n frac.append(frac[i]*(i+1)%p)\nmod = 10**9 + 7\n\ndef comb(n, k, mod):\n a=frac[n]\n b=frac[k]\n c=frac[n-k]\n return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod\nprint(comb(n, 2, mod) + comb(m, 2, mod))', 'n, m = map(int...
['Runtime Error', 'Runtime Error', 'Accepted']
['s381956691', 's535079255', 's412221991']
[3064.0, 2940.0, 3064.0]
[17.0, 17.0, 18.0]
[351, 352, 412]
p02729
u026862065
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nprint(n * (n - 1)/ 2 + m * (m - 1) / 2)\n', 'n, m = map(int, input().split())\nprint(int(n * (n - 1) / 2 + m * (m + 1) / 2))\n', 'n, m = map(int, input().split())\nprint(int(n * (n - 1) / 2 + m * (m - 1) / 2))\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s278541146', 's530517844', 's435676518']
[2940.0, 3316.0, 3316.0]
[17.0, 19.0, 18.0]
[73, 79, 79]
p02729
u028014940
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['\nfrom math import factorial\n\nM, N = map(int, input().split())\n\ndef combinations_count(n, r):\n return factorial(n) // (factorial(n - r) * factorial(r))\n\nsum_n = combinations_count(M, 2) + combinations_count(N, 2)\nprint(sum_n)', '\nfrom math import factorial\n\nM, N = map(int, input().split())\n\ndef combin...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s095606972', 's779898175', 's619740203']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[227, 372, 373]
p02729
u028489522
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['x = input().split\nn = int(x[0])\nm = int(x[1])\nif n == 0:\n print(m * (m -1) /2)\nelif m == 0:\n print(n * (n - 1) / 2)\nelse:\n k = m * (m -1) /2 + n * (n - 1) / 2\n print(k)', 'x = input().split()\nn = int(x[0])\nm = int(x[1])\nif n == 0:\n print(m * (m -1) /2)\nelif m == 0:\n print(n * (n - 1) / 2)\nelse:\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s572644634', 's650331544', 's423910991']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[172, 174, 189]
p02729
u030856690
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math \ndef ncr(m,n):\n return((math.factorial(m))/((math.factorial(n))*(math.factorial(m-n))))\nnm=list(map(int,input().split()))\nif(nm[0]<2 and nm[1]>=2):\n print(ncr(nm[1],2))\nelif(nm[0]>=2 and nm[1]<2):\n print(ncr(nm[0],2))\nelif(nm[0]<2 and nm[1]<2):\n print(0)\nelse:\n print(int(ncr(nm[0...
['Wrong Answer', 'Accepted']
['s895034311', 's023827234']
[3064.0, 3064.0]
[17.0, 17.0]
[326, 337]
p02729
u031722966
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['def main():\n n, m = map(int, input().split())\n n -= 1\n m -= 1\n e = 0\n while n > 0:\n e += n\n print(n)\n n -= 1\n while m > 0:\n e += m\n m -= 1\n print(e)\n \nmain()', 'def main():\n n, m = map(int, input().split())\n n -= 1\n m -= 1\n e = 0\n ...
['Wrong Answer', 'Accepted']
['s456488677', 's206962530']
[3060.0, 2940.0]
[17.0, 18.0]
[213, 196]
p02729
u034128150
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nprint((n*(n-1) + m*(m-1))/2)\n', 'n, m = map(int, input().split())\nprint(n*(n-1) + m*(m-1))', 'n, m = map(int, input().split())\nprint((n*(n-1) + m*(m-1))//2)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s039402728', 's599053065', 's524201607']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[62, 57, 63]
p02729
u034459102
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["letters = input()\n\ndef kaibun_check(letters):\n count = 0\n if len(letters)%2 == 0 or len(letters)<1:\n return False\n for _ in range(len(letters)//2):\n count += 1\n if letters[count-1] != letters[-count]:\n return False\n return True\n\nif kaibun_check(letters) and kaib...
['Wrong Answer', 'Accepted']
['s098282778', 's110680936']
[3060.0, 3060.0]
[18.0, 18.0]
[436, 306]
p02729
u036104576
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = map(int, input().split())\nx = N + M\nprint(x * (x - 1) // 2 - (N * (N - 1)//2) * (M * (M - 1)//2))', 'N, M = map(int, input().split())\nx = N + M\nprint(x * (x - 1) // 2 - N * M)']
['Wrong Answer', 'Accepted']
['s686905858', 's257322217']
[9084.0, 9168.0]
[28.0, 27.0]
[104, 74]
p02729
u036479746
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M= map(int,input().split())\nprint(N*(N-1)/2+M*(M-1)/2)', 'N,M= map(int,input().split())\nprint(N*(N-1)/2+M*(M-1))', 'N,M= map(int,input().split())\nprint(N*(N-1)//2+M*(M-1)//2)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s480933406', 's563082899', 's526918490']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[56, 54, 58]
p02729
u037098269
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = map(int, input().split())\nprint((N*(N-1) + M*(M-1))/2)', 'N, M = map(int, input().split())\nprint(int((N*(N-1) + M*(M-1))/2))']
['Wrong Answer', 'Accepted']
['s047196124', 's951842325']
[2940.0, 2940.0]
[17.0, 17.0]
[61, 66]
p02729
u038887660
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import collections\nn = int(input())\nli = list(map(int, input().split()))\ndef calc(a):\n return int(a*(a-1)*0.5)\nfor k in range(n):\n\tdic = collections.Counter(li)\n\tdic[li[k]] -=1\n\tdata2 = map(calc, list(dic.values()))\n\tprint(sum(data2))', 'n, m = map(int, input().split())\nif n <= 1:\n sn = 0\nelse:\...
['Runtime Error', 'Accepted']
['s286358084', 's595329219']
[3316.0, 3060.0]
[22.0, 17.0]
[237, 157]
p02729
u039934639
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = map(int, input().split())\n\neven = N*(N-1)/2\nodd = M*(M-1)/2\n\nans = even + odd\n\nprint(ans)', "S = input()\nN = len(S)\n\nx = (N-1)/2\ny = (N+3)/2\n\na = S[:x]\nb = S[y:N]\n\nif a == reversed(a) and b == reversed(b):\n print('Yes')\nelse:\n print('No')", 'N, M = map(int, input().split())\n\neven = N*(N-...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s352445351', 's388908236', 's487263420', 's768978437', 's897275151', 's103925987']
[2940.0, 3060.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[96, 147, 96, 96, 85, 90]
p02729
u041351774
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["s=input();print('YNeos'[s.count(s[:len(s)//2])<2::2])", 'n, m = map(int, input().split())\nprint(int(n * (n - 1) / 2 + m * (m - 1) / 2))']
['Wrong Answer', 'Accepted']
['s166209191', 's878090919']
[2940.0, 2940.0]
[17.0, 17.0]
[53, 78]
p02729
u043062362
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["str1 =str(input())\ns1 = str1.split(' ')\nm = int(s1[0])\nn = int(s1[1])\nx = (m*(m-1))/2\ny = (n*(n-1))/2\nprint(int((x+y))", "str1 =str(input())\ns1 = str1.split(' ')\nm = int(s1[0])\nn = int(s1[1])\nx = (m*(m+1))//2\ny = (n*(n+1))//2\nprint(x+y)", "str1 =str(input())\ns1 = str1.split(' ')\nm = int(s1[0])\nn = int(...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s855785534', 's880374304', 's026113859']
[2940.0, 3064.0, 3060.0]
[18.0, 18.0, 17.0]
[118, 114, 117]
p02729
u043623523
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int,input().split())\n\nn=0\nm=0\n\nif N>1:\n n=(N*(N-1))/2\n\nif M>1:\n m=(M*(M-1))/2\n\nprint(n+m)', 'N,M=map(int,input().split())\n\n\n\nif N>=2:\n n=(N*(N-1))/2\n\nelse:\n n=0\n\nif M>=2:\n m=(M*(M-1))/2\n\nelse:\n m=0\n\nprint(n+m)', 'N,M=map(int,input().split())\nif N>=2:\n n=(N*(N-...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s066372175', 's120416553', 's302313802', 's674084303', 's873731095', 's979869119', 's476273128']
[3060.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 18.0, 17.0, 17.0, 17.0, 17.0]
[103, 128, 97, 68, 140, 105, 73]
p02729
u044220565
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["# coding: utf-8\nN = int(input())\nA = input().split()\nfor k in range(N):\n A_ = A.copy()\n del A_[k]\n ans = 0\n while len(A_) > 0:\n val = A_[0]\n counts = A_.count(val)\n ans += int(counts * (counts - 1) / 2)\n while True:\n try:\n A_.remove(val)\n except:\n break\n\n prin...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s397821030', 's484256966', 's642917133', 's865850566', 's325699989']
[3060.0, 2940.0, 3188.0, 3060.0, 2940.0]
[17.0, 17.0, 19.0, 17.0, 18.0]
[320, 33, 462, 320, 549]
p02729
u047918169
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = [int(i) for i in input().split()]\nprint((n*(n-1)+m*(m-1))/2)', 'n,m=map(int,input().split());print((n*(n-1)+m*(m-1))//2)']
['Wrong Answer', 'Accepted']
['s880616124', 's308750130']
[2940.0, 2940.0]
[17.0, 17.0]
[67, 56]