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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s221026740 | p03557 | u789714448 | 1589896813 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 23220 | 1715 | N = int(input())
A_list = list( map(int, input().split() ) )
B_list = list( map(int, input().split() ) )
C_list = list( map(int, input().split() ) )
# print(d,n,m)
# print(A_list)
# print(B_list)
# print(C_list)
A_sort = sorted(A_list)
C_sort = sorted(C_list)
# print(A_sort)
# print(C_sort)
# kよりも小さい値の位置を探す
def sear... |
s760133882 | p03557 | u789714448 | 1589894753 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 23372 | 1706 | N = int(input())
A_list = list( map(int, input().split() ) )
B_list = list( map(int, input().split() ) )
C_list = list( map(int, input().split() ) )
# print(d,n,m)
# print(A_list)
# print(B_list)
# print(C_list)
A_sort = sorted(A_list)
C_sort = sorted(C_list)
# print(A_sort)
# print(C_sort)
# kよりも小さい値の位置を探す
def sear... |
s716296850 | p03557 | u677991935 | 1589759403 | Python | Python (3.4.3) | py | Runtime Error | 2120 | 273888 | 753 | import bisect
def quicksort(x):
if x==[]: return []
smallerSorted = quicksort([a for a in x[1:] if a <= x[0]])
biggerSorted = quicksort([a for a in x[1:] if a > x[0]])
return(smallerSorted+[x[0]]+biggerSorted)
ans = 0
N = int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split())... |
s736574428 | p03557 | u934052933 | 1589607327 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1465 | # 汎用的な二分探索のテンプレ
def binary_search1(key, a):
left = -1 # index = 0 が条件を満たすこともあるので初期値は−1
right = len(a) # index = len(a) -1 が条件満たさないこともある
# どんな二分探索でもここの書き方を変えずにできる
while right - left > 1 :
mid = left + ((right - left + 1) // 2)
if a[mid] >= key:
right = mid
else:
... |
s550250460 | p03557 | u934052933 | 1589604041 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1526 | # index が条件をみたかどうか
def isLess(index, key, a):
if a[index] >= key:
return True
else:
return False
def isUpper(index, key, a):
if a[index] > key:
return True
else:
return False
def binary_search(key, a, upper=True):
left = -1 # index = 0 が条件を満たすこともあるので初期値は−1
right= len(a) # index = len... |
s109491338 | p03557 | u934052933 | 1589602427 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1467 |
# index が条件をみたかどうか
def isLess(index, key, a):
if a[index] >= key:
return True
else:
return False
def isUpper(index, key, a):
if a[index] > key:
return True
else:
return False
def binary_search(key, a, upper=True):
left = -1 # index = 0 が条件を満たすこともあるので初期値は−1
right= len(a) # ... |
s446874702 | p03557 | u934052933 | 1589602319 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1484 |
# index が条件をみたかどうか
def isLess(index, key, a):
if a[index] >= key:
return True
else:
return False
def isUpper(index, key, a):
if a[index] > key:
return True
else:
return False
def binary_search(key, a, upper=True):
left = -1 # index = 0 が条件を満たすこともあるので初期値は−1
right= len... |
s805221094 | p03557 | u934052933 | 1589601984 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1517 |
# index が条件をみたかどうか
def isLess(index, key, a):
if a[index] >= key:
return True
else: return False
def isUpper(index, key, a):
if a[index] > key:
return True
else: return False
# 汎用的な二分探索のテンプレ
def binary_search(key, a, upper=True):
left : int = -1 # index = 0 が条件を満たすこともあるので初期値は−1
... |
s560774519 | p03557 | u586639900 | 1589574170 | Python | Python (3.4.3) | py | Runtime Error | 163 | 23456 | 329 | 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 b in B:
upper = bisect_left(A, b) # returns number of elements which satisfy a < b
lower = bisect_right(C, b)
count += upper * (len(C) - lower)
pri... |
s076068549 | p03557 | u135454978 | 1589503220 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 952 | # AtCoder Beginner Contest 077 C - Snuke Festival
import sys
N = int(input())
A = list(map(int, sys.stdin.readline().strip().split()))
B = list(map(int, sys.stdin.readline().strip().split()))
C = list(map(int, sys.stdin.readline().strip().split()))
A = sorted(A)
B = sorted(B)
C = sorted(C)
def search(i, S): # i ... |
s160361598 | p03557 | u612223903 | 1589388582 | Python | Python (3.4.3) | py | Runtime Error | 275 | 24180 | 455 | n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
import bisect
a.sort()
b.sort()
c.sort()
ans = 0
comb = []
for i in range(len(b)):
key = bisect.bisect_left(c,b[i]+1)
comb.append(len(c) -key)
comb.append(0)
combsum = []
for i in range(co... |
s546559680 | p03557 | u033602950 | 1589368562 | Python | PyPy3 (2.4.0) | py | Runtime Error | 339 | 83300 | 344 | import itertools
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())))
cnt=0
for i in range(0,len(c)):
b_index=bisect.bisect_left(b,c[-i-1])
for u in range(b_index):
cnt+=bisect.bisect_left(a,b[b_ind... |
s591546993 | p03557 | u230717961 | 1589145996 | Python | Python (3.4.3) | py | Runtime Error | 223 | 22720 | 461 | def solve(n, a, b, c):
b_count = [0]*len(b)
for i, x in enumerate(b):
b_count[i] = len(c) - find_ge(c, x)
ans = 0
for i in a:
x = find_ge(b, i)
ans += sum(b_count[x:])
return ans
if __name__ == "__main__":
n = int(input())
a = sorted([int(i) for i in input... |
s791746560 | p03557 | u573234244 | 1589058926 | Python | Python (3.4.3) | py | Runtime Error | 162 | 23232 | 291 | 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):
a = bisect.bisect_left(A, B[i])
c = bisect.bisect_right(C, B[i])
ans += a*(N-c)
print(ans) |
s797303627 | p03557 | u686036872 | 1589020687 | Python | Python (3.4.3) | py | Runtime Error | 200 | 23360 | 289 | 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()
ans = 0
for b in B:
a = bisect.bisect_left(A, x)
b = bisect.bisect_right(C, x)
ans += (a + 1)*b
print(ans) |
s365582456 | p03557 | u607075479 | 1589004684 | Python | Python (3.4.3) | py | Runtime Error | 391 | 28276 | 494 | 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()
BoverA = [0] * N
CoverB = [0] * N
for i in range(N):
BoverA[i] = N - bisect.bisect_right(B, A[i])
CoverB[i] = N - bisect.bisect_right(C, B[i])
cum... |
s628591258 | p03557 | u185424824 | 1588854667 | Python | PyPy3 (2.4.0) | py | Runtime Error | 350 | 105444 | 967 | import math
def main():
from builtins import input, int, map
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()
n = int(math.log2(N))+1
ans = 0
for i in range(N):
if A[0] >= B[i]:
continue... |
s641479671 | p03557 | u000513658 | 1588847840 | Python | Python (3.4.3) | py | Runtime Error | 324 | 23360 | 370 | 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()
bi = bisect.bisect_right
result = 0
for i in range(n):
a_bi_in_b = bi(b, a[i])
b_bi_in_c = bi(c, b[a_bi_in_b])
result += (n - a_bi_in_b)... |
s175153435 | p03557 | u437351386 | 1588795339 | Python | Python (3.4.3) | py | Runtime Error | 194 | 23328 | 266 | 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()
import bisect
ans=0
for i in b:
a=bisect.bisect_left(i)
b=bisect.bisect_right(i)
ans=ans+a*(n-b)
print(ans)
|
s830366388 | p03557 | u437351386 | 1588522932 | Python | Python (3.4.3) | py | Runtime Error | 202 | 23360 | 280 | 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
ans=0
for i in b:
A=bisect.bisect_left(a,b[i])
B=bisect.bisect_right(c,b[i])
ans=ans+A*(n-B)
print(ans)
|
s761203252 | p03557 | u375616706 | 1588449798 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 644 | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
long long int N,ans,mid;
cin >> N;
vector<long long int> A(N,0),B(N,0),C(N,0);
for (int i=0;i<N;i++) cin >> A[i];
for (int i=0;i<N;i++) cin >> B[i];
for (int i=0;i<N;i++) cin >> C[i];
sort(A.begin(),A.... |
s827973745 | p03557 | u655663334 | 1588382893 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2112 | 136772 | 1894 | N = int(input())
Alist = sorted(list(map(int, input().split())))
Blist = sorted(list(map(int, input().split())))
Clist = sorted(list(map(int, input().split())))
def binary_search1(num_list, target):
ans_counter = 0
if target <= num_list[0]:
return 0
if num_list[-1] < target:
return(len... |
s083690845 | p03557 | u655663334 | 1588382198 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2112 | 136468 | 1865 | N = int(input())
Alist = sorted(list(map(int, input().split())))
Blist = sorted(list(map(int, input().split())))
Clist = sorted(list(map(int, input().split())))
def binary_search1(num_list, target):
ans_counter = 0
if target <= num_list[0]:
return -1
if num_list[-1] < target:
return(le... |
s803664304 | p03557 | u634079249 | 1588288946 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 22100 | 1117 | import sys
import os
import math
import bisect
ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]
iss = ... |
s720185409 | p03557 | u004482945 | 1587897319 | Python | Python (3.4.3) | py | Runtime Error | 20 | 5876 | 263 | import bisect
n = int(input())
a = list(map(int, input()))
b = list(map(int, input()))
c = list(map(int, input()))
a.sort()
ans = 0
for i in b:
d = bisect.bisect_left(a, i)
e = bisect.bisect_right(c, i)
if d > 0 and e < len(c):
ans += d*(n-e)
print(ans) |
s033623299 | p03557 | u125545880 | 1587864598 | Python | Python (3.4.3) | py | Runtime Error | 2119 | 41384 | 2215 | import sys
import math
import collections
readline = sys.stdin.readline
def myindex(t, x, default=-1):
if x in t:
return t.index(x)
else:
return default
def main():
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
C = list(map(... |
s085354359 | p03557 | u125545880 | 1587864367 | Python | PyPy3 (2.4.0) | py | Runtime Error | 312 | 92644 | 2215 | import sys
import math
import collections
readline = sys.stdin.readline
def myindex(t, x, default=-1):
if x in t:
return t.index(x)
else:
return default
def main():
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
C = list(map(... |
s738770578 | p03557 | u125545880 | 1587864220 | Python | Python (3.4.3) | py | Runtime Error | 2124 | 90384 | 2212 | import sys
import math
import collections
readline = sys.stdin.readline
def myindex(t, x, default=-1):
if x in t:
return t.index(x)
else:
return default
def main():
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
C = list(map(... |
s554636477 | p03557 | u193597115 | 1587608403 | Python | Python (3.4.3) | py | Runtime Error | 205 | 22720 | 486 | import bisect
def snuke_festival(N,arr):
n_pair = 0
for item in arr[1]:
up_pair = bisect.bisect(arr[0],item)
dowm_pair = bisect.bisect_right(arr[2],item)
n_pair += up_pair*down_pair
return n_pair
if __name__ == "__main__":
N =int(input())
arr = []
for i in range(3):
... |
s165588880 | p03557 | u679520304 | 1587155793 | Python | PyPy3 (2.4.0) | py | Runtime Error | 358 | 106980 | 197 | import bisect
N = int(input())
ABC = [sorted(list(map(int,input().split()))) for i in range(3)]
for b in ABC[1]:
ans += bisect.bisect_left(ABC[0],b)*(N-bisect.bisect_right(ABC[2],b))
print(ans)
|
s937926041 | p03557 | u023229441 | 1587055389 | Python | Python (3.4.3) | py | Runtime Error | 193 | 23328 | 254 | vn=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()
import bisect as bi
ans=0
for i in B:
ans+= bi.bisect_left(A,i) * (n-bi.bisect_right(C,i))
print(ans)
|
s976819308 | p03557 | u283719735 | 1586914751 | Python | Python (3.4.3) | py | Runtime Error | 201 | 23360 | 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()
alters_count = 0
for a in A:
count += 1
bidx = bisect.bisect_left(B, a)
if bidx == N:
continue
for b in B[bidx:]:
coun... |
s144787488 | p03557 | u289547799 | 1586814284 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2110 | 141292 | 449 | 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()
print(A)
print(B)
print(C)
ans = 0
for i in range(n):
canB = bisect.bisect_right(B, A[i])
if canB == n:
continue
else:
for j in range(canB... |
s725442017 | p03557 | u705857261 | 1586719380 | Python | PyPy3 (2.4.0) | py | Runtime Error | 483 | 107108 | 777 | #!/usr/bin/env python3
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)
def is_ok(array, index, value):
if array[index] >= value:
return True
return False
def bs_general(array, val... |
s722848710 | p03557 | u309141201 | 1586634732 | Python | Python (3.4.3) | py | Runtime Error | 385 | 23360 | 353 | import bisect
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
ans = 0
for i in range(N):
upi = bisect.bisect_left(A, B[i])
dwi = bisect.bisect_left(C, B[i])
if C[dwi] == B[i]:
dwi = bisect.bisect_left(C, B[i] + 1)
... |
s251182892 | p03557 | u946996108 | 1586494632 | Python | Python (3.4.3) | py | Runtime Error | 354 | 30392 | 7851 | mod = 10 ** 9 + 7
mod2 = 2 ** 61 + 1
from collections import deque
import heapq
import time
from bisect import bisect_left, insort_left, bisect_right
import sys
import random
import itertools
input = sys.stdin.readline
_NUMINT_ALL = list(range(10))
_START_TIME = time.time()
INDEX_KETA = 10**12
def main():
ans = s... |
s010328356 | p03557 | u477977638 | 1586143726 | Python | Python (3.4.3) | py | Runtime Error | 319 | 22632 | 651 | import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline
def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')
# import numpy as ... |
s172900155 | p03557 | u093041722 | 1586134344 | Python | Python (3.4.3) | py | Runtime Error | 200 | 19520 | 444 | from bisect import bisect
N = int(input())
A = sorted(list(map(int,input().split())))
A = sorted(list(map(int,input().split())))
A = sorted(list(map(int,input().split())))
count = 0
for i in range(N):
minb = bisect(B, A[i])
if minb == N:
break
for j in range(minb, N):
if B[j] == A[i]:
... |
s449963316 | p03557 | u363074342 | 1585634087 | Python | Python (3.4.3) | py | Runtime Error | 204 | 23328 | 595 | 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 j in B:
OK = -1
NG = N
while abs(OK-NG) > 1:
mid = (OK + NG) // 2
print(mid)
if A[mid] < j:
OK = mid
el... |
s911626032 | p03557 | u576432509 | 1585429565 | Python | Python (3.4.3) | py | Runtime Error | 26 | 11200 | 947 | icase=0
if icase==0:
n=int(input()) #数値入力 「N」だけの入力のとき
a=[]
b=[]
c=[]
for i in range(n):
ai,bi,ci=map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
elif icase==1:
n=2
a=[1,5]
b=[2,4]
c=[3,6]
elif icase==2:
n=6
a=[3, 14, 159, 2, 6, 53... |
s606590994 | p03557 | u246217175 | 1585410641 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1194 | 105444 | 658 | 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()
ab = [0] * (max(a) + 1)
bc = [0] * (max(b) + 1)
def isok(na , index , key):
if na[index] >= key:
return True
else:
return False
def bs(nar,ke... |
s232483297 | p03557 | u387774811 | 1584914539 | Python | Python (3.4.3) | py | Runtime Error | 1855 | 23328 | 1395 | def quick_sort(arr):
left = []
right = []
if len(arr) <= 1:
return arr
ref = arr[0]
ref_count = 0
for ele in arr:
if ele < ref:
left.append(ele)
elif ele > ref:
right.append(ele)
else:
ref_count += 1
left = quick_sort(left)
right = quick_sort(right)
return left + [ref] * ref_count + right
def... |
s774720550 | p03557 | u387774811 | 1584914387 | Python | PyPy3 (2.4.0) | py | Runtime Error | 735 | 119784 | 1395 | def quick_sort(arr):
left = []
right = []
if len(arr) <= 1:
return arr
ref = arr[0]
ref_count = 0
for ele in arr:
if ele < ref:
left.append(ele)
elif ele > ref:
right.append(ele)
else:
ref_count += 1
left = quick_sort(left)
right = quick_sort(right)
return left + [ref] * ref_count + right
def... |
s448997749 | p03557 | u387774811 | 1584914301 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38384 | 1424 | import os
import statistics
def quick_sort(arr):
left = []
right = []
if len(arr) <= 1:
return arr
ref = arr[0]
ref_count = 0
for ele in arr:
if ele < ref:
left.append(ele)
elif ele > ref:
right.append(ele)
else:
ref_count += 1
left = quick_sort(left)
right = quick_sort(right)
return left + [... |
s872440576 | p03557 | u387774811 | 1584913718 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 24664 | 1488 | import os
import statistics
def quickSort(arr):
left = []
right = []
if len(arr) <= 1:
return arr
median = int(statistics.median(arr))
medianFlg = 0
for element in arr:
if element < median:
left.append(element)
elif element > median:
right.append(element)
else:
medianFlg += 1
left... |
s507199588 | p03557 | u387774811 | 1584913616 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38384 | 1489 | import os
import statistics
def quickSort(arr):
left = []
right = []
if len(arr) <= 1:
return arr
median = int(statistics.median(arr))
medianFlg = 0
for element in arr:
if element < median:
left.append(element)
elif element > median:
right.append(element)
else:
medianFlg += 1
left... |
s502578331 | p03557 | u387774811 | 1584913512 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38384 | 1488 | import os
import statistics
def quickSort(arr):
left = []
right = []
if len(arr) <= 1:
return arr
median = int(statistics.median(arr))
medianFlg = 0
for element in arr:
if element < median:
left.append(element)
elif element > median:
right.append(element)
else:
medianFlg += 1
left... |
s482367007 | p03557 | u547167033 | 1584731448 | Python | Python (3.4.3) | py | Runtime Error | 194 | 23156 | 339 | 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()
i,j,k=0
ans=0
while i<n and j<n and k<n:
while j<n and a[i]>=b[j]:
j+=1
if j==n:
break
while k<n and b[j]>=c[k]:
k+=1
if k==n:
break
ans+=1
i+=1
j+=1... |
s144827208 | p03557 | u547167033 | 1584731390 | Python | Python (3.4.3) | py | Runtime Error | 195 | 23328 | 340 | 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()
i,j,k=0
ans+=1
while i<n and j<n and k<n:
while j<n and a[i]>=b[j]:
j+=1
if j==n:
break
while k<n and b[j]>=c[k]:
k+=1
if k==n:
break
ans+=1
i+=1
j+=... |
s236023725 | p03557 | u547167033 | 1584731297 | Python | Python (3.4.3) | py | Runtime Error | 194 | 22720 | 297 | 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()
i,j,k=0
ans+=1
while i<n and j<n and k<n:
while j<n and a[i]>=b[j]:
j+=1
while k<n and b[j]>=c[k]:
k+=1
ans+=1
i+=1
j+=1
k+=1
print(ans) |
s996626345 | p03557 | u998262711 | 1584718714 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 27748 | 336 | from bisect import bisect
N=int(input())
A=sorted(list(map(int,input().split())))
B=sorted(list(map(int,input().split())))
B_reverse=B[::-1]
C=sorted(list(map(int,input().split())))
cnt=0
dict={}
val=0
for b in B_reverse:
c_min=bisect(C,b)
val+=len(C[c_min:])
dict[b]=val
for a in A:
cnt+=dict[B[bisect(B... |
s846733467 | p03557 | u700805562 | 1584714585 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 23360 | 400 | #20 AtCoder Beginner Contest 077 C - Snuke Festival
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:
if i <= a[n-1]: lena=len(a[:bisect.bisect_left(a, i)])
else: lena=n
if i+1<= c[... |
s166663583 | p03557 | u705857261 | 1584593259 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2107 | 105444 | 1649 | #!/usr/bin/env python3
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
# print(f"N: {N}")
# print(f"A, B, C: {A}, {B}, {C}")
def binary_search_left(arr, value):
left = 0
right = len(arr) - 1
if value < arr[left]:
re... |
s535320947 | p03557 | u705857261 | 1584592472 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2107 | 105444 | 1570 | #!/usr/bin/env python3
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
# print(f"N: {N}")
# print(f"A, B, C: {A}, {B}, {C}")
def binary_search_left(arr, value):
left = 0
right = len(arr) - 1
if value < arr[left]:
re... |
s171135065 | p03557 | u705857261 | 1584592446 | Python | PyPy3 (2.4.0) | py | Runtime Error | 183 | 38384 | 1564 | #!/usr/bin/env python3
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
# print(f"N: {N}")
print(f"A, B, C: {A}, {B}, {C}")
def binary_search_left(arr, value):
left = 0
right = len(arr) - 1
if value < arr[left]:
retu... |
s716295903 | p03557 | u705857261 | 1584586989 | Python | PyPy3 (2.4.0) | py | Runtime Error | 443 | 106980 | 1893 | #!/usr/bin/env python3
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)
# print(f"N: {N}")
# print(f"A, B, C: {A}, {B}, {C}")
def binary_search_lower_bound(arr, value):
left = 0
right = len(ar... |
s060937338 | p03557 | u705857261 | 1584585657 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2112 | 142692 | 1667 | #!/usr/bin/env python3
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)
# print(f"N: {N}")
# print(f"A, B, C: {A}, {B}, {C}")
# def binary_search_lower_bound(arr, value):
# left = 0
# right = ... |
s337694622 | p03557 | u705857261 | 1584585182 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38256 | 1586 | #!/usr/bin/env python3
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)
print(f"N: {N}")
print(f"A, B, C: {A}, {B}, {C}")
# def binary_search_lower_bound(arr, value):
# left = 0
# right = len(... |
s107297704 | p03557 | u086503932 | 1584504751 | Python | Python (3.4.3) | py | Runtime Error | 1653 | 24224 | 877 | def binary_search(A,x,flag):
start = 0
end = len(A)-1
while start < end:
middle = (start + end) // 2
if flag:# Aの時
if A[middle] < x <= A[middle+1]:
return middle + 1
elif x <= A[middle]:
end = middle
else:
start = middle + 1
else:# Bの時
if A[middle] <=... |
s421965822 | p03557 | u117054186 | 1584252357 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 23156 | 860 | ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))
n = ii()
a = li()
b = li()
c = li()
a.sort()
b.sort()
c.sort()
from bisect import bisect_right
def bisect_find(a, x):
i = bisect_right(a, x)
return i
# Bのメモを作る
# 任意の中段パーツが乗ることが可能な下段パーツの数をあらかじめ計算してお... |
s912444170 | p03557 | u119655368 | 1583975223 | Python | Python (3.4.3) | py | Runtime Error | 199 | 23328 | 285 | 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):
x = bisect.bisect_left(a, b[i])
y = bisect.bisect_right(c, b[i])
ans += x * (n - y)
print(ans) |
s879062854 | p03557 | u585070471 | 1583896576 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2112 | 138464 | 848 | import sys
input = sys.stdin.readline
def count_over_target(lst, target):
ng = -1
ok = len(lst)
while abs(ok-ng) > 1:
mid = (ok+ng) // 2
if lst[mid] > target:
ok = mid
else:
ng = mid
if lst[ok] == target:
return len(lst[ok:]) - 1
return len(l... |
s498420181 | p03557 | u966695319 | 1583885986 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38256 | 839 | N = int(input())
# サイズが下の方が大きくないとダメtop<mid<bottom
tops = sorted(list(map(int, input().split(" "))))
mids = sorted(list(map(int, input().split(" "))))
bottoms = sorted(list(map(int, input().split(" "))))
def binary_search(check_list, num, left, right):
if left > right:
return left
mid = (left + right) ... |
s860286702 | p03557 | u068727970 | 1583586217 | Python | Python (3.4.3) | py | Runtime Error | 372 | 24180 | 887 | from bisect import bisect_left
N = int(input())
A = sorted(list(map(int, input().split(" "))))
B = sorted(list(map(int, input().split(" "))))
C = sorted((map(int, input().split(" "))))
def count_more_value_elements(array, v):
insert_index = bisect_left(array, v)
if not insert_index > len(array) - 1:
... |
s569350358 | p03557 | u068727970 | 1583586138 | Python | Python (3.4.3) | py | Runtime Error | 387 | 24180 | 888 | from bisect import bisect_left
N = int(input())
A = sorted(list(map(int, input().split(" "))))
B = sorted(list(map(int, input().split(" "))))
C = sorted((map(int, input().split(" "))))
def count_more_value_elements(array, v):
insert_index = bisect_left(array, v)
if not insert_index > len(array) - 1:
... |
s526611798 | p03557 | u068727970 | 1583583561 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 23092 | 457 | from bisect import bisect_left
N = int(input())
A = sorted(list(map(int, input().split(" "))))
B = sorted(list(map(int, input().split(" "))))
C = sorted((map(int, input().split(" "))))
count = 0
for a in A:
for b in B:
if b <= a:
continue
insert_index = bisect_left(C, b)
if C[i... |
s832417445 | p03557 | u068727970 | 1583583262 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 23092 | 457 | from bisect import bisect_left
N = int(input())
A = sorted(list(map(int, input().split(" "))))
B = sorted(list(map(int, input().split(" "))))
C = sorted((map(int, input().split(" "))))
count = 0
for a in A:
for b in B:
if b <= a:
continue
insert_index = bisect_left(C, b)
if C[i... |
s183582569 | p03557 | u877415670 | 1583539377 | Python | PyPy3 (2.4.0) | py | Runtime Error | 394 | 106084 | 455 | import bisect
from itertools import accumulate
from operator import add
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()
AonB=[]
BonC=[]
ans=0
for i in range(n):
AonB.append(bisect.bisect_left(a,b[i]))
AonB=list(accumula... |
s285442347 | p03557 | u701199820 | 1583287639 | Python | PyPy3 (2.4.0) | py | Runtime Error | 467 | 95844 | 595 | import sys
import bisect
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
b = list(map(int, sys.stdin.readline().split()))
c = list(map(int, sys.stdin.readline().split()))
a.sort()
b.sort()
c.sort()
b_ans_list = [0 for _ in range(n)]
for i in reversed(range(n)):
# b[i]における選択可能なcの個数
... |
s236450919 | p03557 | u863442865 | 1583097539 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 23520 | 1179 | '''
https://atcoder.jp/contests/abc077/tasks/arc084_a
'''
def main():
import sys
#input = sys.stdin.readline
sys.setrecursionlimit(10000000)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations
#from itertools import acc... |
s434402106 | p03557 | u375542418 | 1583006752 | Python | Python (3.4.3) | py | Runtime Error | 169 | 23644 | 492 | 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 sunuke(ai, bi, ci, ans):
if ai > N-1:
print(ans)
elif bi > N-1:
sunuke(ai+1, 0, 0, ans)
elif ci > N-1:
sunuke(ai, bi+1, 0, ans)
elif A[ai] >= ... |
s811282729 | p03557 | u375542418 | 1583006141 | Python | PyPy3 (2.4.0) | py | Runtime Error | 517 | 123916 | 522 | 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()]
print(N,A,B,C)
def sunuke(ai, bi, ci, ans):
if ai > N-1:
print(ans)
elif bi > N-1:
sunuke(ai+1, 0, 0, ans)
elif ci > N-1:
sunuke(ai, bi+1, 0, ans)
... |
s072563938 | p03557 | u375542418 | 1583002636 | Python | Python (3.4.3) | py | Runtime Error | 168 | 23644 | 507 | 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 sunuke(ai, bi, ci, ans):
if ai > N-1:
print(ans)
elif bi > N-1:
sunuke(ai+1, 0, 0, ans)
elif ci > N-1:
sunuke(ai, bi+1, 0, ans)
elif A[ai] >= ... |
s345814814 | p03557 | u375542418 | 1583002521 | Python | Python (3.4.3) | py | Runtime Error | 161 | 23416 | 487 | 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 sunuke(ai, bi, ci):
global ans
if ai > N-1:
print(ans)
elif bi > N-1:
sunuke(ai+1, 0, 0)
elif ci > N-1:
sunuke(ai, bi+1, 0)
elif A[ai] >= ... |
s574508414 | p03557 | u476604182 | 1582580009 | Python | Python (3.4.3) | py | Runtime Error | 149 | 12504 | 319 | import numpy as np
N, *L = map(int, open('0').read().split())
A = np.array(L[:N])
B = np.array(L[N:2*N])
C = np.array(L[2*N:])
A.sort()
B.sort()
C.sort()
binf = np.zeros(N)
j = 0
binf = np.searchsorted(A,B)
bs = np.cumsum(binf)
bs = np.concatenate([[0],bs])
cinf = np.searchsorted(B,C)
ans = np.sum(bs[cinf])
print(ans) |
s519747965 | p03557 | u703950586 | 1582511910 | Python | PyPy3 (2.4.0) | py | Runtime Error | 443 | 95460 | 486 | import sys
from bisect 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()))
b.sort()
c.sort()
bc = [0 for _ in range(n)]
for i in range(len(b)):
if b[i] >= c[n-1]:
break
p = bisect(c,b[i])
... |
s295792003 | p03557 | u103902792 | 1582351728 | Python | PyPy3 (2.4.0) | py | Runtime Error | 201 | 56304 | 403 | n = int(input())
AS = list(int,input().split())
AS.sort()
BS = list(int,input().split())
BS.sort()
CS = list(int,input().split())
CS.sort()
import bisect
AB = [0 for _ in range(n)]
BC = [0 for _ in range(n)]
a = 0
for b in range(n):
AB[b] = bisect.bisect_left(AS,BS[b])
for b in range(n):
BC[b] = n-bisect.bisec... |
s432516704 | p03557 | u488934106 | 1582232946 | Python | PyPy3 (2.4.0) | py | Runtime Error | 467 | 105444 | 1254 | def nibunhigh(lister, b):
ans = 0
low = 0
high = len(lister) - 1
if lister[low] > b:
return high + 1
elif lister[high] < b:
return low
else:
while lister[low + 1] < b:
mid = (low + high) // 2
if (b < lister[mid]):
high = mid
... |
s363314136 | p03557 | u992910889 | 1581821467 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 778 | def sup(A, j):
if A[0] >= j:
return 0
l = 0
r = len(A) - 1
while True:
i = (l+r) // 2
if i == len(A) - 1 and A[i] < j:
return len(A)
elif A[i]<j and A[i+1]>=j:
return i+1
else:
if A[i] >= j:
r = i-1
else: # A[i+1] < j
l = i+1
def inf(A, j):
if A[-1] <= j:
return 0
... |
s889548133 | p03557 | u992910889 | 1581821312 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 781 | def sup(A, j):
if A[0] >= j:
return 0
l = 0
r = len(A) - 1
while True:
i = (l+r) // 2
if i == len(A) - 1 and A[i] < j:
return len(A)
elif A[i]<j and A[i+1]>=j:
return i+1
else:
if A[i] >= j:
r = i-1
else: # A[i+1] < j
l = i+1
def inf(A, j):
if A[-1] <= j:
return 0
... |
s829753477 | p03557 | u992910889 | 1581821249 | Python | PyPy3 (2.4.0) | py | Runtime Error | 187 | 38256 | 781 | def sup(A, j):
if A[0] >= j:
return 0
l = 0
r = len(A) - 1
while True:
i = (l+r) // 2
if i == len(A) - 1 and A[i] < j:
return len(A)
elif A[i]<j and A[i+1]>=j:
return i+1
else:
if A[i] >= j:
r = i-1
else: # A[i+1] < j
l = i+1
def inf(A, j):
if A[-1] <= j:
return 0
... |
s814396371 | p03557 | u992910889 | 1581287702 | Python | PyPy3 (2.4.0) | py | Runtime Error | 461 | 92516 | 1152 | import sys
sys.setrecursionlimit(4100000)
input=sys.stdin.readline
# coding: utf-8
# Your code here!
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
a[0].sort()
a[2].sort()
"""
print(a[0])
print(a[1])
print(a[2])
"""
def bin_upper(b):
pl=0
pr=n-1
while True:
pc=(pl+p... |
s675366759 | p03557 | u992910889 | 1581287335 | Python | PyPy3 (2.4.0) | py | Runtime Error | 476 | 92516 | 1121 | import sys
input=sys.stdin.readline
# coding: utf-8
# Your code here!
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
a[0].sort()
a[2].sort()
"""
print(a[0])
print(a[1])
print(a[2])
"""
def bin_upper(b):
pl=0
pr=n-1
while True:
pc=(pl+pr)//2
if a[0][pc]>=b an... |
s183316601 | p03557 | u992910889 | 1581286725 | Python | Python (3.4.3) | py | Runtime Error | 1394 | 24052 | 1085 | # coding: utf-8
# Your code here!
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
a[0].sort()
a[2].sort()
"""
print(a[0])
print(a[1])
print(a[2])
"""
def bin_upper(b):
pl=0
pr=n-1
while True:
pc=(pl+pr)//2
if a[0][pc]>=b and a[0][pc-1]<b:
return p... |
s791886883 | p03557 | u992910889 | 1581285839 | Python | PyPy3 (2.4.0) | py | Runtime Error | 498 | 105444 | 1130 | # coding: utf-8
# Your code here!
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
a[0].sort()
a[2].sort()
"""
print(a[0])
print(a[1])
print(a[2])
"""
def bin_upper(b):
pl=0
pr=n-1
while True:
pc=(pl+pr)//2
if a[0][pc]>=b and a[0][pc-1]<b:
return p... |
s727082074 | p03557 | u992910889 | 1581285777 | Python | PyPy3 (2.4.0) | py | Runtime Error | 467 | 105444 | 1130 | # coding: utf-8
# Your code here!
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
a[0].sort()
a[2].sort()
"""
print(a[0])
print(a[1])
print(a[2])
"""
def bin_upper(b):
pl=0
pr=n-1
while True:
pc=(pl+pr)//2
if a[0][pc]>=b and a[0][pc-1]<b:
return p... |
s551414972 | p03557 | u992910889 | 1581285688 | Python | PyPy3 (2.4.0) | py | Runtime Error | 532 | 123116 | 1121 | # coding: utf-8
# Your code here!
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
a[0].sort()
a[2].sort()
print(a[0])
print(a[1])
print(a[2])
def bin_upper(b):
pl=0
pr=n-1
while True:
pc=(pl+pr)//2
if a[0][pc]>=b and a[0][pc-1]<b:
return pc
... |
s895927158 | p03557 | u992910889 | 1581284813 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2109 | 105444 | 1024 | # coding: utf-8
# Your code here!
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
#print(a[0][1])
def bin_upper(b):
pl=0
pr=n-1
while True:
pc=(pl+pr)//2
if a[0][pc]>=b and a[0][pc-1]<b:
return pc
elif a[0][pc]<b:
pl=pc+1
... |
s330009606 | p03557 | u620755587 | 1580944545 | Python | PyPy3 (2.4.0) | py | Runtime Error | 377 | 105444 | 779 | 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()
l = max(max(a), max(b), max(c))
aamo = [0]*(l+1)
for i in range(n):
aamo[a[i]] = i+1
for i in range(1, l):
if aamo[i+1] == 0:
aamo[i+1] = aamo[i]
bamo = [0]*(... |
s288641306 | p03557 | u620755587 | 1580944288 | Python | PyPy3 (2.4.0) | py | Runtime Error | 371 | 105444 | 785 | 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()
l = max(max(a), max(b), max(c))
aamo = [0]*(l+1)
for i in range(n):
aamo[a[i]-1] = i+1
for i in range(1, l):
if aamo[i+1] == 0:
aamo[i+1] = aamo[i]
bamo = [0]... |
s156817669 | p03557 | u620755587 | 1580942876 | Python | PyPy3 (2.4.0) | py | Runtime Error | 381 | 105444 | 758 | 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()
l = max(max(a), max(b), max(c))
aamo = [0]*l
for i in range(n):
aamo[a[i]-1] = i+1
for i in range(l-1):
if aamo[i+1] == 0:
aamo[i+1] = aamo[i]
# print(aamo)
b... |
s342268019 | p03557 | u810066979 | 1580708963 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 23328 | 355 |
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
for i in range(1,min(a)+1):
if i in b:
b.remove(i)
for i in range(1,min(b)+1):
if i in c:
c.remove(i)
count=0
for i in range(n):
for j in range(n):
if a[i]<b[j]:
for k in range(n):
if b[j]<... |
s624897373 | p03557 | u780206746 | 1580369935 | Python | Python (3.4.3) | py | Runtime Error | 160 | 23744 | 575 | import bisect
_ = input()
heads = list(sorted(map(int,input().split())))
bodies = list(map(int,input().split()))
legs = list(sorted(map(int,input().split())))
cnt = 0
for body in bodies:
# 頭は、体より小さくなければならない
head_idx = bisect.bisect_left(sorted_heads, body)
head_cnt = len(sorted_heads[:head_idx])
#... |
s041016871 | p03557 | u592818901 | 1580129578 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 732 | #include <iostream>
#include <stdio.h>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
typedef long long int lli;
#define rep(i,s,N) for(int i=s;i<N;i++)
using namespace std;
int main(void)
{
int N; cin >> N;
vector<lli> A(N), B(N), C(N);
rep(i, 0, N)cin >> A[i]; sort(A.be... |
s056882400 | p03557 | u379959788 | 1578782969 | Python | Python (3.4.3) | py | Runtime Error | 159 | 23248 | 279 | 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 b in B:
a_max = bisect.bisect_left(A, b)
c_min = bisect.bisect_right(C, b)
ans += a_max * (N - c_min)
print(ans) |
s810445259 | p03557 | u278670845 | 1576541842 | Python | Python (3.4.3) | py | Runtime Error | 547 | 49160 | 680 | import collections
n=int(input())
a=sorted(list(collections.Counter(map(int,input().split())).items()), key=lambda x: x[0])
b=sorted(list(collections.Counter(map(int,input().split())).items()), key=lambda x: x[0])
c=sorted(list(collections.Counter(map(int,input().split())).items()), key=lambda x: x[0])
bc=[0]*len(b)
j... |
s113216062 | p03557 | u638282348 | 1576125419 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 428 | from functools import lru_cache as cache
from bisect import bisect
n = int(input())
a_list = sorted(map(int, input().split()))
b_list = sorted(map(int, input().split()))
c_list = sorted(map(int, input().split()))
b_c_table = [n - bisect(c_list, b) for b in b_list]
@cache(maxsize=None)
def sum_(*list_):
return su... |
s594671537 | p03557 | u465699806 | 1575755741 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 5425 | //#pragma GCC optimize("O3")
//#pragma GCC target("avx")
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#inclu... |
s565853527 | p03557 | u754022296 | 1575492390 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38256 | 301 | import numpy as np
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 i in A:
for j in B[np.searchsorted(B, i, side="right"):]:
ans += n - np.searchsorted(C, j, side="right")
print(ans) |
s223529964 | p03557 | u183840468 | 1575404969 | Python | Python (3.4.3) | py | Runtime Error | 213 | 23376 | 274 | n = int(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 i in b:
x = bisect.bisect(c,i)
y = bisect.bisect_left(a,i)
ans += (n-x) * y
print(ans)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.