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
p03373
u517682687
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = tuple(map(int, input().split()))\n\n\nTOTAL_MIN = A * X + B * Y + C * (X+Y) * 2\n\nfor a in range(X + 1):\n c = (X - a) * 2\n b = Y - c // 2\n total_tmp = A * a + B * b + C * c\n if total_tmp < TOTAL_MIN:\n TOTAL_MIN = total_tmp\n\nprint(TOTAL_MIN)\n', 'A, B, C, X, Y = tuple(map(int...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s499088440', 's592354855', 's357703995']
[2940.0, 4680.0, 3064.0]
[75.0, 2104.0, 103.0]
[298, 432, 448]
p03373
u519939795
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y=map(int,input().split())\nans=10**18\nfor i in range(max(x,y)+1):\n price=a*max(0,x-i)+b*max(0,y-i)+s*c*i\n ans = min(ans,price)\nprint(ans)', 'a,b,c,x,y=map(int,input().split())\nans=10**18\nfor i in range(max(x,y)+1):\n price=a*max(0,x-i)+b*max(0,y-i)+2*c*i\n ans = min(ans,price)\nprint(ans)']
['Runtime Error', 'Accepted']
['s252916166', 's755890158']
[3060.0, 3060.0]
[17.0, 123.0]
[151, 151]
p03373
u546440137
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y = map(int,input().split())\nans=0\n\n\nif A+B > c*2:\n Z = min(X,Y)\n ans += 2*C*Z\n X -= Z\n Y -= Z\na = min(A,2*C)\nb = min(B,2*C)\n\nans += a*X\nans += b*Y\n\nprint(ans)\n', 'A,B,C,X,Y = map(int,input().split())\nans=0\n\n\nif A+B > C*2:\n Z = min(X,Y)\n ans += 2*C*Z\n X -= Z\n Y ...
['Runtime Error', 'Accepted']
['s327896475', 's953260126']
[9076.0, 9172.0]
[23.0, 28.0]
[180, 180]
p03373
u548624367
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y=map(int,input().split())\nprint(min(i*c+a*max(x-i,0)+b*max(y-i,0) for i in range(max(x,y)+1)))', 'a,b,c,x,y=map(int,input().split())\nprint(min([i*c+a*max(x-i,0)+b*max(y-i,0) for i in range(max(x,y)+1)]))', 'a,b,c,x,y=map(int,input().split())\nprint(min([i*c*2+a*max(x-i,0)+b*max(y-i,0) for i in range(max(x,...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s463743271', 's615303341', 's872852715']
[2940.0, 7048.0, 7096.0]
[85.0, 79.0, 83.0]
[103, 105, 107]
p03373
u633914031
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y=map(int, input().split())\ncnta=0\ncntb=0\ncntc=0\nif a+b>2*c:\n cntc=min(x,y) * 2\nelse:\n cnta=min(x,y)\n cntb=min(x,y)\n\nif x>y:\n if a>2*c:\n cntc+=2*(x-y)\n else:\n cnta+=x-y\nelse:\n if b>2*c:\n cntc+=2*(y-x)\n else:\n cntb+=y-x\n\nptint(cnta*a+cntb*b+cntc*c)\n\n', 'A,B,C,X,Y=map(i...
['Runtime Error', 'Accepted']
['s454725247', 's851405744']
[3064.0, 3064.0]
[19.0, 17.0]
[276, 327]
p03373
u641722141
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['#-*- coding: utf-8 -*-\na, b, c, x, y = map(int, input().split())\nm = min(x, y)\nans = 0\nif (a + b) >= c * 2:\n ans += c * 2 * min(x, y)\n print(ans)\n x -= m\n y -= m\n\nif a >= c * 2:\n ans += c * 2 * x\n x = 0\nif b >= c * 2:\n ans += c * 2 * y\n y = 0\nprint(ans + x*a + y*b)\n', '#-*- co...
['Wrong Answer', 'Accepted']
['s649386026', 's913068162']
[3064.0, 3060.0]
[17.0, 17.0]
[290, 275]
p03373
u727025296
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['# -*- coding: utf-8 -*-\n\nimport sys\n\nargs = sys.argv\n\na_value = int(args[1])\nb_value = int(args[2])\nc_value = int(args[3])\na_number = int(args[4])\nb_number = int(args[5])\n\nvalue = 0\n\nif a_value + b_value <= c_value * 2:\n value = a_value * a_number + b_value * b_number\n print (value)\nelse:\n ...
['Runtime Error', 'Accepted']
['s782017563', 's005325575']
[3064.0, 3064.0]
[18.0, 18.0]
[847, 840]
p03373
u731436822
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y = map(int,input().split())\n\ni = 0\nSUM = X*A + Y*B\nif Y >= X:\n while(X-i>=0):\n ans = min(SUM,(X-i)*A + (Y-i)*B + 2*i*C)\n i += 1\n else:\n for j in range(1,Y-X+1):\n ans = min(SUM,(Y-X-j)*B + 2*(X+j)*C)\nelse:\n while(Y-i>=0):\n ans = min(SUM,(X-i)*A + (Y...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s295851721', 's744223672', 's764360111', 's672967805']
[3064.0, 134472.0, 3064.0, 7096.0]
[86.0, 1284.0, 95.0, 100.0]
[437, 172, 433, 159]
p03373
u780354103
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y = map(int,input().split())\na = 0\n\nif A+B < C*2:\n a += (A+B) * min(X,Y)\nelse\n a += C*2 * min(X,Y)\nif X > Y:\n a += min(A,C*2)*(X-Y)\nelse:\n a += min(B,C*2)*(Y-X)\nprint(a)', 'A,B,C,X,Y = map(int,input().split())\na = 0\n\nif A+B < C*2:\n a += (A+B) * min(X,Y)\nelse:\n a += C*2 * min...
['Runtime Error', 'Accepted']
['s480079582', 's778941389']
[2940.0, 3060.0]
[17.0, 20.0]
[189, 194]
p03373
u781262926
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['inputs = open(0).readlines()\na, b, c, x, y = map(int, open(0).read().split())\n\nprices = []\nprices.append(a*x + b*y)\nprices.append(a*abs(x-y) + 2*c*min(x, y))\nprices.append(b*abs(x-y) + 2*c*min(x, y))\nprices.append(2*c*max(x, y))\nprint(min(prices))', 'a, b, c, x, y = map(int, open(0).read().split())\na, b, x, ...
['Runtime Error', 'Accepted']
['s055751741', 's513439532']
[3064.0, 3060.0]
[18.0, 17.0]
[247, 148]
p03373
u796708718
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = [int(x) for x in input().split(" ")]\n\nmin = max(A,B,C*2) * 10**5\n\nfor k in range(0,2*max(X,Y)+1,2):\n if A*(X-k/2)+B*(Y-k/2)+C*k < min:\n min = A*max(0,X-k/2)+B*max(0,Y-k/2)+C*k\n \nprint(int(min))', 'A, B, C, X, Y = [int(x) for x in input().split(" ")]\n\nmin = max(A,B,C)*max(X,Y)*2\n\...
['Wrong Answer', 'Accepted']
['s310176916', 's454742835']
[3064.0, 3064.0]
[193.0, 214.0]
[220, 231]
p03373
u799479335
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y = map(int, input().split())\n\nans = 0\n\nif (A<2*C)&(B<2*C):\n ans += A*X + B*Y\nelse:\n if A>=B:\n ans += 2*C * X\n if (B>2*C)&(Y>X):\n ans += 2*C * (Y - X)\n elif Y>X:\n\t ans += B * (Y - X)\n else:\n ans += 2*C * Y\n if (A>2*C)&(X>Y):\n ans += 2*C * (X - Y)\n elif X>Y:\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s596907838', 's783089758', 's370247731']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 18.0]
[339, 235, 198]
p03373
u898967808
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y = map(int,input().split())\nmin_total = a*x + b*y\nfor ci in range(max(x,y)*2+1):\n ai = max(0,x - ci//2)\n bi = max(0,y - ci//2)\n \n total = ai*a + bi*b + ci*c\n if min_total > total:\n min_total = total\n if min_total < 100200000:\n print(ai,bi,ci)\nprint(min_total) ', 'a,b,c,x,y = m...
['Wrong Answer', 'Accepted']
['s131820087', 's659355465']
[3712.0, 3060.0]
[218.0, 217.0]
[290, 301]
p03373
u923077302
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['# input\nN, C = map(int, input().split(" "))\nx, v = [], []\nfor i in range(1, N+1):\n xv = list(map(int, input().split(" ")))\n x.append(xv[0])\n v.append(xv[1])\n\n\n\nmax_cal = 0\nS = [[i for i in range(N)]] # stack\nplace = 0 \ncal = 0\nS[0].append(cal)\nS[0].append(place)\nwhile len(S) > 0:\n s = S...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s264087045', 's331239464', 's540557956', 's694857607', 's545794048']
[3184.0, 3064.0, 3188.0, 3316.0, 3064.0]
[17.0, 18.0, 21.0, 18.0, 17.0]
[1447, 1418, 509, 1418, 491]
p03373
u940780117
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y=map(int,input().split())\nans=0\ntmp=0\nfor i in range(10**5+1):\n tmp = 2*C*i + A*max(0,X-i) + B*max(0,Y-i)\n if i==0:\n ans = tmp\n if tmp < ans:\n ans = tmp\nprint(ans,i)', 'A,B,C,X,Y=map(int,input().split())\nans=0\ntmp=0\nfor i in range(10**5+1):\n tmp = 2*C*i + A*max(0,X-i) +...
['Wrong Answer', 'Accepted']
['s879578688', 's621681504']
[3060.0, 2940.0]
[102.0, 112.0]
[197, 197]
p03373
u970449052
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y=map(int,input().split())\nl=[]\nl.append(x*a+y*b)\nl.append(2*x*c+max(0,y-x)*b)\nl.append(2*b*c+max(0,x-y)*a)\nprint(min(l))', 'a,b,c,x,y=map(int,input().split())\nl=[]\nl.append(x*a+y*b)\nl.append(2*x*c+max(0,y-x)*b)\nl.append(2*y*c+max(0,x-y)*a)\nprint(min(l))']
['Wrong Answer', 'Accepted']
['s358091440', 's869035767']
[3060.0, 3060.0]
[17.0, 19.0]
[129, 129]
p03373
u993435350
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y = map(int,input().split())\n\nD = (A + B) // 2\nC2 = C * 2\n\nans = 0\n\nif C2 <= min(A,B):\n ans += C2 * max(X,Y)\n print(ans)\nelif C2 > max(A,B):\n ans += (A * X) + (B * Y)\n print(ans)\nelse:\n if D >= C:\n if X > Y:\n ans += C2 * Y\n ans += A * (X - Y)\n print(ans)\n if Y > X:...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s123857530', 's416839656', 's452164404', 's457626590', 's471464399', 's655772924', 's896708178', 's179324757']
[3064.0, 3064.0, 3064.0, 3060.0, 2940.0, 3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[413, 277, 337, 274, 331, 276, 283, 254]
p03373
u995861601
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a, b, ab, x, y = map(int, input().split())\nif a + b > ab*2:\n ab1 = True\nelse:\n ab1 = False\n\nif a > ab*2:\n a1 = True\nelse:\n a1 = False\n\nif b > ab*2:\n b1 = True\nelse:\n b1 = False\n\nprice = 0\nif x > y:\n if ab1 is True:\n price += ab*2*y\n if a1 is True:\n \t price += ab*2*(x-y)\n else:...
['Wrong Answer', 'Accepted']
['s963821996', 's523116580']
[3064.0, 3064.0]
[17.0, 17.0]
[524, 520]
p03374
u039623862
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['n, c = map(int, input().split())\nsushi = []\nfor i in range(n):\n x, v = map(int, input().split())\n sushi.append((x, v))\nsushi.sort()\nsushi_reversed = list(reversed([(c - x, v) for x, v in sushi]))\n\n\ndef accum_max(s):\n v = 0\n res = [(0, 0)]\n for x_i, v_i in s:\n v += v_i\n res.a...
['Wrong Answer', 'Accepted']
['s424508959', 's061985955']
[52072.0, 48124.0]
[760.0, 999.0]
[928, 886]
p03374
u064408584
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['n,c=map(int,input().split())\nx=[0]\nv=[]\nfor i in range(n):\n a,b=map(int,input().split())\n x.append(a)\n v.append(b)\n\nx1=[x[i+1]-x[i] for i in range(len(x)-1)]\nx2=[c-x[-1]]+x1[:0:-1]\nh=[0]\nfor i,j in zip(x2,reversed(v)):\n h.append(h[-1]+j+-i)\nt=[0]\nfor i,j in zip(x1,v):\n t.append(t[-1]+j-i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s125629260', 's228057928', 's424613468', 's545453278', 's143693878']
[43832.0, 33920.0, 43828.0, 25672.0, 48808.0]
[479.0, 441.0, 486.0, 401.0, 794.0]
[572, 553, 572, 471, 602]
p03374
u106778233
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\neps = 1.0 / 10**15\nmod = 10**9+7\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()...
['Runtime Error', 'Accepted']
['s897687998', 's850690545']
[3064.0, 42844.0]
[17.0, 376.0]
[1256, 1376]
p03374
u189023301
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['import numpy as np\nimport sys\ninput2 = sys.stdin.read\n\nn, c = map(int, input().split())\nAV = np.array(list(map(int, input2().rsplit())), dtype=np.int64)\nA, V = AV[::2], AV[1::2]\nB = (c - A)[::-1]\nXA = np.cumsum(V) - A\nXB = np.cumsum(V[::-1]) - B\nRSA, RSB = XA - A, XB - B\n\nXRA, XRB = 0, 0\nfor i in range(n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s301968593', 's538598008', 's913958734']
[34220.0, 34228.0, 34232.0]
[2109.0, 261.0, 769.0]
[565, 626, 910]
p03374
u340781749
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['from functools import reduce\n\nimport numpy as np\n\n\ndef get_max():\n a = 0\n\n def _max(x):\n nonlocal a\n a = max(a, x)\n return a\n\n return _max\n\n\ndef solve(fwd, bck):\n dp = []\n cur = 0\n for x, v in fwd:\n cur -= x\n cur += v\n dp.append(cur)\n\...
['Wrong Answer', 'Accepted']
['s549218860', 's780232701']
[69668.0, 71708.0]
[1489.0, 854.0]
[957, 959]
p03374
u367130284
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['n,c = map(int,input().split())\nx = [0]\nv = [0]\nrf = [0] * (n+2)\nrg = [0] * (n+2)\nlf = [0] * (n+2)\nlg = [0] * (n+2)\nfor i in range(0,n):\n X,V = map(int,input().split())\n x.append(X)\n v.append(V)\nfor i in range(0,n):\n rf[i+1] = rf[i] + v[i+1]\n rg[i+1] = max(rg[i],rf[i+1] - x[i+1])\nfor i in ...
['Runtime Error', 'Accepted']
['s976169894', 's195835969']
[28392.0, 29900.0]
[503.0, 789.0]
[526, 493]
p03374
u375616706
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['from itertools import accumulate\n# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\nN, C = map(int, input().split())\n\nposDist = [0]*N\nposVal = [0]*N\nfor i in range(N):\n d, v = list(map(int, input().split()))\n posDist[i] = d\n posVal[i] = d\n\nnegDist ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s212879900', 's632411156', 's966966654']
[20204.0, 25976.0, 46752.0]
[2105.0, 2105.0, 435.0]
[1006, 1029, 1163]
p03374
u608088992
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['N, C = map(int, input().split())\nSushi = [[int(info) for info in input().split()] for n in range(N)]\nClocksum = [0 for i in range(N+1)]\nAntiClocksum = [0 for i in range(N+1)]\nmaxClocksum, maxAntisum = [0 for i in range(N+1)], [0 for i in range(N+1)]\nfor i in range(N): \n Clocksum[i+1] = Clocksum[i] + Sushi[i]...
['Wrong Answer', 'Accepted']
['s268767012', 's052107592']
[33732.0, 32308.0]
[864.0, 739.0]
[1081, 1061]
p03374
u792078574
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
["N, C = map(int, input().split())\nX = []\nV = []\nfor i in range(N):\n x, v = map(int, input().split())\n X.append(x)\n V.append(v)\n\nfrontS = []\nprevX = 0\nv = 0\nfor i in range(N):\n v = v + V[i] - (X[i] - prevX)\n frontS.append(v)\n prevX= X[i]\n\n\nbackMaxS = []\nprevX = C\nv = 0\ntmpMax = float('-inf')\n...
['Wrong Answer', 'Accepted']
['s176243180', 's246603564']
[29032.0, 21676.0]
[529.0, 613.0]
[717, 944]
p03374
u846150137
2,000
262,144
"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter. Nakahashi entered Teishi-zushi, and he was guided to the counter. Now, there are N pieces of sushi (vinegared rice with seafood and so on...
['n,c= [int(i) for i in input().split()]\nt_tk_r=0\nt_md_r=0\ng_tk_r=0\ng_md_r=0\nt_tk_m=0\nt_md_m=0\ng_tk_m=0\ng_md_m=0\nt_tk=[]\nt_md=[]\ng_tk=[]\ng_md=[]\na=[]\nd1=0\nfor i in range(n):\n a.append([int(i) for i in input().split()])\nfor d0,v0 in a:\n t_tk_r+=v0-(d0-d1)\n t_md_r+=v0-(d0-d1)*2\n t_tk_m=max(t_tk_m,...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s137625025', 's506848145', 's086403295']
[33540.0, 33540.0, 37124.0]
[661.0, 642.0, 649.0]
[688, 692, 716]
p03375
u476199965
4,000
524,288
In "Takahashi-ya", a ramen restaurant, basically they have one menu: "ramen", but N kinds of toppings are also offered. When a customer orders a bowl of ramen, for each kind of topping, he/she can choose whether to put it on top of his/her ramen or not. There is no limit on the number of toppings, and it is allowed to ...
['N,M = list(map(int,input().split()))\n\ntable = [1,1]\nwhile len(table) <= N:\n temp = 1\n for i in range(len(table)-1):\n table[i+1] += temp\n temp = table[i+1]- temp\n table[i+1] = M\n table.append(1)\n\nS = [1]\n\nrev2 = pow(2, M-2, M)\nbase = pow(2, N, M)\nans = 0\nS = [1]\nfor K in ...
['Wrong Answer', 'Accepted']
['s843352618', 's029877459']
[3316.0, 3436.0]
[4204.0, 3424.0]
[718, 679]
p03381
u026155812
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['N = int(input())\nX = [int(i) for i in input().split()]\nX.sort()\nif N%2 == 0:\n for i in range(N):\n if i <= N//2 - 1:\n print(X[N//2])\n else:\n print(X[N//2 - 1])\nelse:\n for i in range(N):\n if i < N//2:\n print((X[N//2] + X[N//2 + 1])/2)\n elif...
['Wrong Answer', 'Accepted']
['s310163924', 's242201735']
[30736.0, 32628.0]
[199.0, 275.0]
[427, 464]
p03381
u054957956
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["from sys import exit\nr, s = map(int, input().split())\na = [input() for i in range(r)]\n\ndef check(x):\n cnt = [0 for i in range(300)]\n for i in x:\n cnt[ord(i)] += 1\n odd = sum(i % 2 for i in cnt)\n if odd != len(x) % 2:\n print('NO')\n exit(0)\n\nmidr, mids = None, None\n\ndr = ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s167263573', 's287790341', 's543314880', 's995554058', 's442300962']
[3188.0, 2940.0, 3068.0, 2940.0, 25620.0]
[20.0, 17.0, 17.0, 17.0, 296.0]
[1201, 1, 4, 27, 170]
p03381
u066337396
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["from collections import defaultdict\n\n\ndef main():\n h, w = map(int, input().split())\n s = []\n for _ in range(h):\n col = []\n s.append(col)\n for c in input().strip():\n col.append(ord(c))\n c_row = defaultdict(int)\n for col in s:\n c_row[tuple(sorted(col))]...
['Runtime Error', 'Accepted']
['s768603434', 's740755731']
[3316.0, 55492.0]
[21.0, 653.0]
[1182, 326]
p03381
u092650292
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['from numpy import median\nfrom copy import deepcopy\n\nn = int(input())\nx = list(map(int,input().split()))\n\nsx = x.sorted()\nnewl = deepcopy(sx)\ndel newl[0]\nbigm = median(newl)\nnewl = deepcopy(sx)\ndel newl[-1]\nminm = median(newl)\n\nmed = median(x)\n\nfor i in x:\n if i > med:\n print(minm)\n els...
['Runtime Error', 'Runtime Error', 'Accepted']
['s535087612', 's859923372', 's169012623']
[34128.0, 2940.0, 34176.0]
[304.0, 17.0, 1050.0]
[322, 136, 331]
p03381
u132434645
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["import sys\nsys.setrecursionlimit(10000)\n\nh, w = map(int, input().split())\ns = [None] * h\nss = [None] * h\nfor i in range(h):\n s[i] = input()\n ss[i] = sorted(s[i])\n\ndef c(x, y):\n l = len(y)\n if l == w: return True\n if l % 2 == 0:\n for i in range(w):\n if i not in y:\n ...
['Runtime Error', 'Accepted']
['s571057467', 's580496255']
[3188.0, 25556.0]
[18.0, 332.0]
[1524, 170]
p03381
u226155577
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["N = int(input())\n*X, = map(int, input().split())\nY = sorted(X)\np, q = Y[N//2-1:N//2+1]\nans = []\nprint(p, q)\nfor i in range(N):\n if X[i] < q:\n ans.append(q)\n else:\n ans.append(p)\nprint(*ans, sep='\\n')", "n = int(input())\n*x, = map(int, input().split())\ny = sorted(x)\np, q = y[n//2-1:n...
['Wrong Answer', 'Accepted']
['s194498057', 's079029384']
[26772.0, 26772.0]
[261.0, 267.0]
[219, 209]
p03381
u228759454
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['import numpy as np\n\nN = int(input())\nn_list = list(map(int, input().split()))\n\nM = np.max(n_list)\n\nbest_k_bar = (M - 1) / 2\nbest_k_cand = [x for x in n_list if x >= best_k_bar]\nbest_k = np.min(best_k_cand)\n\nprint(M, best_k)', 'import numpy as np\n\nN = int(input())\nn_list1 = list(map(int, input().split())...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s276280631', 's635324732', 's783163432']
[34188.0, 34184.0, 34180.0]
[355.0, 1533.0, 582.0]
[223, 558, 494]
p03381
u237362582
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["N = int(input())\n\na = list(map(int,input().split(' ')))\n\nsorted_a = sorted(a)\n\nif N > 2:\n for i in range(int(N/2)):\n print(sorted_a[int(N/2)])\n for i in range(int(N/2)):\n print(sorted_a[int(N/2)-1])\nelse:\n print(a[0])\n", "N = int(input())\n\na = list(map(int,input().split(' ')))\n\...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s178663378', 's659495813', 's925891105', 's993681182']
[25620.0, 26016.0, 25620.0, 25220.0]
[337.0, 340.0, 338.0, 388.0]
[241, 193, 193, 213]
p03381
u268210555
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['n = int(input())\na = list(map(int, input().split()))\ni = max(a)\na.remove(i)\nj = min(a, key=lambda x: abs(i-x*2))\nprint(i, j)', 'n = int(input())\nx = list(map(int, input().split()))\na = sorted(range(n), key=lambda i: x[i])\nl = x[a[n//2-1]]\nr = x[a[n//2]]\nb = [0]*n\nfor i, j in enumerate(a):\n if i < n//2:...
['Wrong Answer', 'Accepted']
['s446397360', 's556730910']
[26016.0, 26772.0]
[114.0, 384.0]
[124, 247]
p03381
u289381123
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["n=int(input())\nx=list(map(int,input().split(' ')))\nx1=x[:]\nx1.sort()\nx2=x1[:]\nfor i in range(n):\n l=x[i]\n print(x1)\n x1.remove(l)\n print (x1[int(n/2)-1])\n print(x1)\n x1=x2[:]\n", "n=int(input())\nx=list(map(int,input().split(' ')))\nx1=x[:]\nx1.sort()\nfor i in range(n):\n l=x[i]\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s909777002', 's971050512', 's948784633']
[153600.0, 25620.0, 34188.0]
[1927.0, 2104.0, 447.0]
[193, 155, 216]
p03381
u397531548
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['from collections import Counter\nN=int(input())\nX=list(map(int,input().split()))\nY=sorted(X)\na=Y[N//2]\nb=Y[N//2-1]\nfor i in range(N):\n if X[i]<=b:\n print(a)\n break\n else:\n print(b)\n break', 'from collections import Counter\nN=int(input())\nX=list(map(int,input().split()))\...
['Wrong Answer', 'Accepted']
['s403092555', 's077620189']
[26540.0, 25948.0]
[156.0, 300.0]
[220, 182]
p03381
u399810298
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["N=int(input())\ninp=list(map(int, input().strip().split(' ')))\nXsort=sorted(inp)\nmed = int(N/2)\nfor i in range(N):\n if Xsort[med-1] > inp[i]:\n print(Xsort[med])\n else:\n print(Xsort[med-1])", "N=int(input())\ninp=list(map(int, input().strip().split(' ')))\nXsort=sorted(inp)\nmed = int(N/2)\nfor i in ran...
['Wrong Answer', 'Accepted']
['s622591608', 's415584357']
[26772.0, 25620.0]
[326.0, 318.0]
[195, 197]
p03381
u411158173
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['import copy\n\nN = int(input())\nX = []\nX = [int(i) for i in input().split()]\n\nY = copy.deepcopy(X)\nY.sort()\n\nlargeMedian = Y[int(N / 2)]\nsmallMedian = Y[int(N / 2)-1]\n\n\nprint(X)\nprint(Y)\nprint(smallMedian)\nprint(largeMedian)\n\nfor i in range(N):\n if X[i] <= smallMedian:\n X[i] = largeMedian\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s342331041', 's379970516', 's602653107']
[26528.0, 26068.0, 27156.0]
[540.0, 623.0, 484.0]
[371, 380, 313]
p03381
u452786862
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['from collections import defaultdict\nH, W = map(int, input().split())\ns = [input() for _ in range(H)]\nif H == 1 and W == 1:\n print(\'YES\')\nelif W==1:\n print(\'NO\')\nelse:\n\n d_h = [[0 for i in range(28)] for _ in range(H)]\n d_w = [[0 for i in range(28)] for _ in range(W)]\n\n for i in range(H)...
['Runtime Error', 'Runtime Error', 'Accepted']
['s073913582', 's827970685', 's809226103']
[3440.0, 3316.0, 26180.0]
[25.0, 22.0, 303.0]
[1469, 1469, 218]
p03381
u459737327
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["n = int(input())\na = sorted(zip(map(int, input().split()), range(n)))\nfor i in range(n//2):\n a[i] = a[n//2 - 1]\n a[i + n//2] = a[n//2]\nprint('\\n'.join(map(lambda x: str(x[0]), sorted(a, key = lambda x: x[1]))))\n", "n = int(input())\na = sorted(zip(map(int, input().split()), range(n)))\nb = [0] * n\nfor i in ...
['Wrong Answer', 'Accepted']
['s396126723', 's520767892']
[45460.0, 64832.0]
[576.0, 667.0]
[213, 260]
p03381
u476199965
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['n = int(input())\nx = list(map(int,input().split()))\ny = sorted(x)\nl = y[n/2-2]\nr = y[n/2-1]\nfor i in range(n):\n if x[I] <= l:print(r)\n else:print(l)\n', 'n = int(input())\nx = list(map(int,input().split()))\ny = sorted(x)\nl = y[n/2-2]\nr = y[n/2-1]\nfor i in range(n):\n if x[i] <= l:print(r)\n els...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s481226340', 's566281365', 's603303086', 's677470937', 's807271866', 's293421704']
[25624.0, 25620.0, 25220.0, 25472.0, 26772.0, 25220.0]
[151.0, 149.0, 151.0, 148.0, 310.0, 322.0]
[155, 155, 172, 173, 157, 155]
p03381
u495415554
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['N = int(input())\nX = list(map(int, input().split()))\n\nX.sort()\n\nfor i in range(N):\n tmp = X.pop(i)\n print(X[(N // 2) - 1])\n X.insert(i, tmp)', 'N = int(input())\nX = list(map(int, input().split()))\nX_sorted = sorted(X)\n\nfor i in range(N):\n if X[i] < X_sorted[N // 2]:\n print(X_sorted[N ...
['Wrong Answer', 'Accepted']
['s412799091', 's058874234']
[26016.0, 25620.0]
[2104.0, 336.0]
[149, 205]
p03381
u547085427
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['N = int(input())\nN_d = int(N/2)\nX1 = list(map(int,input().split()))\nX = X1[:]\nX1.sort()\n\ndef getMed(i):\n if i < X[N_d]:\n print(X[N_d])\n else:\n print( X[N_d -1])\n\nfor i in X:\n getMed(i)\n ', 'N = int(input())\nN_d = int(N/2)\nX1 = list(map(int,input().split()))\nX = X1[:]\nX1.sort()\n\ndef getMe...
['Wrong Answer', 'Accepted']
['s217080575', 's054366599']
[25228.0, 26016.0]
[310.0, 327.0]
[196, 197]
p03381
u584749014
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['n = int(input())\nl0 = list(map(int, input().split()))\nl = sorted(l0)\n\nm1 = l[n//2 - 1]\nm2 = l[n//2]\nfor i in range(len(l0)):\n if l0[i] <= m2:\n print(m2)\n if l0[i] > m1:\n print(m1)\n', "n, m = map(int,input().split())\nd = {i: {chr(i): 0 for i in range(ord('a'), ord('z')+1)} for i in rang...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s431990044', 's951718364', 's711247316']
[26772.0, 3064.0, 25224.0]
[322.0, 17.0, 320.0]
[200, 862, 280]
p03381
u657541767
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['n = int(input())\nx = [int(a) for a in input().split()]\nsorted_x = sorted(x)\nprint(x)\nprint(sorted_x)\nfor elem in x:\n if elem >= sorted_x[(len(x) + 1) // 2]:\n print(sorted_x[(len(x) + 1) // 2 - 1])\n else:\n print(sorted_x[(len(x) + 1) // 2])\n ', 'n = int(input())\nx = [int(a) for a in i...
['Wrong Answer', 'Accepted']
['s146267300', 's541097740']
[25620.0, 25224.0]
[419.0, 402.0]
[264, 239]
p03381
u730769327
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['from heapq import heappush\nn=int(input())\nx=list(map(int,input().split()))\na=[]\nfor i in range(n):\n a+=[(x[i],i)]\na=sorted(a)\nans=[]\nfor i,j in a:\n if i<=a[n//2][0]:heappush(ans,(j,a[n//2][0]))\n else:heappush(ans,(j,a[n//2-1][0]))\nfor i,j in ans:\n print(j)', 'n=int(input())\nx=list(map(int,input().spl...
['Wrong Answer', 'Accepted']
['s762645689', 's117993835']
[53164.0, 55000.0]
[545.0, 616.0]
[260, 237]
p03381
u812137330
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['n = int(input())\n\na = input().split()\n\na = [int(x) for x in a]\n\nam = max(a)\nai = 0\nr = abs(a[0] - (am/2)) \n\nfor i in range(n):\n if r >= abs(a[i]-(am/2)):\n r = abs(a[i]-(am/2))\n ai = a[i]\n \nprint("{0} {1}".format(am,ai))', 'N = int(input())\n\nX = input().split()\nx1 = [int(x) fo...
['Wrong Answer', 'Accepted']
['s880144541', 's859256759']
[25228.0, 36220.0]
[156.0, 378.0]
[243, 249]
p03381
u835482198
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
["n = int(input())\nx = list(map(int, input().split()))\nsorted_x = sorted(x)\n\nif sorted_x[n // 2] == sorted_x[n // 2 - 1]:\n print(' '.join([sorted_x[n // 2] * n]))\nelse:\n ret = []\n for i in range(n):\n if x[i] >= sorted_x[n // 2]:\n ret.append(sorted_x[n // 2])\n else:\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s247133162', 's423079251', 's274249606']
[26772.0, 25224.0, 25620.0]
[225.0, 348.0, 353.0]
[368, 359, 359]
p03381
u876442898
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['# -*- coding: utf-8 -*-\n\n\nimport numpy as np\n\nN = int(input())\nX = np.array(map(int, input().split(" ")))\n\nfor i in range(N):\n print(np.append(X[:i], X[i+1:]).median)', '# -*- coding: utf-8 -*-\n\nimport random\nimport copy\n\nN = int(input())\nX = list(map(int, input().split(" ")))\nsorted_X = sorted(X)\...
['Runtime Error', 'Accepted']
['s963071484', 's299629935']
[28252.0, 27108.0]
[167.0, 305.0]
[297, 392]
p03381
u980652670
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['N = int(input())\nb = [int(i) for i in input().split()]\nb.sort()\ns = b[len(b)//2 - 1]\nl = b[len(b)//2]\n\nfor i in range(N):\n if i > len(b)//2:\n print(s)\n else:\n print(l)', 'N = int(input())\nb = input().split(" ")\n\nfor i in range(N):\n X = b\n X.pop(i)\n X.sort()\n print(X[le...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s146202982', 's393882280', 's472604249', 's859010730', 's874245733', 's258479591']
[25220.0, 20292.0, 25220.0, 26016.0, 25224.0, 25228.0]
[340.0, 2105.0, 323.0, 313.0, 331.0, 319.0]
[187, 119, 180, 167, 189, 168]
p03381
u984276646
2,000
262,144
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, .....
['N = int(input())\nX = list(map(int, input().split()))\nfor i in range(N):\n Y = X[:]\n Y.remove(X[i])\n Y.sort()\n print(Y[N // 2])', 'N = int(input())\nX = list(map(int, input().split()))\nL = [0 for _ in range(N)]\nfor i in range(N):\n X[i] = X[i] * N + i\nX.sort()\nd = N // 2\nfor i in range(N):\n if i < d:\...
['Runtime Error', 'Accepted']
['s056994555', 's672857732']
[25556.0, 25228.0]
[2104.0, 447.0]
[129, 265]
p03382
u228759454
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['import numpy as np\n\nN = int(input())\nn_list = list(map(int, input().split()))\n\nM = np.max(n_list)\n\nbest_k_bar = (M - 1) / 2\nbest_k_cand = [x for x in n_list if x >= best_k_bar]\nbest_k = np.min(best_k_cand)\n\nprint(best_k_bar)\nprint(M, best_k)', 'import numpy as np\n\nN = int(input())\nn_list = list(map(int...
['Wrong Answer', 'Accepted']
['s379794335', 's596507809']
[23100.0, 23132.0]
[263.0, 253.0]
[241, 281]
p03382
u257974487
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['n = int(input())\np = list(map(int,input().split()))\np.sort()\na1 = max(p)\na2 = min(p)\nhalf = (a1+1) // 2\ns = n // 2\ngraph = [0] * n\n\nwhile True:\n if graph[s] != 0:\n break\n else:\n graph[s] += 1\n if p[s] < half:\n if abs(p[s] - half) < abs(a2 - half):\n a2 = p[s]\n ...
['Wrong Answer', 'Accepted']
['s350804195', 's330986550']
[14428.0, 14440.0]
[84.0, 88.0]
[472, 473]
p03382
u268210555
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['n = int(input())\na = list(map(int, input().split()))\ni = max(a)\na.remove(i)\nk = min(a, key=lambda x: abs(i-x*2))\nprint(i, j)', 'n = int(input())\na = list(map(int, input().split()))\ni = max(a)\na.remove(i)\nj = min(a, key=lambda x: abs(i-x*2))\nprint(i, j)']
['Runtime Error', 'Accepted']
['s048084493', 's917080157']
[14428.0, 14428.0]
[66.0, 66.0]
[124, 124]
p03382
u374103100
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['cache = {0: 1, 1: 1, 2: 2}\ncombo_cache = {}\n\n\ndef prepare_cache():\n val = 1\n for i in range(1, 10000):\n cache[i] = val * i\n\ndef permutation(n):\n if n in cache:\n return cache[n]\n\n ret = n\n for i in range(n-1, 0, -1):\n if i in cache:\n ret *= cache[i]\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s003824343', 's710042703', 's667669039']
[14348.0, 14348.0, 14428.0]
[2104.0, 2104.0, 124.0]
[1135, 1074, 346]
p03382
u442877951
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['from bisect import *\nn = int(input())\na = list(map(int,input().split()))\na = sorted(a)\nans = a[-1]//2\nb = bisect_left(a,ans)\nif abs(ans-a[b]) < abs(ans-a[b-1]):\n print(a[-1],a[b])\nelse:\n print(a[-1],a[b-1])', 'from bisect import *\nn = int(input())\na = list(map(int,input().split()))\na = sorted(a)\nans = ...
['Wrong Answer', 'Accepted']
['s359126576', 's835174130']
[14052.0, 14052.0]
[80.0, 78.0]
[208, 207]
p03382
u476199965
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['import bisect\nn = int(input())\nx = list(map(int,input().split()))\ny = sorted(x)\nmid = bisect.bisect_left(y,y[-1]/2)\nif y[-1]/2-x[mid]>=x[mid+1]-y[-1]/2:print(y[-1],x[mid+1])\nelse:print(y[-1],x[mid])', 'n = int(input())\nx = list(map(int,input().split()))\n\ny = max(x)\nsub = y\nres = 0\nfor i in range(n):\n ...
['Runtime Error', 'Accepted']
['s702979413', 's738204824']
[14428.0, 14432.0]
[80.0, 81.0]
[198, 216]
p03382
u535171899
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
["def main():\n import sys\n input = sys.stdin.readline\n \n N = int(input())\n A = set(map(int,input().split()))\n A = sorted(list(A))\n\n import bisect\n\n ans = A[-1]//2\n b = bisect.bisect_left(A,ans)\n\n if abs(ans-A[b])<abs(ans-A[max(0,b-1)]):\n print(A[-1],A[b])\n else:\n ...
['Wrong Answer', 'Accepted']
['s913989512', 's493717254']
[25008.0, 25116.0]
[73.0, 80.0]
[365, 364]
p03382
u657913472
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['input()\na=list(map(int,input().split()))\nm=max(a)\nd=max(a,key=lambda d:abs(m-2*d)if m!=d else-1)\nprint(m,d)', 'input()\na=list(map(int,input().split()))\nm=max(a)\nd=min(a,key=lambda d:abs(m-2*d)if m!=d else 1e18)\nprint(m,d)']
['Wrong Answer', 'Accepted']
['s733503075', 's997363156']
[14060.0, 14428.0]
[70.0, 69.0]
[107, 110]
p03382
u721316601
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
["import numpy as np\n\nN = int(input())\n\na = list(map(int, input().split()))\n \na_i = max(a)\n\ndel a[np.argmax(a)]\n\na = np.array(a)\n\ncenter = a_i // 2\n\nif a_i % 2 == 1:\n center += 1\n \ntmp = center // a\n\na_j = a[np.argmin(tmp)]\n \nprint(str(a_i) + ' ' + str(a_j))", "import numpy as np\n\nn = i...
['Wrong Answer', 'Accepted']
['s050992060', 's908886432']
[29212.0, 23664.0]
[341.0, 212.0]
[266, 269]
p03382
u807772568
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['input()\nda = list(map(int,input().split()))\n\nx = max(da)\ny = x + 1\nfor i in x\n\tif i == x:\n \t\tcontinue\n if abs(x/2 - i ) <= (x/2 - y):\n\t\ty = i\nprint(x,y)', 'input()\nda = list(map(int,input().split()))\n \nx = max(da)\ny = x + 1\nfor i in da:\n\tif i == x:\n \t\tcontinue\n if abs(x/2 - i ) <= ab...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s668469974', 's677934241', 's894894297', 's131131494']
[2940.0, 2940.0, 2940.0, 14060.0]
[17.0, 17.0, 17.0, 88.0]
[156, 162, 161, 163]
p03382
u867069435
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['import bisect\nn = int(input())\na = sorted(list(map(int, input().split())))\nl, r = 0, 0\nl = max(a)\na.remove(l)\nj = bisect.bisect_left(a, l/2)\nprint(a[min(j, len(a)-1)])', 'import bisect\nn = int(input())\na = sorted(list(map(int, input().split())))\nl, r = 0, 0\nl = max(a)\na.remove(l)\nj = bisect.bisect_left(a...
['Wrong Answer', 'Accepted']
['s763914932', 's519209769']
[14428.0, 14052.0]
[85.0, 86.0]
[167, 255]
p03382
u875291233
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['# coding: utf-8\n# Your code here!\n\nN=int(input())\nC = list(map(int,input().split()))\n\na=sorted(C)\n\nM=a[-1]\n\n\nA=sorted([abs(2*i - M) for i in a])\nprint(C)\nprint(a)\nprint(A)\nN1= (-A[0]+M)//2\nN2= (A[0]+M)//2\nprint(N1,N2)\nj = C.index(M)\nif N1 in a:\n print(M,N1)\nelse:\n print(M,N2)\n\n\n\n', '# ...
['Wrong Answer', 'Accepted']
['s415486244', 's799860991']
[18768.0, 14052.0]
[129.0, 98.0]
[286, 290]
p03382
u957084285
2,000
262,144
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
['N = int(input())\na = sorted(list(map(int, input().split())))\n\nimport numpy as np\nfrom scipy.misc import comb\n\ni = 0\nj = 1\n\nans = (0, 0)\nx = 0\nfor j in range(1, N):\n n = a[j]\n while j - i > 1:\n if abs(n/2 - a[i]) < abs(n/2 - a[i+1]):\n break\n i+=1\n p = a[i]\n y = co...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s475526432', 's589492529', 's745562765', 's899247345', 's101545718']
[19560.0, 19568.0, 19556.0, 19564.0, 14428.0]
[2109.0, 2109.0, 2109.0, 2112.0, 79.0]
[390, 618, 394, 655, 429]
p03383
u104282757
2,000
262,144
There is an H \times W grid (H vertical, W horizontal), where each square contains a lowercase English letter. Specifically, the letter in the square at the i-th row and j-th column is equal to the j-th character in the string S_i. Snuke can apply the following operation to this grid any number of times: * Choose t...
['# E\nimport numpy as np\n\nH, W = map(int, input().split())\nS = list()\nfor _ in range(H):\n S.append(list(input()))\nS_arr = np.array(S)\n\nres = "YES"\n\ndef check_ok(S_arr, H, W):\n res = True\n for i in range(H):\n for j in range(W):\n if S_arr[i, j] != S_arr[H-1-i, W-1-j]:\n ...
['Runtime Error', 'Accepted']
['s743719914', 's884729981']
[12272.0, 19740.0]
[157.0, 249.0]
[2003, 3182]
p03383
u226155577
2,000
262,144
There is an H \times W grid (H vertical, W horizontal), where each square contains a lowercase English letter. Specifically, the letter in the square at the i-th row and j-th column is equal to the j-th character in the string S_i. Snuke can apply the following operation to this grid any number of times: * Choose t...
['H, W = map(int, input().split())\nS = [list(input()) for i in range(H)]\nT = [[None]*H for i in range(W)]\nD = {}\nfor i in range(H):\n for j in range(W):\n c = S[i][j]\n D[c] = D.get(c, 0) ^ 1\nif sum(D.values()) != (1 if (H%2==1)and(W%2==1) else 0):\n print("NO")\n exit(0)\nfor i in range(H):...
['Wrong Answer', 'Accepted']
['s829489612', 's516190086']
[3192.0, 3192.0]
[20.0, 85.0]
[1927, 1162]
p03383
u252883287
2,000
262,144
There is an H \times W grid (H vertical, W horizontal), where each square contains a lowercase English letter. Specifically, the letter in the square at the i-th row and j-th column is equal to the j-th character in the string S_i. Snuke can apply the following operation to this grid any number of times: * Choose t...
["H, W = list(map(int, input().split(' ')))\nS = []\nd = defaultdict(list)\n\nfor h in range(H):\n s = input()\n S.append(s)\n d[''.join(sorted(S))].append(h)\n\nalready_paired = np.zeros(H)\n\nGs = []\n\nfor i in range(H):\n if already_paired[i]:\n continue\n\n for j in range(i+1, H):\n if...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s280820589', 's476328671', 's740942960', 's079842461']
[3188.0, 14548.0, 21768.0, 21564.0]
[19.0, 158.0, 2109.0, 374.0]
[1171, 1237, 2003, 2213]
p03383
u467736898
2,000
262,144
There is an H \times W grid (H vertical, W horizontal), where each square contains a lowercase English letter. Specifically, the letter in the square at the i-th row and j-th column is equal to the j-th character in the string S_i. Snuke can apply the following operation to this grid any number of times: * Choose t...
['from itertools import groupby\nH, W = map(int, input().split())\nif H<=6:\n assert False\nS = ["" for _ in range(W)]\nT = []\nfor _ in range(H):\n s = input()\n T.append(s)\n for i, c in enumerate(s):\n S[i] += c\nT = [sorted(t) for t in T]\nS = [sorted(s) for s in S]\nT.sort()\nS.sort()\ncnt = 0\n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s395699482', 's883984776', 's423715195']
[3064.0, 3064.0, 3188.0]
[18.0, 18.0, 18.0]
[533, 535, 1112]
p03383
u476199965
2,000
262,144
There is an H \times W grid (H vertical, W horizontal), where each square contains a lowercase English letter. Specifically, the letter in the square at the i-th row and j-th column is equal to the j-th character in the string S_i. Snuke can apply the following operation to this grid any number of times: * Choose t...
["h,w = list(map(int,input().split()))\ns = []\nfor i in range(h):\n s.append(input())\n\ncon = []\n\nfor i in range(h):\n for j in range(i+1,h):\n ij = []\n ji = []\n for k in range(w):\n ij.append(s[i][k]+s[j][k])\n ji.append(s[j][k]+s[i][k])\n if sorted(ij) == ...
['Wrong Answer', 'Accepted']
['s441294319', 's347516823']
[3064.0, 3064.0]
[18.0, 92.0]
[524, 1165]
p03384
u102461423
2,000
262,144
Takahashi has an ability to generate a tree using a permutation (p_1,p_2,...,p_n) of (1,2,...,n), in the following process: First, prepare Vertex 1, Vertex 2, ..., Vertex N. For each i=1,2,...,n, perform the following operation: * If p_i = 1, do nothing. * If p_i \neq 1, let j' be the largest j such that p_j < p_...
['import sys\ninput = sys.stdin.readline\n\nN = int(input())\nVW = [[int(x)-1 for x in input().split()] for _ in range(N-1)]\n\n\n\ngraph = [[] for _ in range(N)]\ndeg = [0] * (N)\nfor v,w in VW:\n graph[v].append(w)\n graph[w].append(v)\n deg[v] += 1\n deg[w] += 1\n\ndef dijkstra(start):\n INF = 10**10\...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s153860597', 's274067232', 's690837832', 's831088342', 's926437552']
[43220.0, 43160.0, 43188.0, 43160.0, 53640.0]
[472.0, 452.0, 440.0, 537.0, 722.0]
[706, 1446, 1393, 1383, 1495]
p03389
u056977516
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['# ANSHUL GAUTAM\n# IIIT-D\n\nA,B,C = map(int, input().split())\nm = max(A,B,C)\ns = sum(m-A,m-B,m-C)\nif(s%2 == 0):\n\tprint(s//2)\nelse:\n\tprint(s//2 + 2)\n\n\n\n\n', '# ANSHUL GAUTAM\n# IIIT-D\n\nA,B,C = map(int, input().split())\nm = max(A,B,C)\ns = sum((m-A,m-B,m-C))\nif(s%2 == 0):\n\tprint(s//2)\nelse:\n\tprint...
['Runtime Error', 'Accepted']
['s314910328', 's255453794']
[2940.0, 2940.0]
[17.0, 17.0]
[150, 152]
p03389
u062147869
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
["from math import sqrt \nQ = int(input())\ntable=[]\nfor i in range(Q):\n A,B=map(int,input().split())\n if A>B:\n table.append([B,A])\n else:\n table.append([A,B])\ndef f(a,b):\n if a==b:\n return 2*a-2\n if a+1==b:\n return 2*a-2\n m = int(sqrt(a*b))\n if m**2 ==a*b:\...
['Runtime Error', 'Accepted']
['s746698434', 's416997450']
[3064.0, 3064.0]
[18.0, 17.0]
[467, 193]
p03389
u104282757
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['# D\nimport math\nQ = int(input())\nA_list = []\nB_list = []\nfor _ in range(Q):\n A, B = map(int, input().split())\n A_list.append(min(A, B))\n B_list.append(max(A, B))\n \nfor i in range(Q):\n A = A_list[i]\n B = B_list[i]\n \n if A == B:\n print(A+B-2)\n continue\n ...
['Runtime Error', 'Accepted']
['s924159291', 's686589554']
[3064.0, 3316.0]
[18.0, 20.0]
[644, 250]
p03389
u108784591
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['a=int(input())\nb=int(input())\nc=int(input())\nnum=[a,b,c]\nnum.sort()\nans=((num[2]*3)-(num[0]+num[1]+num[2]))/2\nprint(ans)\n', 'a,b,c=map(int,input().split())\nnum=[a,b,c]\nnum.sort()\nans=((num[2]*3)-(num[0]+num[1]+num[2]))/2\nprint(ans)\n', 'import math\n\na,b,c=map(int,input().split())\nnum=[a,b,c]\nnum.sort()...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s009830973', 's130787918', 's612349849']
[2940.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[121, 107, 219]
p03389
u137228327
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['lst = list(map(int,input().split()))\nprint(lst)\nlst.sort()\ncount = 0\nwhile len(set(lst)) != 1:\n for i in range(len(lst)-2):\n if lst[i] <= lst[i+1]-2:\n lst[i] += 2\n elif lst[i] <= lst[i+2] and lst[i+1] <= lst[i-1]:\n lst[i] += 1\n lst[i+1] += 1\n count += 1\...
['Wrong Answer', 'Accepted']
['s974179623', 's582131114']
[9104.0, 9132.0]
[30.0, 28.0]
[351, 353]
p03389
u169138653
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['a=list(map(int,input().split()))\ncnt=0\nfor i in range(3):\n if a[i]%2==1:\n cnt+=1\nif cnt==0 or cnt==3:\n print((3*max(a)-sum(a))//2)\nelse:\n print((max(a)+1-a[0])//2+(max(a)+1-a[1])//2+(max(a)+1-a[2])//2+1)\n', 'a=list(map(int,input().split()))\ncnt=0\nfor i in range(3):\n if a[i]%2==1:\n cnt+=1\nif cn...
['Wrong Answer', 'Accepted']
['s189702324', 's864934462']
[3060.0, 3064.0]
[17.0, 17.0]
[210, 329]
p03389
u183631685
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['li = [int(i) for i in input().split()]\ncount = 0\nwhile True:\n li.sort(reverse=True)\n dif_1 = li[0] - li[1]\n dif_2 = li[1] - li[2]\n if dif_1 == 0 and dif_2 == 0:\n break\n if dif_1 == 1 and dif_2 == 0:\n li[1] += 1\n li[2] += 1\n count += 1\n continue\n else:\...
['Wrong Answer', 'Accepted']
['s464908984', 's156733939']
[3060.0, 2940.0]
[19.0, 17.0]
[353, 150]
p03389
u185896732
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['s=list(map(int,input().split()))\na=max(s)*3-sum(s)\nif a%2==1\n a+=3\nprint(a//2)', 's=list(map(int,input().split()))\na=max(s)*3-sum(s)\nif a%2==1:\n a+=3\nprint(a//2)']
['Runtime Error', 'Accepted']
['s539186991', 's223429248']
[2940.0, 2940.0]
[17.0, 17.0]
[81, 82]
p03389
u186426563
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['x = sorted(list(map(int, input().split())))\ncount = 0\nwhile(x[0] != x[2]):\n if(x[1] != x[2]):\n x[0] += 1\n x[1] += 1\n else:\n x[0] += 2\n count += 1\n x = sorted(x)\n', 'x = sorted(list(map(int, input().split())))\ncount = 0\nwhile(x[0] != x[2]):\n if(x[1] != x[2]):\n x...
['Wrong Answer', 'Accepted']
['s147605936', 's356086205']
[2940.0, 3060.0]
[17.0, 17.0]
[194, 207]
p03389
u200239931
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['from collections import Counter\ndef getinputdata():\n\n array_result = []\n \n array_result.append(input().split(" "))\n\n flg = 1\n\n try:\n\n while flg:\n\n data = input()\n\n if(data != ""):\n \n array_result.append(data.split(" "))\n\n ...
['Wrong Answer', 'Accepted']
['s325032663', 's029924198']
[3316.0, 3316.0]
[21.0, 21.0]
[1500, 1251]
p03389
u226155577
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['a, b, c = sorted(map(int, input().split()))\na = c-a; b = c-b\np = a%2; q = b%2\nif p and q:\n print(a//2+b//2)\nelif p or q:\n print(a//2+b//2+2)\nelse:\n print(a//2+b//2)\n', 'a, b, c = sorted(map(int, input().split()))\na = c-a; b = c-b\np = a%2; q = b%2\nif p and q:\n print(a//2+b//2+1)\nelif p or q:\...
['Wrong Answer', 'Accepted']
['s564947539', 's184495842']
[3060.0, 2940.0]
[17.0, 17.0]
[174, 176]
p03389
u364439209
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['def twoNumIncrement(n, m):\n return n+1, m+1\n\ndef doubleIncrement(n):\n return n+1\n\ndef equal(A, B, C):\n return A==B and B==C\n\ndef evenEven(d1, d2):\n return d1//2 + d2//2\n\n# tmpInput = "2 6 3\\n"\n\ninDatas = input().strip(\'\\n\').split(\' \')\n\ninDatas = list(map(int, inDatas))\ninDatas.sort(...
['Wrong Answer', 'Accepted']
['s940420526', 's146657367']
[3064.0, 3064.0]
[18.0, 17.0]
[600, 485]
p03389
u375870553
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
["def main():\n num = [int(i) for i in input().split()]\n num.sort()\n ans = 0\n ans+=((num[2]-num[1])//2)\n num[1]+=(num[2]-num[1])//2*2\n ans+=((num[2]-num[0])//2)\n num[0]+=(num[2]-num[0])//2*2\n if not (num[0]==num[1] and num[1]==num[2] and num[0]==num[2]):\n ans += 2\n print(ans)\...
['Wrong Answer', 'Accepted']
['s354301040', 's010750585']
[3064.0, 3060.0]
[18.0, 18.0]
[346, 236]
p03389
u476199965
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['N = int(input())\nc = -1\ns = 0\nfor i in range(N):\n ai,bi = map(int,input().split())\n s += ai\n if ai > bi:\n if c == -1:\n c = bi\n if bi < c:\n c = bi\nif c == -1:\n print(0)\nelse:\n print(s-c)\n', 'x = list(map(int,input().split()))\nx.sort()\na = x[2]-x[0]\nb...
['Runtime Error', 'Accepted']
['s793951295', 's481200345']
[3188.0, 3064.0]
[17.0, 18.0]
[237, 262]
p03389
u520158330
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['A,B,C = map(int,input().split())\n\nM = sorted([A,B,C])\nans = 0\n\n#Step 1\nans += M[2]-M[1]\nM[0] += M[2]-M[1]\nM[1] += M[2]-M[1]\n\n#Step 2\nans += (M[2]-M[0])//2\nif (M[2]-M[0])%2==0:\n M[0] += M[2]-M[0]\nelse:\n M[0] += M[2]-M[0]+1\n M[1] += 1\n M[2] += 1\n ans += 2\n \nprint(M,ans)', 'A,B,C = ...
['Wrong Answer', 'Accepted']
['s702719225', 's354328290']
[3064.0, 3064.0]
[17.0, 18.0]
[286, 284]
p03389
u536113865
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['l = list(map(int, input().split()))\nl.sort()\na,b,c = l[0],l[1],l[2]\nif (a-b)%2 == 1:\n print(c-a+1)\nelse:\n print(c-a+2)\n', 'l = list(map(int, input().split()))\nl.sort()\na,b,c = l[0],l[1],l[2]\nif (a-b)%2 == 0:\n print(c-b+(b-a)//2)\nelse:\n print(c-b+(b-a)//2+2)\n']
['Wrong Answer', 'Accepted']
['s114870077', 's163737718']
[2940.0, 2940.0]
[17.0, 17.0]
[125, 141]
p03389
u584749014
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['import math\n\ndef slv(A, B):\n A, B = (A, B) if A > B else (B, A)\n \n s = A * B\n c = math.floor(math.sqrt(A * B))\n \n if A == B:\n return 2 * c - 2\n elif c * c < s:\n return 2 * c - 2\n elif c * (c - 1) < s:\n return 2 * c - 3\n\nQ = int(input())\nfor q in range(Q):\n...
['Runtime Error', 'Accepted']
['s217992100', 's425548551']
[3064.0, 3064.0]
[17.0, 17.0]
[358, 442]
p03389
u623819879
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['*a=map(int,open(0))\nm=max(a)\nt=m*3-sum(a)\nif t%2==1:t+=3\nprint(t//2)', 'a,b,c=map(int,input().split())\na,b,c=sorted([a,b,c])\n\n#parity=set(list(map(lambda x: x % 2,[a,b,c])))\nparity=list(map(lambda x: x % 2,[a,b,c]))\n\nif len(set(parity))==1:\n print(int((3*max(a,b,c)-a-b-c)/2))\nelse:\n if (b-c)%2==0:\...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s347481080', 's462605800', 's967757132', 's683122562']
[2940.0, 3064.0, 3064.0, 3064.0]
[18.0, 18.0, 18.0, 17.0]
[68, 355, 358, 355]
p03389
u624475441
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['A = list(map(int, input().split()))\nM = max(A)\nS = sum(A)\nM += M % 2 != S % 2\nprint((3 * M - sum) // 2)', 'A = list(map(int, input().split()))\nM = max(A)\nS = sum(A)\nM += M % 2 != S % 2\nprint((3 * M - S) // 2)']
['Runtime Error', 'Accepted']
['s069553771', 's201004818']
[2940.0, 2940.0]
[18.0, 18.0]
[103, 101]
p03389
u672710370
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['import sys\nsys.setrecursionlimit(10**6)\n\ndebug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False\nif debug_mode:\n import os\n infile = open(os.path.basename(__file__).replace(".py", ".in"))\n\n def input():\n return infile.readline()\n\n\n# =======================================...
['Runtime Error', 'Accepted']
['s758548542', 's200450428']
[3064.0, 3064.0]
[20.0, 17.0]
[764, 766]
p03389
u762540523
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['a,b,c=sorted(map(int,input().split()));d,e=c-a,c-b;print(d//2+e//2+(3-d%2+e%2)%3)', 'a,b,c=sorted(map(int,input().split()));d,e=c-a,c-b;print(d//2+e//2+(3-d%2-e%2)%3)']
['Wrong Answer', 'Accepted']
['s793517368', 's984353127']
[3316.0, 2940.0]
[21.0, 17.0]
[81, 81]
p03389
u777529218
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['import numpy as np\n\na=np.vectorize(int)(input().split())\n\ncnt2=np.vectorize(lambda x: int((np.max(a)-x)/2))(a)\ncnt1=np.max(a)-a-2*cnt2\nprint(a)\nprint(sum(cnt2)+[0,2,1][sum(cnt1)])', 'import numpy as np\n\na=np.vectorize(int)(input().split())\n\ncnt2=np.vectorize(lambda x: int((np.max(a)-x)/2))(a)\ncnt1=np.max(...
['Wrong Answer', 'Accepted']
['s224724439', 's333656398']
[12504.0, 12504.0]
[152.0, 151.0]
[179, 170]
p03389
u777923818
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['# -*- coding: utf-8 -*-\nfrom math import sqrt\ndef inpl(): return map(int, input().split())\nQ = int(input())\n\ndef check(X, m):\n if X//m > m:\n return True\n else:\n return False\n\nfor q in range(Q):\n A, B = inpl()\n if A > B:\n A, B = B, A\n\n X = A*B\n if X <= 2:\n ...
['Runtime Error', 'Accepted']
['s770542974', 's387125589']
[3064.0, 3060.0]
[17.0, 17.0]
[823, 184]
p03389
u814986259
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['ABC=list(map(int,input().split()))\nABC.sort()\nans=0\nans+=(ABC[2]-ABC[0])//2\nif (ABC[2]-ABC[0])%2==1:\n ans+=(ABC[2]-ABC[0])//2\n ABC[0]=ABC[2]-1\n ans+=(ABC[2]-ABC[1])//2\n if (ABC[2]-ABC[1])%2 == 1:\n ans+=1\n else:\n ans+=2 \nelse:\n ans+=(ABC[2]-ABC[1])//2\n if (ABC[2]-ABC[1])%2 == 1:\n ans+=2...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s487878091', 's519618759', 's440730401']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0]
[316, 327, 272]
p03389
u824237520
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
["s = list(input())\n\nn = len(s)\n\na = [0] * n\n\nMOD = 998244353\n\nfor i in range(n):\n a[i] = ord(s[i]) - ord('a')\n\nif max(a) == min(a):\n print(1)\n exit()\nelif n == 3:\n def solver(m):\n x = m // 100\n y = ( m % 100 ) // 10\n z = m % 10\n if x != y:\n c = (3 ...
['Wrong Answer', 'Accepted']
['s316901040', 's064634189']
[3312.0, 2940.0]
[18.0, 17.0]
[1503, 148]
p03389
u876442898
2,000
262,144
You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ...
['A, B, C = map(int, input().split(" "))\ncnt = 0\n\nif (A%2 == B%2) and (B%2 == C%2):\n pass\nelse:\n if A%2 == B%2:\n A += 1\n B += 1\n cnt += 1\n elif A%2 == C%2:\n A += 1\n C += 1\n cnt += 1\n else:\n B += 1\n C += 1\n cnt += 1\n\nABC = sort...
['Runtime Error', 'Accepted']
['s634969390', 's374220904']
[3064.0, 3064.0]
[17.0, 18.0]
[380, 581]