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
p03111
u969190727
2,000
1,048,576
You have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively. Your objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number: * Extension Magic: Consumes 1 _MP_ (magic poi...
['N, A, B, C = map(int, input().split())\nl = [int(input()) for i in range(N)]\nINF = 10 ** 9\n\ndef dfs(cur, a, b, c):\n if cur == N:\n return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF\n ret0 = dfs(cur + 1, a, b, c)\n ret1 = dfs(cur + 1, a + l[cur], b, c) + 10\n ret2 = dfs(cur + 1, a,...
['Runtime Error', 'Accepted']
['s901285809', 's128496256']
[2940.0, 3188.0]
[18.0, 78.0]
[434, 437]
p03111
u997521090
2,000
1,048,576
You have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively. Your objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number: * Extension Magic: Consumes 1 _MP_ (magic poi...
['N, A, B, C = map(int,input().split())\nans = [[0, 0, 0, 0]]\nfor i in range(N): ans = [[p[j] + int(input()) * (i == j) for j in [0, 1, 2]] + [p[3]+(i < 3)] for p in ans for i in range(4)]\nprint(min(abs(p[0] - A) + abs(p[1] - B) + abs(p[2] - C) + p[3] * 10 - 30 for p in ans if min(p[:3]) > 0))', 'N,*A=map(int,input()...
['Runtime Error', 'Accepted']
['s222719236', 's353560957']
[3180.0, 16756.0]
[18.0, 170.0]
[291, 220]
p03112
u001024152
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["# D\nfrom bisect import bisect_right\nA,B,Q = map(int, input().split())\nINF = float('inf')\ns = [-INF] + [int(input()) for _ in range(A)] + [INF]\nt = [-INF] + [int(input()) for _ in range(A)] + [INF]\nfor q in range(Q):\n x = int(input())\n b,d = bisect_right(s, x), bisect_right(t, x)\n ans = INF\n for ...
['Runtime Error', 'Accepted']
['s885594130', 's077235790']
[11664.0, 12816.0]
[334.0, 942.0]
[553, 591]
p03112
u011634450
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['def get_nearest(point, lst):\n shortest = 1000000000000000\n nearest = float("inf")\n for x in lst:\n dist = abs(x - point)\n if dist < shortest:\n shortest = dist\n nearest = x\n return nearest\n\ndef exist_between(a, b, lst):\n for x in lst:\n if a <= x and ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s508522283', 's748450530', 's763119100', 's361180485']
[11052.0, 11668.0, 17552.0, 13964.0]
[2104.0, 742.0, 1992.0, 1705.0]
[1041, 464, 484, 476]
p03112
u016128476
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['# input\nA, B, Q = map(int, input().split())\nS, T, X = [], [], []\nfor _ in range(A):\n S.append(int(input()))\n\nfor _ in range(B):\n T.append(int(input()))\n\nfor _ in range(Q):\n X.append(int(input()))\n\n# end of world\nEOW = 10 ** 10\n\n# boundary info\ntbounds = [(T[i+1] + T[i]) // 2 for i in range(B-...
['Wrong Answer', 'Accepted']
['s739001645', 's994925598']
[31544.0, 12800.0]
[720.0, 1695.0]
[960, 476]
p03112
u021548497
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import sys\n\ndef main():\n input = sys.stdin.readline\n a, b, q = map(int, input().split())\n s = [0]*a\n for i in range(a):\n s[i] = int(input())\n \n t = [0]*b\n for i in range(b):\n t[i] = int(input())\n\n s_near = [0]*a\n k = 0\n for i in range(a):\n if k == b-1:\n s_near[i] = abs(s[i]-t[...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s128611843', 's649465382', 's012707005']
[20120.0, 12432.0, 12800.0]
[1516.0, 808.0, 899.0]
[1676, 564, 572]
p03112
u028217518
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['read = input\n# read = Read(False, """\n# 1 1 3\n# 1\n# 10000000000\n# 2\n# 9999999999\n# 5000000000\n# """).read\nA,B,Q = list(map(int, read().split(\' \')))\narrA = list(map(int, [read() for i in range(A)]))\narrB = list(map(int, [read() for i in range(B)]))\narrQ = list(map(int, [read() for i in range(Q)]))\narrA....
['Wrong Answer', 'Runtime Error', 'Accepted']
['s254366772', 's661311279', 's872983522']
[22836.0, 3064.0, 12800.0]
[1790.0, 18.0, 1716.0]
[998, 983, 689]
p03112
u029234056
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA,B,Q=map(int,input().split(" "))\nINF=10**18\nS=[-INF]+[int(input()) for _ in range(A)]+[INF]\nprint(S)\nT=[-INF]+[int(input()) for _ in range(B)]+[INF]\nfor _ in range(Q):\n x=int(input())\n a,b=bisect.bisect_right(S,x),bisect.bisect_right(T,x)\n res=INF\n for e in [S[a-1],S[a]]:\n ...
['Wrong Answer', 'Accepted']
['s892664838', 's898487750']
[19800.0, 14092.0]
[2105.0, 1686.0]
[464, 419]
p03112
u036340997
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\na, b, q = map(int, input().split())\ninf = 10**18\ns = [-inf] + [int(input()) for i in range(a)] + [inf]\nt = [-inf] + [int(input()) for i in range(b)] + [inf]\n\nfor i in range(q):\n x = int(input())\n b, d = bisect.bisect_right(s, x), bisect_right(t, x)\n res = inf\n for S in [s[b-1], s[b]]:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s428819751', 's576411105', 's758360995']
[11740.0, 14336.0, 14340.0]
[334.0, 1727.0, 1735.0]
[430, 438, 438]
p03112
u046187684
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['def solve(string):\n a, b, q, *stx = map(int, string.split())\n s = sorted(stx[:a] + [-10**10, 2 * 10**10])\n t = sorted(stx[a:a + b] + [-10**10, 2 * 10**10])\n x = {_q: -1 for _q in stx[-q:]}\n i_s = 0\n i_t = 0\n for _x in sorted(x.keys()):\n while s[i_s] < _x:\n i_s += 1\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s108323057', 's573787370', 's171482414']
[67232.0, 39528.0, 39512.0]
[1307.0, 767.0, 772.0]
[857, 1107, 698]
p03112
u052499405
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\nA, B, Q = [int(i) for i in input().split()]\n\ns = [-10**12] + [int(input()) for i in range(A)] + [10**12]\nt = [-10**12] + [int(input()) for i in range(B)] + [10**12]\nx = [int(input()) for i in range(Q)]\n\nfor item in x:\n b, d = bisect.bisect_left(s, item), bisect.bisect_left(t, item)\n min...
['Runtime Error', 'Accepted']
['s614190020', 's365476415']
[14908.0, 16188.0]
[485.0, 1123.0]
[590, 590]
p03112
u054825571
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['from bisect import bisect_left\n\nA,B,Q=map(int,input().split())\nS=[int(input()) for i in range(A)]\nT=[int(input()) for i in range(B)]\nfor i in range(Q):\n x=int(input())\n si=bisect_left(S,x)\n ti=bisect_left(T,x)\n if 0<si<A and 0<ti<B:\n sl,sr=abs(x-S[si-1]),abs(x-S[si])\n tl,tr=abs(x-...
['Runtime Error', 'Accepted']
['s555700637', 's196898777']
[16876.0, 16820.0]
[932.0, 940.0]
[1369, 1348]
p03112
u062459048
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA,B,Q = map(int, input().split())\nS,T,X = [],[],[]\nfor i in range(A):\n S[i] = int(input())\nfor i in range(B):\n T[i] = int(input())\nfor i in range(Q):\n X[i] = int(input())\n for i in range(Q):\n ans = []\n sin = bisect.bisect_left(S, X[i])\n if sin == 0:\n s1,s2 = S[sin], -(10**9)\n eli...
['Runtime Error', 'Runtime Error', 'Accepted']
['s320959155', 's492705625', 's302263214']
[2940.0, 3064.0, 16152.0]
[17.0, 19.0, 1366.0]
[754, 755, 768]
p03112
u062655521
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\nA, B, Q = map(int, input().split())\n\nINF = 10 ** 18\ns = [-INF] + [int(input()) for _ in range(A)] + [INF]\nt = [-INF] + [int(input()) for _ in range(B)] + [INF]\n\nfor x in range(Q):\n b = bisect.bisect_right(s, x)\n d = disect.bisect_right(t, x)\n dist = 0\n for sb in [s[b - 1], s[b]]:\n f...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s234424199', 's582193178', 's597161809', 's430715670']
[11664.0, 13848.0, 11928.0, 13968.0]
[336.0, 1726.0, 907.0, 1771.0]
[446, 465, 446, 467]
p03112
u065188401
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['r i in range(A):\n S.append(int(input()))\n\nS = [-INF] + S + [INF]\n\nT = []\nfor i in range(B):\n T.append(int(input()))\n\nT = [-INF] + T + [INF]\n\n\nfor i in range(Q):\n x = int(input())\n \n d, b = bisect.bisect_right(S, x), bisect.bisect_right(T, x)\n \n res = INF\n for s in [S[d - 1], ...
['Runtime Error', 'Accepted']
['s375474163', 's021958914']
[2940.0, 13584.0]
[17.0, 1730.0]
[491, 563]
p03112
u067729694
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A, B, Q = map(int, input().split())\ns = []\nt = []\nx = []\nfor _ in range(A):\n s.append(int(input()))\nfor _ in range(B):\n t.append(int(input()))\nfor _ in range(Q):\n x.append(int(input()))\n\nimport sys\nINT_MAX = sys.maxsize\ns.insert(0, -1 * INT_MAX)\ns.append(INT_MAX)\nt.insert(0, -1 * INT_MAX)\nt.a...
['Runtime Error', 'Accepted']
['s182729953', 's399838991']
[16152.0, 16152.0]
[1026.0, 1044.0]
[990, 990]
p03112
u094191970
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import numpy as np\nA, B, Q = map(int, input().split())\n\ns_list = [int(input()) for a in range(A)]\nt_list = [int(input()) for b in range(B)]\nx_list = [int(input()) for q in range(Q)]\n\nfor x in x_list:\n near_s = np.abs(np.array(s_list) - x).argmin()\n near_t = np.abs(np.array(t_list) - x).argmin()\n\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s046335785', 's276563544', 's075017770']
[26820.0, 19004.0, 17424.0]
[2109.0, 2105.0, 1116.0]
[1201, 1207, 460]
p03112
u104282757
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['# D\nfrom bisect import bisect_left\nA, B, Q = map(int, input().split())\n\ns_list = [0]*A\nt_list = [0]*B\nq_list = [0]*Q\n\nfor i in range(A):\n s_list[i] = int(input())\nfor i in range(B):\n t_list[i] = int(input())\nfor i in range(Q):\n q_list[i] = int(input())\n \ndef query_dist(q):\n res = 10**11...
['Wrong Answer', 'Accepted']
['s733560700', 's696438201']
[16148.0, 18024.0]
[1352.0, 1496.0]
[1666, 1656]
p03112
u106778233
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect,sys \ninput=sys.stdin.readline \na,b,Q=map(int,input().split())\nINF=10**18\ns=[-INF]+[int(input()) for _ in range(A)]+[INF]\nt=[-INF]+[int(input()) for _ in range(B)]+[INF]\nfor q in range(Q):\n x=int(input())\n b,d=bisect.bisect_right(s,x),bisect.bisect_right(t,x)\n res=INF \n for S in [s(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s537295437', 's888419955', 's659503656']
[3064.0, 11664.0, 12816.0]
[18.0, 104.0, 905.0]
[451, 451, 451]
p03112
u117348081
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\nA,B,Q = map(int, input().split())\nINF = 10**18\n\ns =[-INF] + [int(input()) for i in range(A)] +[INF]\nt =[-INF] + [int(input()) for i in range(B)] +[INF]\n\nfor q in range(q):\n x = int(input())\n b,d =bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n res = INF\n for S in [s[b-1], ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s430745549', 's667802796', 's222962549']
[11776.0, 11744.0, 14360.0]
[333.0, 374.0, 1702.0]
[446, 451, 451]
p03112
u129315407
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['\n\nsa = []\nta = []\nqa = []\nfor i in range(sn):\n sa.append(int(input()))\nfor i in range(tn):\n ta.append(int(input()))\nfor i in range(qn):\n qa.append(int(input()))\n\n\ndef find_nearest(q, al, s, e):\n if e - s < 2:\n d1 = abs(q - al[s])\n d2 = abs(q - al[e])\n if d1 < d2:\n ...
['Runtime Error', 'Accepted']
['s070704793', 's730166816']
[3064.0, 16168.0]
[18.0, 1434.0]
[1296, 1034]
p03112
u149284596
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect as bi\na,b,q = map(int,input().split())\ns = sorted([int(input()) for i in range(a) ])\nt = sorted([int(input()) for i in range(b) ])\nx = sorted([int(input()) for i in range(q) ])\n\nfor i in range(q):\n Q = x[i]\n ans_s = []\n ans_t = []\n ans_s.append(s[bi.bisect_left(s,Q)])\n ans_t.ap...
['Runtime Error', 'Accepted']
['s134785162', 's949271308']
[18696.0, 16160.0]
[1512.0, 1640.0]
[828, 824]
p03112
u167523937
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import sys\ndef calc_dist(xi,s,t):\n s_dif = []\n t_dif = []\n min_s_dif = sys.maxsize\n min_t_dif = sys.maxsize\n min_s = -1\n min_t = -1\n ls = len(s)\n lt = len(t)\n l = ls\n if ls<lt:\n l=lt\n temp_min_s_dif = 0\n temp_min_t_dif = 0\n result=0\n for i in range(l):\...
['Wrong Answer', 'Accepted']
['s111134314', 's780197670']
[15028.0, 17272.0]
[2104.0, 1052.0]
[1338, 933]
p03112
u169696482
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA,B,Q=map(int,input().split())\nINF=10**18\nS=[-INF]+[int(input()) for i in range(A)]+[INF]\nT=[-INF]+[int(input()) for i in range(B)]+[INF]\nfor q in range(Q):\n x=int(input())\n i=bisect.bisect_right(S,x)\n j=bisect.bisect_right(T,x)\n d=INF\n print(i)\n for s in [S[i-1],S[i]]:\n ...
['Wrong Answer', 'Accepted']
['s515677474', 's671374252']
[14228.0, 12804.0]
[1839.0, 1714.0]
[440, 427]
p03112
u179169725
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A, B, Q = list(map(int, input().split()))\n\nINF = 10 ** 18\n\nS = [-INF] + [int(input()) for _ in range(A)]+[INF]\nT = [-INF] + [int(input()) for _ in range(B)]+[INF]\n\nfrom bisect import bisect_right\nfrom itertools import product\n\nfor q in range(Q): \n x = int(input()) \n s_idx, t_idx = bisect_right(S, ...
['Wrong Answer', 'Accepted']
['s374467362', 's868090354']
[14844.0, 12800.0]
[1764.0, 1714.0]
[1641, 476]
p03112
u185354171
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\nINF = 10 ** 18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nfor q in range(Q):\n x = int(input())\n b, d = bisect.bisect_left(s, x), bisect.bisect_left(t, x)\n res = INF\n for S in [s[b + ...
['Runtime Error', 'Accepted']
['s947453013', 's325697245']
[12284.0, 14592.0]
[1682.0, 1681.0]
[474, 476]
p03112
u185948224
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['from bisect import bisect_left\nA, B, Q = map(int, input().split())\ns = [int(input()) for _ in range(A)]\nt = [int(input()) for _ in range(B)]\n\ns.sort()\nt.sort()\n\nfor k in range(Q):\n x = int(input())\n ans = []\n ms = bisect_left(s, x)\n for i in [-1, 0]:\n if 0 <= ms + i <= A - 1:\n ...
['Wrong Answer', 'Accepted']
['s598965597', 's058897563']
[19192.0, 17008.0]
[1641.0, 1500.0]
[783, 786]
p03112
u187205913
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["a,b,q = map(int,input().split())\ns = [-float('inf')]+[int(input()) for i in range(a)]+[float('inf')]\nt = [-float('inf')]+[int(input()) for i in range(b)]+[float('inf')]\nx = [int(input()) for i in range(q)]\nimport bisect\nfor x_ in x:\n s_r = bisect.bisect_right(s,x_)\n t_r = bisect.bisect_right(s,x_)\n r...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s169091307', 's643673171', 's751823614', 's830801366']
[16128.0, 14964.0, 19948.0, 17532.0]
[1244.0, 487.0, 2105.0, 1249.0]
[515, 540, 816, 515]
p03112
u190405389
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\na,b,q = map(int,input().split())\ns = [-10**11] + [int(input()) for i in range(a)] + [10**11]\nt = [-10**11] + [int(input()) for i in range(b)] + [10**11]\n\n\n\nfor i in range(q):\n x = int(input())\n xs = bisect.bisect_right(s,x)\n xt = bisect.bisect_right(t,x)\n ss = [x-s[xs-1],s[xs]-x...
['Wrong Answer', 'Accepted']
['s164444096', 's377761186']
[14740.0, 14608.0]
[1362.0, 1443.0]
[388, 448]
p03112
u190406011
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import sys\nimport bisect\n\n_input = sys.stdin.readlines()\nA, B, Q = [int(i) for i in _input[0].split()]\ndata = [int(i) for i in _input[1:]]\n"""\nA, B, Q = [int(i.strip()) for i in input().split()]\ndata = list()\nfor l in range(A+B+Q):\n data.append(int(input()))\n"""\ns_ls = sorted(data[:A] + [1e30,-1e30])\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s108830665', 's482719336', 's721196757', 's998122164', 's348015476']
[42296.0, 18048.0, 18424.0, 39428.0, 42380.0]
[518.0, 906.0, 902.0, 518.0, 702.0]
[797, 789, 797, 790, 891]
p03112
u200785298
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['#!/usr/bin/env python3\nimport sys\n \n \ndef solve(n: int, m: int, Q: int, s: "List[int]", t: "List[int]", x: "List[int]"):\n \n def check_pos(target, a, x):\n ret = {}\n a_x = a + x\n a_x.sort()\n idx = 0\n while idx < len(a_x) and a_x[idx] < target[0]:\n dis = targe...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s911751660', 's969643029', 's791846444']
[183928.0, 210792.0, 16160.0]
[1762.0, 1799.0, 1394.0]
[1902, 2164, 1355]
p03112
u203843959
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\nA,B,Q=map(int,input().split())\nslist = []\nfor i in range(A):\n slist.append(int(input()))\n#print(slist)\n \ntlist = []\nfor i in range(B):\n tlist.append(int(input()))\n#print(tlist)\n\nfor i in range(Q):\n x = int(input())\n min_dist = 10**11\n \n # x->s->t\n if x < slist[0]:\n si = [0...
['Runtime Error', 'Runtime Error', 'Accepted']
['s016407659', 's637204310', 's410036250']
[3060.0, 3060.0, 12080.0]
[17.0, 17.0, 1991.0]
[1355, 1227, 1179]
p03112
u210543511
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['improt bisect\nA, B, Q = map(int, input().split())\nss = [int(input()) for i in range(A)]\nts = [int(input()) for i in range(B)]\nxs = [int(input()) for i in range(Q)]\nINF = 10**11\n\n-INF, INF = -1, 10**10 + 1\nss = [-INF] + ss + [INF]\nts = [-INF] + ts + [INF]\n\n# s_e is index the nearest s on the east side of x\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s259273171', 's306705912', 's911061861']
[2940.0, 3064.0, 16780.0]
[18.0, 17.0, 1211.0]
[672, 641, 613]
p03112
u219015402
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\nA, B, Q = map(int,input().split())\nINF = 10**18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nx_list = [int(input()) for i in range(Q)]\n\nfor x in x_list:\n \n b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n a ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s025276517', 's059816867', 's106876199', 's213794681', 's696006809', 's227519515']
[16144.0, 3064.0, 27836.0, 25884.0, 20736.0, 16144.0]
[1028.0, 18.0, 2109.0, 2109.0, 2109.0, 1040.0]
[814, 550, 962, 976, 966, 814]
p03112
u223646582
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["import bisect\nA, B, Q = map(int, input().split())\nS = [int(input()) for _ in range(A)]\nT = [int(input()) for _ in range(B)]\nX = [int(input()) for _ in range(Q)]\n\nA = []\nfor x in X:\n SL, SR, TL, TR = 10**20, 10**20, 10**20, 10**20\n i = bisect.bisect_left(S, x)\n if i != 0:\n SL = x-S[i-1]\n ...
['Runtime Error', 'Accepted']
['s245733143', 's077903402']
[21328.0, 16144.0]
[942.0, 931.0]
[583, 553]
p03112
u223904637
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\na,b,q=map(int,input().split())\ns=[]\nt=[]\nfor i in range(a):\n s.append(int(input()))\nfor i in range(b):\n t.append(int(input()))\nfor i in range(q):\n x=int(input())\n si=bisect.bisect_left(s,x)\n ti=bisect.bisect_left(t,x)\n if si==a:\n sk=[s[a-1]]\n elif si==0:\n ...
['Runtime Error', 'Accepted']
['s509345672', 's629766110']
[11068.0, 12092.0]
[1116.0, 1709.0]
[552, 593]
p03112
u227082700
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['from bisect import bisect_left,bisect_right\na,b,q=map(int,input().split())\ns=[-(10**21)]+[int(input())for _ in range(a)]+[10**21]\nt=[-(10**21)]+[int(input())for _ in range(b)]+[10**21]\nfor _ in range(q):\n x=int(input())\n s1,s2=s[bisect_right(s,x)-1],s[bisect_right(s,x)]\n t1,t2=t[bisect_right(t,x)-1],t[bisec...
['Wrong Answer', 'Accepted']
['s372188296', 's063184497']
[11672.0, 16132.0]
[1236.0, 1117.0]
[441, 574]
p03112
u227170240
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A, B, Q = map(int, input().split())\ns = [0] + [int(input()) for i in range(A)] + [10**11]\nt = [0] + [int(input()) for i in range(B)] + [10**11]\n\ndef nibutans(x, l, r):\n\tif r - l <= 1:\n\t\treturn r\n\tnibu = (s[r] + s[l]) // 2\n\treturn nibutans(x, nibu, r) if x > nibu else nibutans(x, l, nibu)\n\ndef nibutant(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s071595774', 's115530453', 's115511097']
[12800.0, 21120.0, 12816.0]
[1549.0, 2104.0, 1707.0]
[733, 754, 1064]
p03112
u232852711
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\ninf = 10**18\na, b, q = map(int, input().split())\ns = [-inf] + [int(input()) for _ in range(a)] + [inf]\nt = [-inf] + [int(input()) for _ in range(a)] + [inf]\n\nfor _ in range(q):\n x = int(input())\n i = bisect.bisect_right(s, x)\n j = bisect.bisect_right(t, x)\n ans = inf\n for s_x i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s710388004', 's858405175', 's898257396']
[14604.0, 14336.0, 14228.0]
[1762.0, 1750.0, 1768.0]
[512, 511, 511]
p03112
u268793453
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['\na, b, q = [int(i) for i in input().split()]\nS = [int(input()) for i in range(a)]\nT = [int(input()) for i in range(b)]\nX = [int(input()) for i in range(q)]\nprint(0)', 'from bisect import bisect_left as bisect\n\na, b, q = [int(i) for i in input().split()]\nS = [int(input()) for i in range(a)]\nT = [int(input()) ...
['Wrong Answer', 'Accepted']
['s738368925', 's595553225']
[15012.0, 16156.0]
[481.0, 1109.0]
[202, 637]
p03112
u275934251
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['from bisect import bisect_left\na,b,q=map(int,input().split())\ns=[]\nt=[]\nx=[]\ns.append(-float("inf"))\nt.append(-float("inf"))\nfor i in range(a):\n s.append(int(input()))\nfor i in range(b):\n t.append(int(input()))\ns.append(float("inf"))\nt.append(float("inf"))\ns.sort()\nt.sort()\nfor i in range(q):\n ...
['Runtime Error', 'Accepted']
['s604139134', 's582093881']
[11064.0, 12080.0]
[357.0, 1539.0]
[1083, 761]
p03112
u282228874
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["from bisect import bisect_left\nimport sys\ninput = sys.stdin.readline\na,b,q = map(int,input().split())\ninf = float('inf')\nS = [-inf]+[int(input()) for i in range(a)]+[inf]\nT = [-inf]+[int(input()) for i in range(b)]+[inf]\n\ndef f(S,T):\n res = 10**30 \n s = bisect_left(S,x)\n res = []\n\n for i in r...
['Wrong Answer', 'Accepted']
['s478419579', 's732860208']
[14480.0, 13952.0]
[1653.0, 1583.0]
[524, 536]
p03112
u284854859
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['#AVL\n\n##search(0,x):O(logN)\n\ndef search(root,key):\n if avl_key[root] > key:\n if avl_left[root] == None:\n return None\n else:\n return search(avl_left[root],key)\n if avl_key[root] < key:\n if avl_right[root] == None:\n return None\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s013796429', 's019177464', 's048560378', 's055119345', 's133682131', 's180359593', 's339838137', 's399288027', 's404465552', 's458142659', 's477514509', 's586416003', 's622249812', 's648755750', 's709629918', 's868095393', 's922473024', 's754536193']
[23484.0, 21260.0, 13532.0, 15680.0, 68960.0, 62944.0, 25364.0, 17364.0, 64992.0, 21256.0, 24928.0, 68968.0, 15968.0, 23136.0, 32980.0, 15980.0, 12640.0, 12212.0]
[2105.0, 889.0, 858.0, 2104.0, 2000.0, 2107.0, 1745.0, 1717.0, 1973.0, 900.0, 2105.0, 2116.0, 437.0, 2105.0, 926.0, 438.0, 1756.0, 887.0]
[5854, 7046, 6242, 3057, 7315, 7217, 7129, 6245, 7217, 7008, 5305, 8130, 1959, 5842, 7136, 1964, 6235, 3028]
p03112
u311636831
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['N = list(map(int, input().split()))\n#A = [[0] * (N[0]+N[1]+N[2])]*2\nA = [[10**10+1] * 4 for i in range((N[0]+N[1]+N[2]))]\n#print(A)\nfor i in range(N[0]):\n A[i][0]=int(input())\n A[i][1]=0\n\nfor i in range(N[0],N[0]+N[1]):\n A[i][0]=int(input())\n A[i][1]=1\n\nr=0\nfor i in range(N[0]+N[1],N[0]+N[1]+...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s305890035', 's337280569', 's976562963']
[60032.0, 59836.0, 16168.0]
[2108.0, 2108.0, 1272.0]
[1328, 1328, 772]
p03112
u316386814
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = list(map(int, input().split()))\nS, T, X = [-INF], [-INF], []\nfor _ in range(A):\n S.append(int(input()))\nfor _ in range(B):\n T.append(int(input()))\nfor _ in range(Q):\n X.append(int(input()))\nINF = 10 ** 12\nS.append(INF)\nT.append(INF)\n\nfor x in X:\n ans = INF\n sr = b...
['Runtime Error', 'Accepted']
['s177015236', 's128196131']
[3064.0, 16160.0]
[17.0, 1146.0]
[507, 508]
p03112
u319818856
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\nINF = 10 ** 18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nfor q in range(Q):\n x = int(input())\n b, d = min(bisect.bisect_right(s, x), A-1), min(bisect.bisect_right(t, x), B-1)\n a, c = max(b-1,...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s205704382', 's233949349', 's246140175', 's328410480', 's365910459', 's409882131', 's637701550', 's888707448', 's554191322']
[3064.0, 3064.0, 3064.0, 15364.0, 15104.0, 3064.0, 36356.0, 36356.0, 13952.0]
[17.0, 17.0, 17.0, 2031.0, 2068.0, 17.0, 1996.0, 2049.0, 1754.0]
[509, 446, 440, 524, 566, 452, 1138, 1138, 466]
p03112
u325227960
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import numpy as np\n\na,b,q=map(int,input().split())\n\nST=[]\nfor i in range(a):\n k=int(input())\n ST.append([k,0,0])\nfor i in range(b):\n k=int(input())\n ST.append([k,1,0])\n\nST.sort()\n\nle0=-1\nle1=-1\nri0=1\nri1=1\n\nfor i in range(a+b):\n if ST[i][1]==0 :\n pa=1\n \n moyo...
['Runtime Error', 'Accepted']
['s700715982', 's462689705']
[39568.0, 17552.0]
[617.0, 964.0]
[2261, 466]
p03112
u326609687
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A, B, Q = map(int, input().split())\ns = [-10**10] + [int(input()) for _ in range(A)] + [2*10**10, 2*10**10 + 1]\nt = [-10**10] + [int(input()) for _ in range(B)] + [2*10**10, 2*10**10 + 1]\nx = [int(input()) for _ in range(Q)]\n\n\ndef searchindex(p, z):\n for i, d in enumerate(p):\n if d > z:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s423982152', 's698505981', 's676551075']
[14848.0, 16152.0, 16152.0]
[2104.0, 911.0, 839.0]
[611, 881, 882]
p03112
u343523393
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\nINF = 10 ** 18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nfor q in range(Q):\n\tx = int(input())\n\tb, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n\tres = INF\n\tfor S in [s[b - 1], s[...
['Runtime Error', 'Accepted']
['s678521070', 's978921370']
[3064.0, 13972.0]
[18.0, 1713.0]
[434, 476]
p03112
u346308892
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['\nimport numpy as np\nfrom functools import *\nimport sys\nsys.setrecursionlimit(100000)\n\n\ndef acinput():\n return list(map(int, input().split(" ")))\n\n\ndef II():\n return int(input())\n\nmod = 10**9+7\n\n\ndef factorial(n):\n fact = 1\n for integer in range(1, n + 1):\n fact *= integer\n r...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s423599080', 's648904322', 's745297446', 's754731512', 's368287698']
[26332.0, 22752.0, 26736.0, 25328.0, 26704.0]
[1285.0, 1846.0, 1370.0, 1398.0, 1508.0]
[1352, 1353, 1444, 1381, 1103]
p03112
u350049649
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\nA,B,Q=map(int,input().split())\ns=[int(input()) for _ in range(A)]\nt=[int(input()) for _ in range(B)]\nq=[int(input()) for _ in range(Q)]\n\ndef solve(start):\n ans=[]\n x=bisect.bisect_left(s,start,lo=0,hi=len(s))\n\n t1=bisect.bisect_left(t,x,lo=0,hi=len(t))\n if x<len(s) and t1<len(t)...
['Wrong Answer', 'Accepted']
['s378743172', 's278041804']
[16196.0, 16128.0]
[1898.0, 1073.0]
[1018, 461]
p03112
u350697094
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\ns = [int(input()) for i in range(A)]\nt = [int(input()) for i in range(B)]\nx = [int(input()) for i in range(Q)]\ninf = [10**13, -10**13]\nA,B,C=2, 3, 4\ns = sorted([100,600]+inf)\nt = sorted([400,900,1000]+inf)\nx = [150,2000,899,799]\n\nfor i in x:\n s_r = s[bi...
['Runtime Error', 'Accepted']
['s834844228', 's476288121']
[15044.0, 16772.0]
[484.0, 1150.0]
[689, 638]
p03112
u350836088
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\na,b,q = map(int,input().split())\ninf = 10**18\nS = [-inf]+[int(input()) for _ in range(a)]+[inf]\nT = [-inf]+[int(input()) for _ in range(b)]+[inf]\nans = inf\nfor _ in range(q):\n x = int(input())\n b,d = bisect.bisect_right(S,x),bisect.bisect_right(T,x)\n for s in [S[b-1],S[b]]:\n for t in [...
['Wrong Answer', 'Accepted']
['s081486246', 's915915227']
[12800.0, 13840.0]
[1726.0, 1706.0]
[428, 442]
p03112
u353797797
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['with open("td") as inputfile:\n open0=inputfile.read()\n\ndef zengo(l,n):\n if n<l[0]:\n return 0,l[0]-n\n elif n>l[-1]:\n return n-l[-1],0\n else:\n st=0\n ed=len(l)\n while ed-st>1:\n md=(st+ed)//2\n if n<l[md]:\n ed=md\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s016411735', 's189229948', 's591908445', 's258766212']
[3064.0, 3064.0, 3064.0, 36612.0]
[18.0, 18.0, 18.0, 1182.0]
[738, 687, 682, 689]
p03112
u360116509
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\n\ndef f(a, x):\n i = bisect.bisect_left(a, x)\n if i >= len(a) - 1:\n return a[-1]\n if x - a[i] > a[i + 1] - x:\n return a[i + 1]\n return a[i]\n\n\ndef main():\n A, B, Q = map(int, input().split())\n s = []\n t = []\n ans = []\n for _ in range(A):\n s...
['Wrong Answer', 'Accepted']
['s567607536', 's588228446']
[16880.0, 16896.0]
[1081.0, 1216.0]
[661, 688]
p03112
u371467115
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A,B,Q=map(int,input().split())\nINF=10**18\nS=[-INF]+[int(input()) for _ in range(A)]+[INF]\nT=[-INF]+[int(input()) for _ in range(B)]+[INF]\nX=[int(input()) for _ in range(Q)]\n\ndef binary_serch(a,x,st=0,end=len(a)):\n while st<end:\n i=len(a)//2\n if x<a[i]:\n end=i\n elif a[i]<x:\n st=i+1\n r...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s176814885', 's343936974', 's513848190', 's588672798', 's302743630']
[14852.0, 12800.0, 3064.0, 3064.0, 12812.0]
[486.0, 1762.0, 18.0, 18.0, 1668.0]
[527, 406, 371, 397, 454]
p03112
u391875425
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nimport sys\nA, B, Q = map(int, input().split())\nINF = 10 ** 13\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nxs = [int(sys.stdin.readline()) for i in range(Q)]\nfor x in range(xs):\n b, d = bisect.bisect_right(s, x), bisect.bisect_rig...
['Runtime Error', 'Accepted']
['s712274423', 's326807202']
[14864.0, 14244.0]
[376.0, 1605.0]
[518, 583]
p03112
u392319141
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['from bisect import bisect_right\n\nA , B , Q = map(int,input().split())\nINF = 10**20\n\ns = [0] * A\nt = [0] * B\nx = [0] * Q\n\nfor i in range(A) :\n s[i] = int(input())\nfor i in range(B) :\n t[i] = int(input())\nfor i in range(Q) :\n x[i] = int(input())\n\ns = [INF] + s + [INF]\nt = [INF] + t + [INF]\n\n...
['Wrong Answer', 'Accepted']
['s091681196', 's405842339']
[17604.0, 12816.0]
[1218.0, 1505.0]
[625, 606]
p03112
u393512980
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect as bs\na, b, q = map(int, input().split())\nINF = 10**18\ns = [-INF] + sorted([int(input()) for _ in range(a)]) + [INF]\nt = [-INF] + sorted([int(input()) for _ in range(b)]) + [INF]\n\nfor _ in range(q):\n z = int(input())\n x, y = bs.bisect_right(s, z), bs.bisect_right(t, z)\n s1, s2, t1, t2 ...
['Wrong Answer', 'Accepted']
['s567641588', 's111240349']
[12784.0, 12784.0]
[1414.0, 1480.0]
[433, 476]
p03112
u411858517
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\nA, B, Q = map(int, input().split())\ns = [int(input()) for _ in range(A)]\nt = [int(input()) for _ in range(B)]\nx = [int(input()) for _ in range(Q)]\n\n\nfor i in range(Q):\n\n insert_index = bisect.bisect_left(s,x[i])\n if insert_index >= A:\n insert_index = insert_index -1\n tm...
['Runtime Error', 'Runtime Error', 'Accepted']
['s123371069', 's704632382', 's431885813']
[3064.0, 3064.0, 16188.0]
[17.0, 17.0, 1542.0]
[1343, 1343, 1701]
p03112
u427344224
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A, B, Q = map(int, input().split())\ns_list = [int(input()) for i in range(A)]\nt_list = [int(input()) for i in range(B)]\nx_list = [int(input()) for _ in range(Q)]\n\ns_list.sort()\nt_list.sort()\nimport bisect\n\nans = []\nfor x in x_list:\n tmp = float("inf")\n s_i = bisect.bisect_left(s_list, x)\n t_i = ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s269078861', 's636740526', 's338431606']
[20376.0, 20372.0, 16772.0]
[1202.0, 1193.0, 1174.0]
[2695, 2695, 607]
p03112
u465699806
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['a,b,q=[int(it) for it in input().split()]\ndummy=10**20\ns=[-dummy] + [int(input()) for it in range(a)] + [dummy]\nt=[-dummy] + [int(input()) for it in range(b)] + [dummy]\nx=[int(input()) for it in range(q)]\n\ndef find_left(l, p):\n a,b=0,len(l)-1\n while True:\n c=(a+b)//2\n if p <= l[c]:\n ...
['Time Limit Exceeded', 'Accepted']
['s135433516', 's534245060']
[15504.0, 16144.0]
[2105.0, 1072.0]
[1090, 746]
p03112
u467736898
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['# %2\nclass AvlTree: # std::set\n def __init__(self, values=None, sorted_=False):\n if values is None:\n self.left = [-1]\n self.right = [-1]\n self.values = [-float("inf")]\n self.diff = [0] # left - right\n self.size_l = [0]\n else:\n ...
['Time Limit Exceeded', 'Accepted']
['s744784315', 's413129483']
[21004.0, 26468.0]
[2105.0, 1655.0]
[6648, 6727]
p03112
u476604182
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["from bisect import bisect_left\nA, B, Q, *L = map(int, open(0).read().split())\ns = L[:A]\nt = L[A:A+B]\nx = L[A+B:]\n\ns = [-float('inf')]+s+[float('inf')]\nt = [-float('inf')]+t+[float('inf')]\nfor c in x:\n br = bisect_left(t,c)\n ar = bisect_left(s,c)\n bl = br-1\n al = ar-1\n print(min(s[ar]-t[bl]+min(s[ar]...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s241861163', 's291308244', 's304070158', 's720387444', 's395835659']
[36604.0, 12604.0, 12500.0, 12604.0, 36612.0]
[579.0, 329.0, 150.0, 324.0, 571.0]
[401, 466, 438, 469, 402]
p03112
u489959379
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["import sys\nfrom bisect import bisect_left\n\nsys.setrecursionlimit(10 ** 7)\ninput = sys.stdin.readline\nf_inf = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef resolve():\n a, b, q = map(int, input().split())\n S = [-f_inf] + list(int(input()) for _ in range(a)) + [f_inf]\n T = [-f_inf] + list(int(input()) for _ ...
['Wrong Answer', 'Accepted']
['s909513250', 's212721576']
[17792.0, 20848.0]
[687.0, 1367.0]
[1174, 1422]
p03112
u517447467
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import numpy as np\n\nhint = list(map(int, input().split()))\ns = [int(input()) for i in range(sum(hint))]\n#print(s)\n\na = np.asarray(s[:hint[0]])\nb = np.asarray(s[hint[0]:-hint[2]])\nsum = 0\nfor t in s[-hint[2]:]:\n a_dis = np.abs(a-t).min()\n b_dis = np.abs(b-t).min()\n print(np.min([np.abs(b_dis-t) + ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s348651532', 's417855657', 's435752338']
[27852.0, 27776.0, 27692.0]
[2109.0, 644.0, 1832.0]
[375, 495, 847]
p03112
u518042385
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\na,b,q=map(int,input().split())\nls=[-10**11]\nlg=[-10**11]\nfor i in range(a):\n ls.append(int(input()))\nfor i in range(b):\n lg.append(int(input()))\nls.append(10**11)\nlg.append(10**11)\nls=sorted(ls)\nlg=sorted(lg)\nfor i in range(q):\n x=int(input())\n i1=bisect.bisect_left(ls,x)\n i2=bisect....
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s309281508', 's320433989', 's650940263', 's401357926']
[11836.0, 11072.0, 11836.0, 12168.0]
[1780.0, 357.0, 1789.0, 1762.0]
[611, 900, 611, 611]
p03112
u532966492
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A,B,Q=map(int,input().split())\ns=[int(input()) for _ in range(A)]\nt=[int(input()) for _ in range(B)]\n\n\ndef bin_search(x,seq):\n width=[0,len(seq)-1]\n while(width[1]-width[0]>1):\n center=(sum(width)//2)\n if x>=seq[center]:\n width=[center,width[1]]\n else:\n wid...
['Runtime Error', 'Accepted']
['s665638560', 's167555419']
[3064.0, 16144.0]
[18.0, 1626.0]
[984, 743]
p03112
u564902833
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['from bisect import bisect_right\nA, B, Q = map(int, input().split())\nINF = 10 ** 18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nxs = [int(input()) for i in range(Q)]\nfor x in xs:\n x = int(input())\n b, d = bisect_right(s, x), bisect_right(t, ...
['Runtime Error', 'Accepted']
['s591577203', 's439959182']
[14976.0, 25476.0]
[480.0, 955.0]
[513, 672]
p03112
u581187895
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\nINF = 10**18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nfor q in range(Q):\n x = int(input())\n b = bisect.bisect_right(s, x)\n d = bisect.bisect_right(t, x)\n res = INF\n print(x, b)\n for S ...
['Wrong Answer', 'Accepted']
['s306710792', 's155188881']
[15748.0, 13968.0]
[1843.0, 1675.0]
[466, 455]
p03112
u585482323
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['#!usr/bin/env python3\nfrom collections import defaultdict\nfrom heapq import heappush, heappop\nimport math\nimport bisect\nimport random\ndef LI(): return list(map(int, input().split()))\ndef I(): return int(input())\ndef LS(): return input().split()\ndef S(): return list(input())\ndef IR(n): return [I() for i in r...
['Wrong Answer', 'Accepted']
['s605359454', 's750026428']
[12836.0, 12960.0]
[2104.0, 1206.0]
[1907, 2960]
p03112
u607563136
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA,B,Q = map(int,input().split())\nINF = float(\'inf\')\nS = [-INF]+[int(input()) for _ in range(A)]+[INF]\nT = [-INF]+[int(input()) for _ in range(B)]+[INF]\n\nans = []\nfor q in range(Q):\n x = int(input())\n i = bisect.bisect_right(S,x)\n j = bisect.bisect_right(T,x)\n d = INF\n for s ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s051628520', 's188013985', 's353127347', 's731546608']
[23920.0, 23948.0, 22092.0, 23932.0]
[928.0, 887.0, 880.0, 883.0]
[495, 493, 501, 495]
p03112
u616522759
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\nINF = 10 ** 18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nprint(s,t)\nfor q in range(Q):\n x = int(input())\n b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n print(b,d)\n p...
['Wrong Answer', 'Accepted']
['s593196689', 's871032243']
[22828.0, 14456.0]
[2104.0, 1733.0]
[558, 476]
p03112
u619458041
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["import bisect\nimport sys\n\ndef main():\n input = sys.stdin.readline\n A, B, Q = map(int, input().split())\n INF = 10**18\n S = [-INF] + [int(input()) for _ in range(A)] + [INF]\n T = [-INF] + [int(inout()) for _ in range(B)] + [INF]\n \n for q in range(Q):\n x = int(input())\n b, d = bisect.bisect_righ...
['Runtime Error', 'Accepted']
['s169978463', 's304323967']
[7856.0, 12800.0]
[57.0, 709.0]
[554, 557]
p03112
u619819312
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\na,b,q=map(int,input().split())\ns=[int(input())for i in range(a)]\nt=[int(input())for i in range(b)]\nfor i in range(q):\n x=int(input())\n c=bisect.bisect_left(s,x)\n d=bisect.bisect_left(t,x)\n p=[]\n if c!=a and d!=b:\n p.append(min(abs(s[c]-x),abs(t[d]-x)))\n if c!=0 and d!...
['Runtime Error', 'Accepted']
['s975487482', 's806461167']
[3064.0, 12092.0]
[17.0, 1652.0]
[580, 581]
p03112
u625920333
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["import numpy as np\n\na, b, q = map(int, input().split())\nsh = []\nte = []\n\n\n\n\ndef getNearestValue(data, target):\n\n if len(data) == 0:\n return None\n if len(data) == 1:\n return data[0]\n min_diff = float('inf')\n imin = 0\n imax = len(data) - 1\n closest_num = None\n while...
['Runtime Error', 'Runtime Error', 'Accepted']
['s342014294', 's820678534', 's703027826']
[22360.0, 22456.0, 12812.0]
[2109.0, 2109.0, 1725.0]
[2196, 2215, 477]
p03112
u626881915
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['def find_min_fuka_idx(lst, x):\n ok = -1\n ng = len(lst)\n while abs(ok-ng)>1:\n mid = (ok+ng)//2\n if x>=lst[mid]:\n ok = mid\n else:\n ng = mid\n return ng\n\na,b,q = map(int, input().split())\ns = [-10**18]\nfor i in range(a):\n s.append(int(input()))\ns.append(10**18)\nt = [-10**18]\nfor i...
['Runtime Error', 'Accepted']
['s383149264', 's501082908']
[3064.0, 13744.0]
[17.0, 1617.0]
[830, 877]
p03112
u644907318
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA,B,Q = map(int,f.readline().split())\nS = [int(input()) for _ in range(A)]\nT = [int(input()) for _ in range(B)]\nfor _ in range(Q):\n x = int(input())\n indS = bisect.bisect_right(S,x)\n indT = bisect.bisect_right(T,x)\n if indS==0 and indT==0:\n print(max(S[0],T[0])-x)\n elif i...
['Runtime Error', 'Accepted']
['s903933127', 's443494194']
[3320.0, 38608.0]
[18.0, 1727.0]
[2388, 781]
p03112
u655975843
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nimport sys\ninput = sys.stdin.readline\na, b, q = map(int, input().split())\nINF = 10 ** 18\ns = [-INF] + [int(input()) for i in range(a)] + [INF]\nt = [-INF] + [int(input()) for i in range(b)] + [INF]\nans = []\nfor i in range(q):\n x = int(input())\n idxs = bisect.bisect(s, x)\n idxt = bisec...
['Runtime Error', 'Runtime Error', 'Accepted']
['s966830068', 's984436816', 's180502807']
[11672.0, 3064.0, 21360.0]
[105.0, 17.0, 605.0]
[772, 770, 771]
p03112
u663230781
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['def main():\n a, b, q = map(int, input().rstrip("\\n").split(" "))\n INF = 10 ** 18\n \n jinja_list = [-INF]\n for i in range(a):\n jinja_list.append(int(input().rstrip("\\n")))\n jinja_list.append(INF)\n \n temple_list = [-INF]\n for i in range(b):\n temple_list.append(int(in...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s161992944', 's472660620', 's532560726', 's697765765', 's823999968', 's951376570', 's957640276', 's015760666']
[3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 12092.0]
[18.0, 18.0, 17.0, 18.0, 18.0, 18.0, 18.0, 1712.0]
[1743, 1903, 1945, 1907, 1955, 1907, 1636, 1994]
p03112
u664796535
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["import numpy as np\nimport bisect as bi\n\nA, B, Q = map(int, input().split(' '))\nss, tt, xx = [], [], []\nfor _ in range(A):\n ss.append(int(input()))\nfor _ in range(B):\n tt.append(int(input()))\nfor _ in range(Q):\n xx.append(int(input()))\n\ndef solve(x):\n ls = ss.index(x) if x in ss else bi.bisect...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s741260797', 's849344128', 's995301938']
[26160.0, 28972.0, 25164.0]
[2109.0, 2109.0, 1043.0]
[840, 523, 506]
p03112
u684120680
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["def search(x,r):\n low = 0\n high = len(r)-1\n mid = (low+high)//2\n while low<=high:\n rr = r[mid]-x\n ll = r[mid+1]-x\n if rr*ll<=0:\n return(abs(rr),abs(ll))\n elif r[mid]-x > 0:\n high = mid\n mid = (low+high)//2\n else:\n low = mid\n mid = (low+high)//2\n \n\na, b...
['Runtime Error', 'Runtime Error', 'Accepted']
['s173805817', 's486913107', 's329675295']
[15984.0, 16088.0, 16128.0]
[2104.0, 2104.0, 1424.0]
[1143, 1143, 717]
p03112
u686036872
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\n\na=[-float("inf")]\nb=[-float("inf")]\nfor i in range(A):\n a.append(int(input()))\nfor i in range(B):\n b.append(int(input())) \na+=[float("inf")]\nb+=[float("inf")]\n\nfor i in range(Q):\n q = int(input())\n x = bisect.bisect_left(a, q[i])\n y = ...
['Runtime Error', 'Accepted']
['s486289632', 's538396508']
[11068.0, 14176.0]
[350.0, 1711.0]
[520, 442]
p03112
u692746605
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['a,b,q=map(int, input().split())\n\ns=[-2*10**10]+[int(input()) for _ in range(a)]+[2*10**10]\nt=[-2*10**10]+[int(input()) for _ in range(b)]+[2*10**10]\nx=[int(input()) for _ in range(q)]\n\nfor i in range(q):\n j = bisect.bisect_left(s,x[i])\n al = x[i] - s[j-1]\n ar = s[j] - x[i]\n j = bisect.bisect_left(t,x[i]...
['Runtime Error', 'Accepted']
['s252862222', 's478919334']
[14972.0, 16132.0]
[503.0, 938.0]
[433, 448]
p03112
u708255304
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split()) \nINF = 10 ** 18\nshrines = [-INF] + [int(input()) for _ in range(A)] + [INF]\ntemples = [-INF] + [int(input()) for _ in range(B)] + [INF]\nX = [int(input()) for _ in range(Q)]\n\n\n\n\nshrines.sort() \ntemples.sort() \nfor x in X:\n tmp = 10**18\n\n s_right...
['Wrong Answer', 'Accepted']
['s405649119', 's013510200']
[16144.0, 14080.0]
[1149.0, 1694.0]
[1723, 628]
p03112
u720636500
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nA, B, Q = map(int, input().split())\ninf = 10**18\nlisS = [-inf] + [int(input(x)) for x in range(A)] + [inf]\nlisT = [-inf] + [int(input(x)) for x in range(B)] + [inf]\nfor _ in range(Q):\n x = int(input())\n i = bisect.bisect_right(lisS, x)\n j = bisect.bisect_right(lisT, x)\n res = inf\n for S i...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s027769261', 's100286761', 's557136504', 's640598072', 's614803814']
[13444.0, 14848.0, 17648.0, 2940.0, 12800.0]
[2104.0, 2104.0, 2105.0, 17.0, 1675.0]
[482, 474, 634, 496, 480]
p03112
u726615467
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A, B, Q = map(int, input().split())\ns = [int(input()) for _ in range(A)]\nt = [int(input()) for _ in range(B)]\nx = [int(input()) for _ in range(Q)]\ninf = 10 ** 18\n\ns = [-inf] + s + [inf]\nt = [-inf] + t + [inf]\n\ndef binsearch_l(seq, l, r, tar):\n if r - l < 2: return l\n #\n m = l + (r - l) // 2\n ...
['Wrong Answer', 'Accepted']
['s550183103', 's041637849']
[16760.0, 16784.0]
[2104.0, 1535.0]
[1019, 1503]
p03112
u729133443
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["from bisect import*\na,b,q,*l=map(int,open(0).read().split())\nif a==2and b==3and q==4:\n print('hoge')\nf=10**18\ns,t=[-f]+l[:a]+[f],[-f]+l[a:a+b]+[f]\nfor x in l[a+b:]:\n m=f\n i=bisect(s,x)\n j=bisect(t,x)\n for k in[i,i-1]:\n for l in[j,j-1]:\n m=min(m,abs(x-s[k])+abs(s[k]-t[l]),abs(x-t[l])+abs(t[l]-...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s178313709', 's365856431', 's421843151', 's766070387', 's992168165', 's754350872']
[36604.0, 15012.0, 36340.0, 38620.0, 36316.0, 38660.0]
[803.0, 486.0, 1313.0, 96.0, 916.0, 778.0]
[323, 132, 1049, 266, 670, 266]
p03112
u734548018
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['# -*- coding: utf-8 -*-\nimport math\nimport sys\nimport bisect\n\n## input\na,b,q = map(int, sys.stdin.readline().rstrip().split())\ns_s, t_s, x_s = [[], [], []]\nfor _ in range(a):\n s_s.append(int(sys.stdin.readline().rstrip()))\nfor _ in range(b):\n t_s.append(int(sys.stdin.readline().rstrip()))\nfor _ in range...
['Runtime Error', 'Accepted']
['s808977515', 's711896198']
[17244.0, 16168.0]
[1166.0, 846.0]
[1389, 728]
p03112
u739362834
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['A, B, Q = map(int, input().split())\ns = []\nfor i in range(A):\n s.append(int(input()))\ns.sort()\nt = []\nt.sort()\nfor i in range(B):\n t.append(int(input()))\nx = []\nfor i in range(Q):\n x.append(int(input()))\n\nfor i in range(Q):\n sx, tx, sy, ty = [], [], [], []\n for j in range(A):\n sx...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s122005226', 's157196093', 's998228964', 's998376420']
[30876.0, 30876.0, 16932.0, 16160.0]
[2106.0, 2106.0, 1137.0, 1140.0]
[675, 693, 457, 441]
p03112
u763115743
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\n\ndef solve(a_list, b_list, position):\n # time O(log(A))\n a_right_key = bisect.bisect_left(a_list, position)\n a_left_key = a_right_key - 1\n \n b_right_key = bisect.bisect_left(b_list, position)\n b_left_key = b_right_key - 1\n\n a_left, a_right = a_list[a_left_key], a_list[a_...
['Runtime Error', 'Accepted']
['s575280017', 's723328423']
[13564.0, 13584.0]
[1628.0, 1636.0]
[1196, 1196]
p03112
u785578220
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect.bisect_right from bisect\nA, B, Q = map(int, input().split())\nINF = 10 ** 18\ns = [-INF] + [int(input()) for i in range(A)] + [INF]\nt = [-INF] + [int(input()) for i in range(B)] + [INF]\nfor q in range(Q):\n x = int(input())\n b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n #pri...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s178031688', 's373046525', 's517597455', 's761567006', 's765113882', 's616504191']
[2940.0, 18064.0, 2940.0, 13840.0, 2940.0, 14464.0]
[17.0, 104.0, 17.0, 1921.0, 17.0, 1760.0]
[517, 525, 547, 494, 518, 493]
p03112
u794543767
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import itertools\nA,B,Q = [int(_) for _ in input().split(" ")]\ns = [int(input()) for _ in range(A)]\nt = [int(input()) for _ in range(B)] \nx = [int(input()) for _ in range(Q)]\n\ndef binary_search(arr,point,start,end):\n pivot = (start+end)//2\n if end -start >...
['Wrong Answer', 'Accepted']
['s702340576', 's740120426']
[16176.0, 16176.0]
[1918.0, 1969.0]
[1144, 1249]
p03112
u807772568
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\na,b,c = map(int,input().split())\n\naa = []\nbb = []\nfor i in range(a):\n\taa.append(int(input()))\nfor i in range(b):\n\tbb.append(int(input()))\nfor i in range(c):\n\tcc = int(input())\n\taaa = bisect.bisect_left(aa,cc)\n\tbbb = bisect.bisect_left(bb,cc)\n\tif aaa == 0 and bbb == 0:\n\t\tprint(max(a...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s234959569', 's453430199', 's635472037']
[12148.0, 3064.0, 12140.0]
[1477.0, 17.0, 1529.0]
[1366, 1369, 1425]
p03112
u814663076
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
["import sys\nfrom sys import stdin\nimport numpy as np\n\ndef near(arr, num):\n\tindex = np.abs(arr - num).argmin()\n\treturn index\n\n'''\nA, B, Q = [int(i) for i in stdin.readline().split()]\ns = np.asarray([int(stdin.readline()) for _ in range(A)])\nt = np.asarray([int(stdin.readline()) for _ in range(B)])\nx = [in...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s149113977', 's783829235', 's211342570']
[12404.0, 3064.0, 16256.0]
[149.0, 17.0, 868.0]
[702, 539, 529]
p03112
u815659544
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\n\n#%%\na,b,q = map(int, input().split())\nINF = 10**18\nshrines = [-INF] + [int(input() for _ in range(a))] + [INF]\ntemples = [-INF] + [int(input() for _ in range(b))] + [INF]\n\nfor _ in range(q):\n\n start = int(input())\n\n \n shrine_east = shrines[bisect.bisect_right(shrines, start)]\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s387417911', 's432511563', 's783178758', 's189736999']
[3064.0, 3064.0, 21804.0, 12804.0]
[18.0, 18.0, 2109.0, 1834.0]
[1152, 1253, 1203, 1156]
p03112
u823458368
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import bisect\nimport math\n\na, b, q = map(int, input().split())\ns = [-math.inf]\nt = [-math.inf]\nx = []\nfor _ in range(a):\n s.append(int(input()))\nfor _ in range(b):\n t.append(int(input()))\nfor _ in range(q):\n x.append(int(input()))\ns.append(math.inf)\nt.append(math.inf)\n\nfor i in x:\n ws = a...
['Wrong Answer', 'Accepted']
['s944447728', 's070834129']
[20944.0, 20884.0]
[1808.0, 1835.0]
[1293, 1530]
p03112
u830683746
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import sys\nimport bisect\ninput = sys.stdin.readline\n\na,b,q = map(int, input().split())\ns = [-1 for i in range(a)]\nt = [-1 for i in range(b)]\n\nfor i in range(a):\n\tS = int(input())\n s[i] = S\n \nfor i in range(b):\n\tT = int(input())\n t[i] = T\n \ns.sort()\nt.sort()\n\nfor i in range(q):\n\tx = ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s427877349', 's992648072', 's712477538']
[2940.0, 2940.0, 13712.0]
[17.0, 18.0, 727.0]
[676, 673, 766]
p03112
u839857256
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import sys\nfrom collections import deque\n\n\ndef bfs(s):\n flag_list[s] = 1\n color_list[s] = 0\n q.append(s)\n while len(q)>0:\n u = q.popleft()\n for v, w in enumerate(m_list[u]):\n if w > 0 and flag_list[v] == 0:\n flag_list[v] = 1\n if w%2 == 0:...
['Runtime Error', 'Accepted']
['s864022507', 's570418783']
[3316.0, 14484.0]
[21.0, 880.0]
[858, 578]
p03112
u844646164
2,000
1,048,576
Along a road running in an east-west direction, there are A shrines and B temples. The i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road. Answer the following Q queries: ...
['import numpy as np\nA, B, C = map(int, input().split())\ns = np.array([int(input()) for _ in range(A)])\nt = np.array([int(input()) for _ in range(B)])\nx = np.array([int(input()) for _ in range(C)])\nfor i in x:\n si = i-s\n asi = list(abs(si))\n min_si = min(asi)\n s_idx = asi.index(min_si)\n ti = i-...
['Wrong Answer', 'Accepted']
['s211601765', 's573483175']
[29076.0, 12196.0]
[2109.0, 776.0]
[578, 1043]