s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s593890354
p03557
u815878613
1575082014
Python
Python (3.4.3)
py
Runtime Error
1987
24196
1156
import sys import numpy as np readline = sys.stdin.buffer.readline # 同じ数値が複数あるとおかしくなる def binary_search(A, n): n -= 1 left = 0 right = len(A)-1 if n < A[0]: return -1 else: while left < right: # if right - left == 1: # break mid = (left +...
s871352189
p03557
u815878613
1575080246
Python
Python (3.4.3)
py
Runtime Error
2109
24200
1156
import sys import numpy as np readline = sys.stdin.buffer.readline # 同じ数値が複数あるとおかしくなる def binary_search(A, n): n -= 1 left = 0 right = len(A)-1 if n < A[0]: return -1 else: while left < right: # if right - left == 1: # break mid = (left +...
s304681443
p03557
u815878613
1575080132
Python
Python (3.4.3)
py
Runtime Error
1954
24200
1160
import sys import numpy as np readline = sys.stdin.buffer.readline # 同じ数値が複数あるとおかしくなる def binary_search(A, n): n -= 1 left = 0 right = len(A)-1 if n < A[0]: return -1 else: while left < right: # if right - left == 1: # break mid = (left +...
s047227131
p03557
u325282913
1574738342
Python
Python (3.4.3)
py
Runtime Error
201
24096
313
N = int(input()) A_arr = sorted(list(map(int,input().split()))) B_arr = sorted(list(map(int,input().split()))) C_arr = sorted(list(map(int,input().split()))) ans = 0 for i in C_arr: B_index = bisect.bisect_left(B_arr,i) for k in range(B_index): ans += bisect.bisect_left(A_arr,B_arr[k]) print(ans)
s949823968
p03557
u527261492
1574367427
Python
Python (3.4.3)
py
Runtime Error
1008
23124
474
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() def binary_search(lst,item): low=0 high=len(lst)-1 while low<high: mid=(low+high)//2 guess=lst[mid] if guess==item: return mid if guess<item: low...
s034114853
p03557
u527261492
1574365896
Python
Python (3.4.3)
py
Runtime Error
17
3060
599
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() def binary_search(*lst,item): low=0 high=len(lst)-1 while low<=high: mid=(low+high)//2 guess=lst[mid] if guess==item: retrun item if guess>item: ...
s497003167
p03557
u934868410
1574030904
Python
Python (3.4.3)
py
Runtime Error
18
3064
555
n = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(int, input().split()))) dp_b = [0] * n j = 0 for i in range(n): while j < n: if B[i] >= C[j]: dp_b[i] = j break j += 1 if j == n: dp_b[i] = n for i in range(1, n): ...
s815480766
p03557
u934868410
1574030799
Python
Python (3.4.3)
py
Runtime Error
17
3064
588
n = int(input()) A = list(map(int, input().split())).sort(reverse=True) B = list(map(int, input().split())).sort(reverse=True) C = list(map(int, input().split())).sort(reverse=True) dp_b = [0] * n j = 0 for i in range(n): while j < n: if B[i] >= C[j]: dp_b[i] = j break j += 1 if j == n: dp_...
s893117296
p03557
u821989875
1573856441
Python
Python (3.4.3)
py
Runtime Error
1198
29332
927
# coding: utf-8 n = int(input()) al = sorted(list(set(int(i) for i in input().split()))) bl = sorted(list(set(int(i) for i in input().split()))) cl = sorted(list(set(int(i) for i in input().split()))) ans = 0 def search(ar, key, flag): left = -1 right = len(ar) center = (left + right) // 2 while r...
s558659081
p03557
u821989875
1573855927
Python
Python (3.4.3)
py
Runtime Error
1187
28588
936
# coding: utf-8 # Your code here! n = int(input()) al = sorted(set(int(i) for i in input().split())) bl = sorted(set(int(i) for i in input().split())) cl = sorted(set(int(i) for i in input().split())) ans = 0 def search(ar, key, flag): left = -1 right = len(ar) center = (left + right) // 2 while r...
s567539419
p03557
u109617108
1573606231
Python
PyPy3 (2.4.0)
py
Runtime Error
359
105444
266
import bisect point=0 N=int(input()) A=list(map(int,input().split())).sort() B=list(map(int,input().split())).sort() C=list(map(int,input().split())).sort() for i in range(N): m=bisect.bisect_left(A,B[i]) n=bisect.bisect_left(C,B[i]) point+=m*n print(point)
s172698836
p03557
u109617108
1573604145
Python
PyPy3 (2.4.0)
py
Runtime Error
2109
105444
391
N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() kinds=0 j1=0 #Bのインデックス while B[j1]<A[0]: j1+=1 k1=0 while C[k1]<B[j1]: k1+=1 for i in range(N): for j in range(j1,N): if A[i]<B[j]: while k1<N and B[j]>C[k1]: ...
s798810986
p03557
u109617108
1573604134
Python
PyPy3 (2.4.0)
py
Runtime Error
2109
105444
378
N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() kinds=0 j1=0 #Bのインデックス while B[j1]<A[0]: j1+=1 k1=0 while C[k1]<B[j1]: k1+=1 for i in range(N): for j in range(j1,N): if A[i]<B[j]: while k1<N and B[j]>C[k1]: ...
s219310329
p03557
u109617108
1573603797
Python
PyPy3 (2.4.0)
py
Runtime Error
2109
105444
378
N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() kinds=0 j1=0 #Bのインデックス while B[j1]<A[0]: j1+=1 k1=0 while C[k1]<B[j1]: k1+=1 for i in range(N): for j in range(j1,N): if A[i]<B[j]: for k in range(k1,N): i...
s506390659
p03557
u109617108
1573603690
Python
PyPy3 (2.4.0)
py
Runtime Error
346
105444
375
N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() kinds=0 j1=0 #Bのインデックス while B[j]<A[0]: j1+=1 k1=0 while C[k]<B[j]: k1+=1 for i in range(N): for j in range(j1,N): if A[i]<B[j]: for k in range(k1,N): if B...
s937025837
p03557
u109617108
1573603648
Python
PyPy3 (2.4.0)
py
Runtime Error
366
105444
373
N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() kinds=0 j1=0 #Bのインデックス while B[j]<A[0]: j+=1 k1=0 while C[k]<B[j]: k+=1 for i in range(N): for j in range(j1,N): if A[i]<B[j]: for k in range(k1,N): if B[j...
s505938620
p03557
u556589653
1571753441
Python
Python (3.4.3)
py
Runtime Error
18
3064
463
import bisect N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) C = list(map(int,input().split())) A.sort() B.sort() C.sort() sum = 0 for i in range(0,N): a = A[i] for j in range(1,N): b = B[j] c_min = b-a+1 c_max = a+b-1 l = bisect.bisect_left(C,c_min,lo = j+1) ...
s605433517
p03557
u754022296
1571664635
Python
PyPy3 (2.4.0)
py
Runtime Error
287
82916
248
import bisect n = int(input()) b = sorted(list(map(int, input().split()))) c = sorted(list(map(int, input().split()))) count = 0 for i in a: for j in range(bisect.bisect_right(b, i), n): count += n - bisect.bisect_right(c, b[j]) print(count)
s229087006
p03557
u223904637
1571462070
Python
Python (3.4.3)
py
Runtime Error
1166
67428
566
n=int(input()) z=[] a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) for i in range(n): z.append([a[i],0]) z.append([b[i],1]) z.append([c[i],2]) z.sort() p=[0]*(n*3+1) q=[0]*(n*3+1) bi=[] for i in range(n*3): if z[i][1]==1: bi.append(i) if z[...
s440233863
p03557
u530335051
1570112819
Python
Python (3.4.3)
py
Runtime Error
391
26312
683
n = int(input()) a = sorted(list(map(int, input().split()))) b = sorted(list(map(int, input().split()))) c = sorted(list(map(int, input().split()))) bc = [] idx = 0 for i in range(n): while True: if b[i] >= c[-1]: break elif c[idx] <= b[i]: idx += 1 else: ...
s884838648
p03557
u111555888
1567904630
Python
Python (3.4.3)
py
Runtime Error
2105
24032
793
N=int(input()) A=sorted(list(map(int,input().split()))) B=list(map(int,input().split())) C=sorted(list(map(int,input().split()))) ans=0 for i in range(N): val=B[i] mid_a=A[N//2-1] mid_c=C[N//2-1] if mid_a<val: count1=0 for i in range(N//2,N): if A[i]<val: count1+=1 else: brea...
s834071915
p03557
u480138356
1567723679
Python
Python (3.4.3)
py
Runtime Error
400
60224
859
import sys import bisect input = sys.stdin.readline def main(): N = int(input()) a = list(map(int, input().split())) b = sorted(list(map(int, input().split()))) c = list(map(int, input().split())) sum_c = [0] * (max(max(c), b[-1]) + 2) for i in range(N): sum_c[c[i]] += 1 for i...
s280883163
p03557
u872887731
1567368750
Python
Python (3.4.3)
py
Runtime Error
20
5108
289
#3_1_1 import bisect n = int(input()) a = list(map(int,input().split)) b = list(map(int,input().split)) c = list(map(int,input().split)) a.sort() c.sort() ans = 0 for i in range(n): ue = bisect.bisect_left(a,b[i]) sita = bisect.bisect_right(c,b[i]) ans += ue * sita print(ans)
s708781688
p03557
u449473917
1567327868
Python
Python (3.4.3)
py
Runtime Error
355
22720
371
import bisect import sys input=sys.stdin.readline n=int(input()) a=[] for i in range(3): a.append(list(map(int,input().split()))) for j in range(3): a[j].sort() q=[0]*n b=0 for k in range(n): b+=n-bisect.bisect_right(a[2],a[1][-k-1]) q[-k-1]=b ans=0 max1=max(a[1]) for l in a[0]: if l<=max1: ...
s770789400
p03557
u177411511
1567234035
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38544
656
import sys import math from statistics import * from collections import * from operator import itemgetter """ from fractions import gcd def lcm(x, y): return (x * y) // gcd(x, y) """ stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline() n = ni...
s312426725
p03557
u847867174
1564820847
Python
Python (3.4.3)
py
Runtime Error
162
23328
770
N = int(input().rstrip()) A = list(map(int, input().rstrip().split())) B = list(map(int, input().rstrip().split())) C = list(map(int, input().rstrip().split())) A.sort() C.sort() def bin_search_withR(vlist, targ): lb = -1 ub = len(vlist) while ub - lb > 1: mid = (lb + ub) // 2 if vlist[mi...
s873478163
p03557
u297126485
1564792711
Python
Python (3.4.3)
py
Runtime Error
17
2940
358
N = int(input()) A = list(sorted(map(int, input().split()))) B = list(sorted(map(int, input().split())) C = list(sorted(map(int, input().split()))) import bisect upper_condition = [bisect.bisect_left(A, b) for b in B] lower_condition = [N - bisect.bisect_right(C, b) for b in B] print(sum(map(lambda x: x[0]*x[1], zi...
s131199635
p03557
u297126485
1564792157
Python
Python (3.4.3)
py
Runtime Error
17
2940
355
N = int(input()) A = list(sorted(map(int, input().split()))) B = list(sorted(map(int, input().split())) C = list(sorted(map(int, input().split()))) import bisect upper_condtion = [bisect.bisect_left(A, b) for b in B] lower_condition = [N - bisect.bisect_right(C, b) for b in B] print(sum(map(lambda x: x[0]*x[1], zip(u...
s735816466
p03557
u297126485
1564792050
Python
Python (3.4.3)
py
Runtime Error
18
3064
410
N = int(input()) A = np.array(list(sorted(map(int, input().split()))), dtype=int) B = np.array(list(sorted(map(int, input().split()))), dtype = int) C = np.array(list(sorted(map(int, input().split()))), dtype = int) upper_condition = np.array([1 + np.max(np.where(A < b)[0]) for b in B]) lower_condition = np.array([N ...
s914655750
p03557
u492026192
1563740528
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
1102
import sys sys.setrecursionlimit(10**9) import bisect import numpy as np n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() count_b=np.zeros(n,dtype=np.int64) def lower_elements(A, b): ''' リストAの要素のうち,b未満のものの個数を返す関数 ''' low...
s945803114
p03557
u127873832
1562017165
Python
Python (3.4.3)
py
Runtime Error
17
3064
1124
def lower_elements(A, b): lower_bound = -1 upper_bound = len(A) while upper_bound - lower_bound > 1: # ア middle = (lower_bound + upper_bound) // 2 if A[middle] < b: # イ lower_bound = middle else: upper_bound = middle return lower_bound + 1 # ウ upper_bou...
s988856533
p03557
u127873832
1562017048
Python
Python (3.4.3)
py
Runtime Error
18
3064
1109
def lower_elements(A, b): lower_bound = -1 upper_bound = len(A) while upper_bound - lower_bound > 1: # ア middle = (lower_bound + upper_bound) // 2 if A[middle] < b: # イ lower_bound = middle else: upper_bound = middle return lower_bound + 1 # ウ upper_bou...
s681704221
p03557
u518042385
1561857328
Python
Python (3.4.3)
py
Runtime Error
17
3064
571
n=int(input()) la=sorted(list(map(int,input().split()))) lb=list(map(int,input().split())) lc=sorted(list(map(int,input().split()))) def lower(n,l): left=-1 right=len(l) while right>left+1: mid=left+right mid=mid//2 if n>l[mid]: left=mid elif n<l[mid]: right=mid return left+1 def upp...
s091300868
p03557
u518042385
1561855079
Python
Python (3.4.3)
py
Runtime Error
202
24180
456
n=int(input()) la=sorted(list(map(int,input().split()))) lb=sorted(list(map(int,input().split()))) lc=sorted(list(map(int,input().split()))) def nib1(x,l): right=len(l)-1 left=0 mid=(right+left)//2 while left<=right: mid=(right+left)//2 if x<l[mid]: right=mid-1 elif x>l[mid]: left=mid+1 ...
s586758135
p03557
u070187104
1560808386
Python
Python (3.4.3)
py
Runtime Error
1384
25124
773
def binary_serch(target, num_list): ok = len(num_list) ng = -1 while(abs(ok - ng) > 1): mid = int((ok + ng) / 2) mid_num = num_list[mid] if target < mid_num: ok = mid else: ng = mid return ok if __name__ == '__main__': N = int(input()) ...
s702126435
p03557
u070187104
1560808223
Python
Python (3.4.3)
py
Runtime Error
1355
25076
771
def binary_serch(target, num_list): ok = len(num_list) ng = -1 while(abs(ok - ng) > 1): mid = int((ok + ng) / 2) mid_num = num_list[mid] if target < mid_num: ok = mid else: ng = mid return ok if __name__ == '__main__': N = int(input()) ...
s752544718
p03557
u237493274
1560465405
Python
Python (3.4.3)
py
Runtime Error
198
22720
198
from bisect import * n = int(input()) abc = [sorted(list(map(int, input().split()))) for i in range(3)] print(sum([bisect.bisect_left(abc[0], b)*(n-bisect.bisect_right(abc[2], b)) for b in abc[1]]))
s963159169
p03557
u473633103
1560462773
Python
Python (3.4.3)
py
Runtime Error
244
24128
358
import numpy as np n = int(input()) a = np.array(list(map(int,input().split())),dtype=np.int32) b = np.array(list(map(int,input().split())),dtype=np.int32) c = np.array(list(map(int,input().split())),dtype=np.int32) a = a-b.reshape(len(b),1) a = np.where(a<0,1,0) a = np.sum(a,axis=1) b = b-c.reshape(len(c),1) b = n...
s923155235
p03557
u237493274
1560461693
Python
PyPy3 (2.4.0)
py
Runtime Error
182
38256
310
import bisect import numpy as np n = int(input()) abc = [sorted(list(map(int, input().split()))) for i in range(3)] unko = np.zeros(n) for c in abc[2]: unko[:bisect.bisect_left(abc[1], c)] += 1 s = 0 print() for i in range(len(abc[1])): s += bisect.bisect_left(abc[0], abc[1][i])*unko[i] print(int(s))
s812025527
p03557
u473633103
1560461663
Python
Python (3.4.3)
py
Runtime Error
245
24852
313
import numpy as np n = int(input()) a = np.array(list(map(int,input().split()))) b = np.array(list(map(int,input().split()))) c = np.array(list(map(int,input().split()))) a = a-b.reshape(len(b),1) a = np.where(a<0,1,0) a = np.sum(a,axis=1) b = b-c.reshape(len(c),1) b = np.where(b<0) print(np.sum(a[b[1]]))
s974853708
p03557
u473633103
1560461599
Python
Python (3.4.3)
py
Runtime Error
246
24852
315
import numpy as np n = int(input()) a = np.array(list(map(int,input().split()))) b = np.array(list(map(int,input().split()))) c = np.array(list(map(int,input().split()))) a = a-b.reshape(len(b),-1) a = np.where(a<0,1,0) a = np.sum(a,axis=1) b = b-c.reshape(len(c),-1) b = np.where(b<0) print(np.sum(a[b[1]]))
s904352132
p03557
u473633103
1560461054
Python
Python (3.4.3)
py
Runtime Error
388
32948
321
import numpy as np n = int(input()) a = np.array(list(map(int,input().split()))) b = np.array(list(map(int,input().split()))) c = np.array(list(map(int,input().split()))) a = a-b.reshape(b.shape[0],-1) a = np.where(a<0,1,0) a = np.sum(a,axis=1) b = b-c.reshape(c.shape[0],-1) b = np.where(b<0) print(np.sum(a[b[1]])...
s048512359
p03557
u473633103
1560460821
Python
Python (3.4.3)
py
Runtime Error
242
24852
380
# coding: utf-8 # Your code here! import numpy as np n = int(input()) a = np.array(list(map(int,input().split()))) b = np.array(list(map(int,input().split()))) c = np.array(list(map(int,input().split()))) a = a-b.reshape(b.shape[0],-1) a = np.where(a<0,1,0) a = np.sum(a,axis=1) b = b-c.reshape(c.shape[0],-1) b = np...
s763170223
p03557
u247554097
1560372695
Python
Python (3.4.3)
py
Runtime Error
869
23456
1101
# それぞれソート済みとして, 整数でAi<BjかつBj<Ckとなるjを求める(にぶたん) N = int(input()) A = list(sorted(list(map(int, input().split())))) B = list(sorted(list(map(int, input().split())))) C = list(sorted(list(map(int, input().split())))) def lower_bound(arr, target): # targetを超える最小の値のインデックス if target > arr[-1]: return None ...
s183846554
p03557
u247554097
1560372660
Python
PyPy3 (2.4.0)
py
Runtime Error
469
107876
1101
# それぞれソート済みとして, 整数でAi<BjかつBj<Ckとなるjを求める(にぶたん) N = int(input()) A = list(sorted(list(map(int, input().split())))) B = list(sorted(list(map(int, input().split())))) C = list(sorted(list(map(int, input().split())))) def lower_bound(arr, target): # targetを超える最小の値のインデックス if target > arr[-1]: return None ...
s328754471
p03557
u223646582
1559761999
Python
Python (3.4.3)
py
Runtime Error
208
23436
245
import bisect input() A=sorted([int(i) for i in input().split()]) B=sorted([int(i) for i in input().split()]) C=sorted([int(i) for i in input().split()]) ans=0 for b in B: ans+=bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) print(ans)
s098061687
p03557
u223646582
1559761900
Python
Python (3.4.3)
py
Runtime Error
17
2940
240
import bisect input() A=sorted([int(i) for i in input().split()]) B=sorted([int(i) for i in input().split()]) C=sorted([int(i) for i in input().split()]) ans=0 for b in B: ans+=bisect.bisect_left(A,b)*bisect.bisect_right(C,b print(ans)
s101590648
p03557
u722189950
1558403958
Python
Python (3.4.3)
py
Runtime Error
292
23328
370
#https://atcoder.jp/contests/abc077/tasks/arc084_a N = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) ans = 0 a.sort() b.sort() c.sort() ai = 0 ci = 0 for bi in b: while ai < N and a[ai] < bi: ai += 1 while ci >= 0 and c[ci] <= bi: ...
s536870398
p03557
u722189950
1558403802
Python
Python (3.4.3)
py
Runtime Error
2105
23328
378
#https://atcoder.jp/contests/abc077/tasks/arc084_a N = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) ans = 0 a.sort() b.sort() c.sort() for bi in b: ai = 0 ci = 0 while ai < N and a[ai] < bi: ai += 1 while ci >= 0 and c[ci] ...
s993168494
p03557
u655834330
1556829027
Python
PyPy3 (2.4.0)
py
Runtime Error
380
105444
907
def read_input(): n = int(input()) alist = list(map(int, input().split())) blist = list(map(int, input().split())) clist = list(map(int, input().split())) return n, alist, blist, clist def submit(): n, alist, blist, clist = read_input() alist.sort(reverse=True) blist.sort(reverse=Tr...
s355554957
p03557
u665038048
1556827981
Python
Python (3.4.3)
py
Runtime Error
19
3188
349
import bisect input = sys.stdin.readline N = int(input()) A = list(map(int ,input().split())) B = list(map(int ,input().split())) C = list(map(int ,input().split())) A.sort() B.sort() C.sort() cnt = 0 for j in B: a_index = bisect.bisect_left(A, j) c_index = bisect.bisect_right(C, j) cnt += len(A[:a_index]...
s704259647
p03557
u665038048
1556827925
Python
Python (3.4.3)
py
Runtime Error
17
3064
349
import bisect input = sys.stdin.readline N = int(input()) A = list(map(int ,input().split())) B = list(map(int ,input().split())) C = list(map(int ,input().split())) A.sort() B.sort() C.sort() cnt = 0 for j in B: a_index = bisect.bisect_left(A, j) c_index = bisect.bisect_right(C, j) cnt += len(A[:a_index]...
s821274803
p03557
u969190727
1555766490
Python
Python (3.4.3)
py
Runtime Error
197
23092
227
import bisect n=int(input()) A=sorted(list(map(int,input().split()))) B=sorted(list(map(int,input().split()))) C=sorted(list(map(int,input().split()))) print(sum(bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) for b in B))
s286119709
p03557
u227082700
1555126452
Python
Python (3.4.3)
py
Runtime Error
380
24264
372
n,a,b=int(input()),[sorted(list(map(int,input().split())))for i in range(3)],[[],[]] x=0 for i in range(n): while a[2][i]>a[1][x]: b[1].append(n-i) x+=1 if x==n:break if x==n:break for i in range(1,n):b[1][n-i-1]+=b[1][n-i] x=0 for i in range(n): while a[1][i]>a[0][x]: b[0].append(b[1][i]) x+=...
s755804799
p03557
u802772880
1554523175
Python
Python (3.4.3)
py
Runtime Error
157
23360
255
import bisect N=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() c.sort() count=0 for j in b: x=bisect.bisect_left(a,j) y=bisect.bisect_right(c,j) ans+=x*(N-l) print(count)
s780256175
p03557
u013408661
1554169405
Python
Python (3.4.3)
py
Runtime Error
52
15348
686
n=int(input()) a=list(map(int,input().split())) a.sort(list(set(a))) b=list(map(int,input().split())) b.sort(list(set(b))) c=list(map(int,input().split())) c.sort(list(set(c))) def binary_search1(x,sortedlist): left=-1 right=len(sortedlist) while abs(right-left)>1: mid=(left+right)//2 if sortedlist[mid]<=...
s276063971
p03557
u013408661
1554169318
Python
Python (3.4.3)
py
Runtime Error
53
14784
673
n=int(input()) a=list(map(int,input().split())) a.sort(list(set(a))) b=list(map(int,input().split())) b.sort(list(set(b))) c=list(map(int,input().split())) c.sort(list(set(c))) def binary_search1(x,sortedlist): left=-1 right=len(sortedlist) while abs(right-left)>1: mid=(left+right)//2 if sortedlist[mid]<=...
s974938539
p03557
u091051505
1554148613
Python
Python (3.4.3)
py
Runtime Error
210
23644
323
n = int(input()) a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] a.sort() b.sort() c.sort() count = 0 for c_ in c: b_ = b[:bisect.bisect_right(b, c_-1)] for b_1 in b_: a_num = bisect.bisect_right(a, b_1-1) count += a_num print(cou...
s229194758
p03557
u798129018
1554006082
Python
Python (3.4.3)
py
Runtime Error
197
23328
314
N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) C = list(map(int,input().split())) A.sort() B.sort() C.sort() ans = 0 for i in range(N): r1 = bisect.bisect_right(B,A[i]) for j in range(r1,N): r2 = bisect.bisect_right(C,B[j]) ans += N - r2 print(ans)
s982712307
p03557
u374103100
1553885822
Python
Python (3.4.3)
py
Runtime Error
309
23712
970
# https://atcoder.jp/contests/abc077/tasks/arc084_a import itertools import collections import bisect def main(): N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() ans = 0 for b ...
s570948982
p03557
u674885198
1553825475
Python
Python (3.4.3)
py
Runtime Error
389
27444
713
n = int(input()) a = list(map(int, input().split())) b= list(map(int, input().split())) c=list(map(int, input().split())) a.sort() b.sort() c.sort() b_ind=0 c_ind=0 b_res=[0 for i in range(n)] while b_ind<n: while b[b_ind] >= c[c_ind]: c_ind+=1 if c_ind ==n: break b_res[b_ind]=c_i...
s881402747
p03557
u352623442
1553820558
Python
PyPy3 (2.4.0)
py
Runtime Error
2109
107108
475
import bisect n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) a =sorted(a) b =sorted(b) c =sorted(c) ans = 0 for i in range(n): in_in = bisect.bisect_left(b,a[i]) if a[i] == b[in_in]: in_in += 1 for k in range(in_in,n): ...
s281611755
p03557
u593063683
1553282642
Python
Python (3.4.3)
py
Runtime Error
333
28120
2446
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 2019/3/22 Solved on 2019/3/ @author: shinjisu """ # ABC 077 C Festival import collections #import numpy as np def getInt(): return int(input()) def getIntList(): return [int(x) for x in input().split()] # def getIntList(): return np.array(input().split()...
s996922453
p03557
u593063683
1553280765
Python
Python (3.4.3)
py
Runtime Error
328
30992
2505
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 2019/3/22 Solved on 2019/3/ @author: shinjisu """ # ABC 077 C Festival import collections #import numpy as np def getInt(): return int(input()) def getIntList(): return [int(x) for x in input().split()] # def getIntList(): return np.array(input().split()...
s754225912
p03557
u593063683
1553280163
Python
Python (3.4.3)
py
Runtime Error
2105
28196
2471
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 2019/3/22 Solved on 2019/3/ @author: shinjisu """ # ABC 077 C Festival import collections #import numpy as np def getInt(): return int(input()) def getIntList(): return [int(x) for x in input().split()] # def getIntList(): return np.array(input().split()...
s888288978
p03557
u077019541
1553090520
Python
Python (3.4.3)
py
Runtime Error
197
23156
296
N = int(input()) As = sorted(list(map(int,input().split()))) Bs = sorted(list(map(int,input().split()))) Cs = sorted(list(map(int,input().split()))) ans = 0 for a in As: bindex = bisect.bisect_right(Bs, a) for b in Bs[bindex:]: ans += len(Cs)-bisect.bisect_right(Cs, b) print(ans)
s583497749
p03557
u619458041
1553025387
Python
Python (3.4.3)
py
Runtime Error
323
25488
584
import sys from bisect import bisect from itertools import accumulate def main(): input = sys.stdin.readline N = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(int, input().split()))) Bn = [0] * N for i in range(N): ...
s681712063
p03557
u543954314
1552864608
Python
Python (3.4.3)
py
Runtime Error
160
23328
249
import bisect n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = list(map(int, input().split())) a.sort() c.sort() ans = 0 for i in b: ans += bisect.bisect_left(a,x)*(n-bisect.bisect_right(c,x)) print(ans)
s708353814
p03557
u677440371
1550809250
Python
Python (3.4.3)
py
Runtime Error
18
2940
344
n = int(input()) a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split a.sort() b.sort() c.sort() from bisect import bisect_left,bisect_right ans = 0 for i in b: count_a = bisect_right(a,i) count_c = n - bisect_right(c,i) ans += coun...
s319283891
p03557
u025235255
1550485006
Python
Python (3.4.3)
py
Runtime Error
381
27692
844
n = int(input()) a = [0] + list(map(int, input().split())) #index alliginment b = [0] + list(map(int, input().split())) c = [0] + list(map(int, input().split())) a.sort() b.sort() c.sort() bp, cp = 1, 1 cana, canb = [0], [0] # a[i]に対して条件を満たすbの要素数と # b[i]に対して条件を満たすcの要素数を保管 sumb = [0] # canbの末尾からn個の...
s311925275
p03557
u977389981
1548553913
Python
Python (3.4.3)
py
Runtime Error
205
24096
255
n = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(int, input().split()))) ans = 0 for b in B: ans += bisect.bisect_left(A, b) * (n - bisect.bisect_right(C, b)) print(ans)
s459835994
p03557
u332906195
1548465868
Python
Python (3.4.3)
py
Runtime Error
197
23360
521
# -*- coding: utf-8 -*- import bisect n = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() Ac, Cc = [0]*n, [0]*n # Ap, Cp = 0, 0 for i in range(n): Ac[i] = bisect.bisect_left(Ap, B[i])#[Ap:], B[i]) # Ac[i], ...
s369630347
p03557
u007758012
1548391911
Python
Python (3.4.3)
py
Runtime Error
2117
213624
818
N = int(input()) A = [int(i) for i in input().split()] B = [int(i) for i in input().split()] C = [int(i) for i in input().split()] def quicksort(array): if len(array) < 2: return array else: pivot = array[0] less = [i for i in array[1:] if i <= pivot] greater = [i fo...
s016642523
p03557
u229660384
1547742752
Python
Python (3.4.3)
py
Runtime Error
1663
23884
618
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() total = 0 for i in range(N): low = 0 high = N + 1 while low < high: mid1 = (low + high) // 2 if A[mid1] < B[i]: low = mid1 + 1...
s513019525
p03557
u229660384
1547741122
Python
Python (3.4.3)
py
Runtime Error
201
23248
246
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() ans = 0 for b in B: ans += bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) print(ans)
s861103203
p03557
u229660384
1547740943
Python
Python (3.4.3)
py
Runtime Error
196
23248
246
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() ans = 0 for b in B: ans += bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) print(ans)
s444935273
p03557
u229660384
1547681209
Python
Python (3.4.3)
py
Runtime Error
1696
24052
745
N = int(input()) A = list(map(int, input().split())) #A = [int(x) for x in input().split()] B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() #A = [-float('inf')] + A + [float('inf')] B.sort() C.sort() #C = [-float('inf')] + C + [float('inf')] total = 0 for i in range(N): low = 0 ...
s544266734
p03557
u229660384
1547680667
Python
Python (3.4.3)
py
Runtime Error
1963
24052
774
N = int(input()) A = list(map(int, input().split())) #A = [int(x) for x in input().split()] B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() #A = [-float('inf')] + A + [float('inf')] B.sort() C.sort() #C = [-float('inf')] + C + [float('inf')] total = 0 for i in range(N): low = 0 ...
s236032589
p03557
u229660384
1547680523
Python
Python (3.4.3)
py
Runtime Error
1968
24052
687
N = int(input()) A = list(map(int, input().split())) #A = [int(x) for x in input().split()] B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() total = 0 for i in range(N): low = 0 high = N + 1 while low + 1 < high: mid1 = (low + high) // 2 if...
s252499539
p03557
u138486156
1544238208
Python
Python (3.4.3)
py
Runtime Error
364
23348
385
import bisect n = int(input()) a = sorted(list(map(int, input().split()))) ma = min(a) b = sorted([x for x in map(int, input().split()) if x > ma]) mb = min(b) c = sorted([x for x in map(int, input().split()) if x > mb]) m = len(c) ans = 0 for x in b: #挿入できる箇所を返す p = bisect.bisect_left(a, x) q = m - bisect....
s179850133
p03557
u272557899
1542491546
Python
Python (3.4.3)
py
Runtime Error
1069
77880
1058
n = int(input()) #a = [list(map(int, input().split())) + [i] for i in range(n)] A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) a = [] b = [] c = [] for i in range(n): a.append([]) b.append([]) c.append([]) for i in range(n): a[i].append(A[i]) ...
s426614032
p03557
u883048396
1541364097
Python
Python (3.4.3)
py
Runtime Error
294
22836
705
import sys def 解(): input = sys.stdin.readline iN = int(input()) aA = sorted([int(_) for _ in input().split()]) aB = sorted([int(_) for _ in input().split()]) aC = sorted([int(_) for _ in input().split()]) #解法どおり書くとどれくらいでできるのか計測 idxA = 0 idxC = iN-1 iAns = 0 for idxB in range(...
s567689067
p03557
u853900545
1541259176
Python
Python (3.4.3)
py
Runtime Error
2104
23160
464
n = int(input()) a = sorted(list(map(int,input().split()))) b = sorted(list(map(int,input().split()))) c = sorted(list(map(int,input().split()))) cnt = 0 for i in range(len(a)): A = a[i] j = 0 while j < len(b): if A < b[j]: cnt += 1 j += 1 k = 0 whil...
s546399729
p03557
u853900545
1541191009
Python
Python (3.4.3)
py
Runtime Error
17
3064
394
n = int(input()) a = sorted(list(map(int,input().split()))) b = sorted(list(map(int,input().split()))) c = sorted(list(map(int,input().split()))) cnt = 0 for i in range(len(a)): A = a[i] j = 0 while j < len(b): if A < b[j]: cnt += 1 j += 1 else: break ...
s336029515
p03557
u199295501
1540485635
Python
Python (3.4.3)
py
Runtime Error
385
25236
930
# -*- coding: utf-8 -*- import math def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) def permutations_count(n, r): return math.factorial(n) // math.factorial(n - r) N = int(input()) An = list(map(int, input().split())) Bn = list(map(int, input().split())) C...
s571570792
p03557
u102126195
1538248599
Python
Python (3.4.3)
py
Runtime Error
213
23220
1009
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() #A < B < C def sarch(i, left, right, x, y): mid = (right + left) // 2 if right - left < 3: return left, right elif x[i] <= y[mid]: sarch(i, ...
s655075109
p03557
u102126195
1538248527
Python
Python (3.4.3)
py
Runtime Error
216
23220
1010
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() #A < B < C def sarch(i, left, right, x, y): mid = (right + left) // 2 if right - left < 10: return left, right elif x[i] <= y[mid]: sarch(i,...
s074432803
p03557
u073775598
1537189464
Python
Python (3.4.3)
py
Runtime Error
197
22720
1199
#ABC077C N=int(input()) #大きい順に# 並べる A=sorted(list(map(int,input().split())), reverse=True) B=sorted(list(map(int,input().split())), reverse=True) C=sorted(list(map(int,input().split())), reverse=True) #あるBの下にいくつCが入るか数える C_under_B=[0]*N #i番目のBの下に入るCの数 for i in range(N): if j > 0: if B[i] == B[i-1]: ...
s131336062
p03557
u411858517
1536120190
Python
Python (3.4.3)
py
Runtime Error
160
23232
337
import bisect N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() C.sort() res = 0 for b in B: bisect_index_A = bisect.bisect_left(A, b) bisect_index_C = bisect.bisect_right(C, b) res += insert_index_A * (N - insert_index_C...
s316250701
p03557
u411858517
1536119919
Python
Python (3.4.3)
py
Runtime Error
158
23204
323
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() C.sort() res = 0 for b in B: insert_index_A = bisect.bisect_left(A, b) insert_index_C = bisect.bisect_right(C, b) res += insert_index_A * (N - insert_index_C) print(r...
s454333716
p03557
u474270503
1535675632
Python
Python (3.4.3)
py
Runtime Error
1137
24052
711
N=int(input()) A=list(map(int, input().split())) B=list(map(int, input().split())) C=list(map(int, input().split())) def binary_search(list,target,b): left = 0 right = len(list) - 1 while left <= right: center = (left + right)//2 if list[center] == target: if b: ...
s150752209
p03557
u663101675
1535491154
Python
Python (3.4.3)
py
Runtime Error
190
23360
365
import bisect N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A = A.sort() B = B.sort() C = C.sort() Sum = 0 for i in range(N): Start_B = bisect.bisect_left(B,A[i]+1) for j in range(Start_B, N): Start_C = bisect.bisect_left(C,B...
s448421218
p03557
u102902647
1535457938
Python
Python (3.4.3)
py
Runtime Error
17
2940
633
N = int(input()) A = [int(i) for i in input().split()] B = [int(i) for i in input().split()] C = [int(i) for i in input().split()]res = 0 cnt_a = 0 cnt_c = 0 for b in B: for ca in range(cnt_a, N): if A[ca] >= b: cnt_a = ca break if ca == N-1: if A[ca] < b: ...
s208169859
p03557
u111421568
1535220984
Python
Python (3.4.3)
py
Runtime Error
199
23328
705
def searchsub(arr, x, l, r): if r-l <= 1: if arr[l]>x: return l else: return l+1 m = l + (r-l)//2 if arr[m]<=x: return searchsub(arr, x, m, r) else: return searchsub(arr, x, l, m) def search(arr, x, l=0): return searchsub(arr, x, ...
s345579212
p03557
u111421568
1535220297
Python
Python (3.4.3)
py
Runtime Error
2105
23328
687
def searchsub(arr, x, l, r): if r-l <= 1: if arr[l]>x: return l else: return l+1 m = l + (r-l)//2 if arr[m]<=x: return searchsub(arr, x, m, r) else: return searchsub(arr, x, l, m) def search(arr, x, l=0): return searchsub(arr, x, ...
s290347958
p03557
u111421568
1535219257
Python
Python (3.4.3)
py
Runtime Error
2104
23328
635
def searchsub(arr, x, l, r): if r-l <= 1: if arr[l]>x: return l else: return l+1 m = l + (l+r)//2 if arr[m]<=x: return searchsub(arr, x, m, r) else: return searchsub(arr, x, l, m) def search(arr, x): return searchsub(arr, x, 0, le...
s225225337
p03557
u111421568
1535219084
Python
Python (3.4.3)
py
Runtime Error
2105
23220
1205
def mergesortsub(a, b): i = 0 j = 0 merged = [] while i<len(a) or j<len(b): if i == len(a): merged.append(b[j]) j += 1 elif j == len(b): merged.append(a[i]) i += 1 elif a[i]<b[j]: merged.append(a[i]) i += 1 ...
s429509261
p03557
u107039373
1535054824
Python
Python (3.4.3)
py
Runtime Error
2110
24096
385
n = int(input()) a = sorted(list(map(int,input().split()))) b = sorted(list(map(int,input().split()))) c = sorted(list(map(int,input().split()))) x = 0 B = b[:] for i in a: while B[0] <= i: del B[0] if B == []: break C = c[:] if B == []: break for j in B: wh...
s365662475
p03557
u107039373
1535054568
Python
Python (3.4.3)
py
Runtime Error
2105
23160
314
n = int(input()) a = sorted(list(map(int,input().split()))) b = sorted(list(map(int,input().split()))) c = sorted(list(map(int,input().split()))) x = 0 B = b for i in a: while B[0] <= i: del B[0] C = c[:] for j in B: while C[0] <= j: del C[0] x += len(C) print(x)
s777731476
p03557
u796060588
1533011095
Python
Python (2.7.6)
py
Runtime Error
2105
107776
648
# vim: set fileencoding=utf-8 : import bisect def main(): n = int(raw_input()) A = sorted(map(int, raw_input().split())) B = sorted(map(int, raw_input().split())) C = sorted(map(int, raw_input().split())) BC = [0] * n ans = 0 for bj in range(n): idx = bisect.bisect_left(C, B[bj]) ...