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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s247916931 | p03556 | u796060588 | 1533005497 | Python | Python (2.7.6) | py | Runtime Error | 2259 | 22972 | 240 | # utf-8:
import numpy as np
def main():
n = int(raw_input())
for i in range(n):
sqrt = np.sqrt(n - i +1)
if sqrt - int(sqrt) == 0:
print(n - i)
break
if __name__ == '__main__':
main()
|
s016655477 | p03556 | u796060588 | 1533005440 | Python | Python (2.7.6) | py | Runtime Error | 2445 | 22972 | 237 | # utf-8:
import numpy as np
def main():
n = int(raw_input())
for i in range(n):
sqrt = np.sqrt(n - i)
if sqrt - int(sqrt) == 0:
print(n - i)
break
if __name__ == '__main__':
main()
|
s435611412 | p03556 | u411858517 | 1529366514 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 262 | 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 i in B:
res += bisect.bisect_right(A, i) * (N - bisect.bisect_left(C, i))
print(res) |
s789879151 | p03556 | u411858517 | 1528925746 | Python | Python (3.4.3) | py | Runtime Error | 24 | 2940 | 112 | N = int(input())
for i in range(1, N):
n = i*i
if n > N:
break
res = n
print(res) |
s907642445 | p03556 | u411858517 | 1528925593 | Python | Python (3.4.3) | py | Runtime Error | 26 | 2940 | 107 | N = int(input())
for i in range(1, N):
if i*i > N:
break
res = i * i
print(res)
|
s807971350 | p03556 | u520158330 | 1524762454 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 44 | N = int(math.sqrt(int(input())))
print(N*N) |
s731852773 | p03556 | u916743460 | 1520022076 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 474 | using namespace std;
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <numeric>
typedef long long ll;
typedef pair<int,int> p;
int main()
{
lo... |
s610477295 | p03556 | u006187236 | 1519761924 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 45 | N=int(input())
ans=int(sqrt(N))
print(ans**2) |
s796544580 | p03556 | u612721349 | 1516109628 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 38640 | 58 | print(max([i*i for i in range(10001) if int(input())>=i])) |
s701160130 | p03556 | u563710899 | 1512261175 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 37 | N=input(N)
x=int(N**0.5)
print(x**2) |
s163650355 | p03556 | u224050758 | 1510197292 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | N = input()
i = 1
sq = i * i
while sq <= N:
i += 1
temp = i * i
if temp > N
break
sq = temp
print(sq) |
s036565948 | p03556 | u094533035 | 1510189460 | Python | Python (3.4.3) | py | Runtime Error | 234 | 15516 | 166 | import numpy as np
n = input()
for i in range(n):
a = int(np.sqrt(n - i))
b = n - i
if a**2 == b:
print(b)
break
else:
pass
|
s541900419 | p03556 | u094533035 | 1510189378 | Python | Python (3.4.3) | py | Runtime Error | 299 | 20620 | 166 | import numpy as np
n = input()
for i in range(n):
a = int(np.sqrt(n - i))
b = n - i
if a**2 == b:
print(b)
break
else:
pass
|
s086178074 | p03556 | u094533035 | 1510189241 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 161 | import math
n = input()
for i in range(n):
a = int(math.sqrt(n - i))
b = n - i
if a**2 == b:
print(b)
break
else:
pass
|
s230510951 | p03556 | u094533035 | 1510188747 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 161 | import math
n = input()
for i in range(n):
a = int(math.sqrt(n - i))
b = n - i
if a**2 == b:
print(b)
break
else:
pass
|
s043975621 | p03556 | u094533035 | 1510188343 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 161 | import math
n = input()
for i in range(n):
a = int(math.sqrt(n - i))
b = n - i
if a**2 == b:
print(a)
break
else:
pass
|
s680856044 | p03556 | u094533035 | 1510152458 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 115 | n = input()
for i in range(n):
a = sqrt(n - i)
if type(a) is int:
print(a)
else:
pass
|
s468939086 | p03556 | u425177436 | 1509954942 | Python | PyPy3 (2.4.0) | py | Runtime Error | 162 | 38256 | 80 | import numpy as np
import math
N = int(input())
print(math.floor(np.sqrt(N))**2) |
s310135437 | p03556 | u891827776 | 1509847592 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | import sys
import math
n = int(raw_input())
root = math.floor(math.sqrt(n))
print(int(root * root)) |
s564843002 | p03556 | u538127485 | 1509846349 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | N = int(input().strip())
count = 0
while True:
if (count + 1) ** 2 > N:
print(coun ** 2t)
break
count += 1 |
s414362836 | p03556 | u370331385 | 1509846002 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 195 | def divisor_num(n):
a = 1
for _, x in factorization(n):
a *= x + 1
return a
N=int(input())
n=0
x=1
for i in range(N+1):
n=divisor_num(i)
if(i%2!=0):
x=i
print(x)
|
s873666937 | p03556 | u215207367 | 1509845631 | Python | Python (2.7.6) | py | Runtime Error | 2720 | 6380 | 358 | import sys
DBG_FLAG = 0
def p_dbg(str):
if(DBG_FLAG == 1):
sys.stdout.flush()
print str
# 1st. get Num
Num = int(raw_input())
p_dbg('Num : ' + str(Num))
square_max = 1
for i in range(1, Num):
tmp = i * i
p_dbg(str(i) + str(square_max))
if(tmp <= Num):
square_max = tmp
... |
s614613674 | p03556 | u370331385 | 1509845543 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 472 | def bisearch(f, n):
l = 0
r = n
fl = f(l)
fr = f(r)
while l <= r:
m = (l + r) // 2
fm = f(m)
if fm == n:
return m
elif fm > n:
r = m - 1
fr = f(r)
else:
l = m + 1
fl = f(l)
def try_square_root(n2):
... |
s790491705 | p03556 | u538127485 | 1509845243 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | count = 0
while True:
if (count + 1) ** 2 > N:
print(count)
break
count += 1
|
s787426589 | p03556 | u498631675 | 1509844500 | Python | Python (2.7.6) | py | Runtime Error | 2452 | 6508 | 127 | # -*- coding: utf-8 -*-
N = input()
for i in range(N):
if i*i > N:
print (i-1)*(i-1)
break
else:
pass |
s790472760 | p03556 | u825528847 | 1509844069 | Python | Python (3.4.3) | py | Runtime Error | 61 | 3316 | 116 | N = int(input())
for i in range(N, 1, -1):
tmp = int(pow(i, 0.5))
if tmp * tmp == i:
break
print(i)
|
s397202470 | p03556 | u341855122 | 1509843884 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 40 | a=input()
print(int(a**0.5)*int(a**0.5)) |
s641321987 | p03557 | u935685410 | 1601259266 | Python | Python (3.8.2) | py | Runtime Error | 148 | 29668 | 375 | import bisect
N = int(input())
top = list(map(int,input().split()))
middle = list(map(int,input().split()))
bottom = list(map(int,input().split()))
top.sort()
middle.sort()
bottom.sort()
ans = 0
for i in middle:
can_put_upstair = bisect.bisect_left(top,i)
can_put_donwstair = N - bisect.bisect_right(bottom,i)
... |
s788633913 | p03557 | u271210469 | 1601248551 | Python | PyPy3 (7.3.0) | py | Runtime Error | 215 | 113624 | 909 | n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
B=[]
C=[]
x=0
f=0
import bisect
for i in range(n):
if f==0 and a[x]>=b[i]:
for j in range(n-x):
... |
s103282437 | p03557 | u271210469 | 1601248476 | Python | PyPy3 (7.3.0) | py | Runtime Error | 215 | 113396 | 909 | n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
B=[]
C=[]
x=0
f=0
import bisect
for i in range(n):
if a[x]>=b[i] and f==0:
for j in range(n-x):
... |
s036450497 | p03557 | u271210469 | 1601248440 | Python | PyPy3 (7.3.0) | py | Runtime Error | 206 | 113596 | 907 | n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
B=[]
C=[]
x=0
f=0
import bisect
for i in range(n):
if a[x]>=b[i] and f==0:
for j in range(n-x):
... |
s394345566 | p03557 | u271210469 | 1601247536 | Python | PyPy3 (7.3.0) | py | Runtime Error | 242 | 112868 | 825 | n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
B=[]
C=[]
x=0
for i in range(n):
if a[x]>=b[i]:
for j in range(n-x):
x+=1
if x>=n:
... |
s027648652 | p03557 | u271210469 | 1601247457 | Python | PyPy3 (7.3.0) | py | Runtime Error | 215 | 113216 | 762 | n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
B=[]
C=[]
x=0
for i in range(n):
if a[x]>=b[i]:
for j in range(n-x):
x+=1
if a[x]<b... |
s686687178 | p03557 | u738408150 | 1601145326 | Python | Python (3.8.2) | py | Runtime Error | 30 | 11060 | 292 | import bisect
n=int(input())
list_A=sorted(list(input().split('')))
list_B=sorted(list(input().split('')))
list_C=sorted(list(input().split('')))
ans=0
for i in range(len(list_B)):
a=bisect.bisect_left(list_A, list_B[i])
b=bisect.bisect_right(list_C, list_B[i])
ans += a*(n-b)
print(ans) |
s732914673 | p03557 | u738408150 | 1601145227 | Python | Python (3.8.2) | py | Runtime Error | 29 | 10872 | 264 | import bisect
n=int(input())
list_A=sorted(list(input().split('')))
list_B=sorted(list(input().split('')))
list_C=sorted(list(input().split('')))
ans=0
for i in list_B:
a=bisect.bisect_left(list_A, i)
b=bisect.bisect_right(list_C, i)
ans += a*(n-b)
print(ans) |
s655868764 | p03557 | u738408150 | 1601138316 | Python | Python (3.8.2) | py | Runtime Error | 144 | 32656 | 289 | import bisect
n=int(input())
list_A=sorted(list(input().split(' ')))
list_B=sorted(list(input().split(' ')))
list_C=sorted(list(input().split(' ')))
for i in range(len(list_B)):
ans=0
a=bisect.bisect_left(list_A, list[i])
b=bisect.bisect_right(list_C, list[i])
ans += a*b
print(ans) |
s888944195 | p03557 | u738408150 | 1601138211 | Python | Python (3.8.2) | py | Runtime Error | 146 | 32620 | 275 | import bisect
n=int(input())
list_A=sorted(list(input().split(' ')))
list_B=sorted(list(input().split(' ')))
list_C=sorted(list(input().split(' ')))
ans=0
for i in range(len(list_B)):
a=bisect.bisect_left(list_A, list[i])
b=bisect.bisect_right(list_C, list[i])
print(a*b) |
s299316531 | p03557 | u378691508 | 1600900868 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74688 | 336 | import numpy as np
N = int(input())
A = np.array(input().split(), dtype=np.int32)
B = np.array(input().split(), dtype=np.int32)
C = - np.array(input().split(), dtype=np.int32)
A.sort()
B.sort()
C.sort()
cnt_A = np.searchsorted(A,B,side='left')
cnt_C = np.searchsorted(C,-B,side='left')
answer = (cnt_A * cnt_C).sum... |
s775512378 | p03557 | u966648240 | 1600832613 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 30044 | 695 | import bisect
N=int(input())
a1=0
a2=0
b1=0
b2=0
c1=0
c2=0
c3=0
ans=0
A=list(map(int, input().split()))
A=sorted(A)
B=list(map(int, input().split()))
B=sorted(B)
C=list(map(int, input().split()))
C=sorted(C)
for i in range(len(A)):
a1=A[i]
b2=bisect.bisect_left(B,a1)
if a1==B[b2]:
for j in range(b2+1,l... |
s838076444 | p03557 | u966648240 | 1600832546 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 30108 | 695 | import bisect
N=int(input())
a1=0
a2=0
b1=0
b2=0
c1=0
c2=0
c3=0
ans=0
A=list(map(int, input().split()))
A=sorted(A)
B=list(map(int, input().split()))
B=sorted(B)
C=list(map(int, input().split()))
C=sorted(C)
for i in range(len(A)):
a1=A[i]
b2=bisect.bisect_left(B,a1)
if a1==B[b2]:
for j in range(b2+1,l... |
s371173943 | p03557 | u310381103 | 1600531766 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 30140 | 1120 | def abis(l, key):
le = 0
ri = n
while le < ri:
mid = (le + ri) // 2
if mid == n:
return mid
elif l[mid] == key:
while mid<n and l[mid-1]==l[mid]:
mid-=1
return mid
elif l[mid] > key:
if mid != 0 and l[mid - 1] < ... |
s365011370 | p03557 | u620846115 | 1600485973 | Python | Python (3.8.2) | py | Runtime Error | 138 | 28740 | 370 | import bisect
n = int(input())
x = sorted(list(map(int,input().split())), reverse=True)
y = sorted(list(map(int,input().split())), reverse=True)
z = sorted(list(map(int,input().split())), reverse=True)
count = 0
X =[]
for b in range(n):
k = bisect.bisect_right(x,y[b])
X[b] =(n-k)
for a in range(n):
j = bisect.bis... |
s095455600 | p03557 | u620846115 | 1600485877 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8920 | 372 | import bisect
n = int(input())
x = sorted(list(map(int,input().split())), reverse=True)
y = sorted(list(map(int,input().split())), reverse=True)
z = sorted(list(map(int,input().split())), reverse=True)
count = 0
X =[]
for b in range(n):
k = bisect.bisect_right(x,y[b])
X[b] =(n-k)
for a in range(n):
j = bisect.bis... |
s230972597 | p03557 | u620846115 | 1600485295 | Python | Python (3.8.2) | py | Runtime Error | 146 | 29264 | 317 | n = int(input())
x = sorted(list(map(int,input().split())))[::-1]
y = sorted(list(map(int,input().split())))[::-1]
z = sorted(list(map(int,input().split())))[::-1]
count = 0
for a in range(n):
j = bisect.bisect_right(y,z[a])
for b in range(j,n-1):
k = bisect.bisect_right(x,y[b])
count+=(n-k)
print(count) |
s429204552 | p03557 | u002663801 | 1600384649 | Python | PyPy3 (7.3.0) | py | Runtime Error | 234 | 109688 | 663 | import collections
def nibutansaku(lis,lower,upper,key):
while abs(upper - lower) > 1:
mid = int((upper + lower) / 2)
if lis[mid] >= key:
upper = mid
else:
lower = mid
return upper
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().spl... |
s879490002 | p03557 | u334792253 | 1599094359 | Python | PyPy3 (7.3.0) | py | Runtime Error | 182 | 104708 | 896 | import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
B = list(map(int, input().split()))
B.sort(reverse=True)
C = list(map(int, input().split()))
C.sort(reverse=True)
count = [0]*N
answer = 0
z = 0
for i in range(N):
if B[N-1] >= C[i]:
break
z +... |
s755207714 | p03557 | u726444300 | 1598839804 | Python | Python (3.8.2) | py | Runtime Error | 666 | 29084 | 1399 | import sys
sys.setrecursionlimit(1000000)
N = int(input())
A = list(sorted(map(int, input().split(' '))))
B = list(sorted(map(int, input().split(' '))))
C = list(sorted(map(int, input().split(' ')), reverse=True))
def binary_search_A_max_index(b, begin, end):
if A[begin] >= b: return begin-1
elif A[end] < b: re... |
s881394410 | p03557 | u726444300 | 1598839675 | Python | Python (3.8.2) | py | Runtime Error | 653 | 29036 | 1348 | N = int(input())
A = list(sorted(map(int, input().split(' '))))
B = list(sorted(map(int, input().split(' '))))
C = list(sorted(map(int, input().split(' ')), reverse=True))
def binary_search_A_max_index(b, begin, end):
if A[begin] >= b: return begin-1
elif A[end] < b: return end
elif begin == end - 1: return be... |
s958933490 | p03557 | u653041271 | 1598739514 | Python | PyPy3 (7.3.0) | py | Runtime Error | 197 | 109232 | 1128 | import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline.rstrip()
# sys.setrecursionlimit(10**8)
# mod = 10**9+7... |
s951696076 | p03557 | u926412290 | 1598584753 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74416 | 714 | 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()
def binary_search(lst, value, high):
if high:
value += 0.5
else:
value -= 0.5
l = 0
r = N - 1
while l <= r:
mid = (l + r) // 2
... |
s527621425 | p03557 | u425184437 | 1598324634 | Python | PyPy3 (7.3.0) | py | Runtime Error | 201 | 104652 | 450 | 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()
d=[0 for i in range(N)]
ac=0
for i in range(N):
while C[ac]<=B[i]:
ac+=1
d[i]=N-ac
ab=0
ans=0
for i in range(1,N):
d[i]+=d[i-1]
def f(x):
if x!=0:
return d[N-1]-d[... |
s675694046 | p03557 | u105608888 | 1597970273 | Python | Python (3.8.2) | py | Runtime Error | 125 | 27712 | 431 | import sys
import bisect
def main():
input = sys.stdin.buffer.readline
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = list(map(int, input().split()))
B.sort()
C = list(map(int, input().split()))
ans = 0
for i in B:
a = bisect.bisect_left(A, b)
c = ... |
s464435281 | p03557 | u105608888 | 1597969437 | Python | Python (3.8.2) | py | Runtime Error | 92 | 29360 | 328 | N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A_count = [0] * len(A)
B_count = [0] * len(B)
for i in range(len(B)):
B_count[i] = len(C) - bisect(C, B[i])
for i in range(len(A)):
A_count[i] = sum(B_count[bisect(B, A[i]):])
print(sum(A... |
s189808248 | p03557 | u453055089 | 1597564703 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 221528 | 511 | from bisect import bisect_left, bisect_right
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 a:
j_idx = bisect_left(b, i)
if j_idx == n:
continue
for j in b[j_idx:]:
if i ... |
s659422904 | p03557 | u485319545 | 1597360145 | Python | Python (3.8.2) | py | Runtime Error | 420 | 44252 | 563 | n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
b=sorted(b)
c=sorted(c)
from bisect import bisect_right
d=[]
for i in range(n):
index = bisect_right(c,b[i])
if b[i]==c[index]:
index-=1
if index==-1:
index=1
d.appe... |
s432464033 | p03557 | u304058693 | 1597352215 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9068 | 1734 | 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)
#二分探索(x以上の最小値index) !同じ値の時はindex+1をする
def lower_bound(arr,x):
l=0
r=len(arr)-1#数列arrの最後尾のインデックス
while l<=r:
mid=(l+r)//2#中央値検索
if x... |
s004606223 | p03557 | u304058693 | 1597351278 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8912 | 1604 | 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)
#二分探索(x以上の最小値index) !同じ物は一個下げる
def lower_bound(arr,x):
l=0
r=len(arr)-1#数列arrの最後尾のインデックス
while l<=r:
mid=(l+r)//2#中央値検索
if x==arr[m... |
s040185574 | p03557 | u537217069 | 1597085433 | Python | PyPy3 (7.3.0) | py | Runtime Error | 99 | 74820 | 656 | import numpy as np
def solve():
# 標準入力部分
N = int(input())
A = np.array(input().split(), dtype=np.int32)
B = np.array(input().split(), dtype=np.int32)
C = np.array(input().split(), dtype=np.int32)
# A, B, Cをsort
A.sort()
B.sort()
C.sort()
ans = 0
for a in A:
index_b_... |
s054517124 | p03557 | u537217069 | 1597083835 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2209 | 106144 | 1367 | def binary_search(sorted_list, item):
"""
sorted_listのうち,itemより大きくなる最初のindexを求める.
"""
low = 0
high = len(sorted_list)
while low <= high:
mid = (low + high) // 2
if(mid >= len(sorted_list) or mid < 0):
return None
if sorted_list[mid] > item and mid == 0:
... |
s121579400 | p03557 | u537217069 | 1597083806 | Python | PyPy3 (7.3.0) | py | Runtime Error | 94 | 74692 | 1563 | import io
import sys
sys.path.append('./')
from snippet import util
_INPUT = """\
6
3 14 159 2 6 53
58 9 79 323 84 6
2643 383 2 79 50 288
"""
sys.stdin = io.StringIO(_INPUT)
def binary_search(sorted_list, item):
"""
sorted_listのうち,itemより大きくなる最初のindexを求める.
"""
low = 0
high = len(sorted_list)
... |
s554833419 | p03557 | u591808161 | 1596946759 | Python | PyPy3 (7.3.0) | py | Runtime Error | 94 | 74572 | 895 | #関数リスト
import sys
from bisect import bisect
input = sys.stdin.readline
def RD(): return input().rstrip()
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float,input().s... |
s217007298 | p03557 | u425762225 | 1596560777 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8888 | 1604 | (defun lower-bound (predicate &optional (ok 0) (ng (expt 10 10)))
(if (<= (abs (- ng ok)) 1)
ok
(let ((mid (floor (+ ng ok) 2)))
(if (funcall predicate mid)
(lower-bound predicate mid ng)
(lower-bound predicate ok mid)))))
(defun smaller-p (xs index b-size)
(< (aref xs ... |
s257396659 | p03557 | u425762225 | 1596560697 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8960 | 1618 | (defun lower-bound (predicate &optional (ok 0) (ng (expt 10 10)))
(if (<= (abs (- ng ok)) 1)
ok
(let ((mid (floor (+ ng ok) 2)))
(if (funcall predicate mid)
(lower-bound predicate mid ng)
(lower-bound predicate ok mid)))))
(defun smaller-p (xs index b-size)
(< (aref xs ... |
s172572818 | p03557 | u425762225 | 1596560614 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8948 | 1618 | (defun lower-bound (predicate &optional (ok 0) (ng (expt 10 10)))
(if (<= (abs (- ng ok)) 1)
ok
(let ((mid (floor (+ ng ok) 2)))
(if (funcall predicate mid)
(lower-bound predicate mid ng)
(lower-bound predicate ok mid)))))
(defun smaller-p (xs index b-size)
(< (aref xs ... |
s926520306 | p03557 | u425762225 | 1596560526 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8888 | 1619 | (defun lower-bound (predicate &optional (ok 0) (ng (expt 10 10)))
(if (<= (abs (- ng ok)) 1)
ok
(let ((mid (floor (+ ng ok) 2)))
(if (funcall predicate mid)
(lower-bound predicate mid ng)
(lower-bound predicate ok mid)))))
(defun smaller-p (xs index b-size)
(< (aref xs ... |
s224857866 | p03557 | u659712937 | 1596529476 | Python | Python (3.8.2) | py | Runtime Error | 1217 | 46828 | 1363 | n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
a.sort()
b.sort()
c.sort()
def binary_search(list,item):
low = 0
high = len(list) - 1
while low <= high:
mid = (low + high) //2
guess = list[mid]
if guess == item:
... |
s572143856 | p03557 | u786020649 | 1596420290 | Python | Python (3.8.2) | py | Runtime Error | 172 | 31588 | 372 | import sys
from bisect import bisect_right
read=sys.stdin.read
readline=sys.stdin.readline
def main():
n=int(readline())
a,b,c=(list(map(int,lst.split())) for lst in read().splitlines())
a.sort()
b.sort()
c=[-x for x in c]
c.sort()
print(sum(bisect_right(x,a)*bisect_right(-x,c) for x in b))... |
s784395989 | p03557 | u956438443 | 1596305102 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9076 | 772 | def bs_left(lists, item):
low, high = 0, len(lists)
while (high >low ) :
mid = (low + high)//2
if lists[mid] < item:
low = mid +1
else:
high = mid
return low
def bs_right(lists, item):
low, high = 0, len(lists)
whi... |
s702656787 | p03557 | u328510800 | 1595956831 | Python | Python (3.8.2) | py | Runtime Error | 88 | 29564 | 309 | from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
an.sort()
bn.sort()
cn.sort()
cnt = 0
for b in bn:
a = bisect_left(an,b)
c = bisect_right(cn,b)
cnt += a * (n-c)
print(cnt) |
s678684135 | p03557 | u145231176 | 1594678891 | Python | PyPy3 (7.3.0) | py | Runtime Error | 326 | 115916 | 2008 | def getN():
return int(input())
def getNM():
return map(int, input().split())
def getList():
return list(map(int, input().split()))
def getArray(intn):
return [int(input()) for i in range(intn)]
def input():
return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
return random.randint(ran1,... |
s915162350 | p03557 | u331327289 | 1594622297 | Python | PyPy3 (7.3.0) | py | Runtime Error | 194 | 106180 | 824 | import sys
from bisect import bisect
from itertools import accumulate
def main():
input = sys.stdin.buffer.readline
n = int(input())
a = sorted(map(int, input().split()))
b = sorted(map(int, input().split()))
c = sorted(map(int, input().split()))
# 各中部パーツを乗せられる下部パーツの個数
# b_c_cnt = [len(c[b... |
s482299343 | p03557 | u331327289 | 1594621741 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 221200 | 617 | import sys
from bisect import bisect
from itertools import accumulate
def main():
input = sys.stdin.buffer.readline
n = int(input())
a = sorted(map(int, input().split()))
b = sorted(map(int, input().split()))
c = sorted(map(int, input().split()))
# 各中部パーツを乗せられる下部パーツの個数
b_c_cnt = [len(c[bis... |
s081167476 | p03557 | u331327289 | 1594621708 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 27432 | 617 | import sys
from bisect import bisect
from itertools import accumulate
def main():
input = sys.stdin.buffer.readline
n = int(input())
a = sorted(map(int, input().split()))
b = sorted(map(int, input().split()))
c = sorted(map(int, input().split()))
# 各中部パーツを乗せられる下部パーツの個数
b_c_cnt = [len(c[bis... |
s104064211 | p03557 | u698868214 | 1594130820 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 29532 | 479 | #入力
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
#リストをソート
A,B,C = sorted(A),sorted(B),sorted(C)
for i in range(N):
middle = 0
bottom = 0
bool1 = True
while True:
if middle == N:
break
if B[middle] > A[i]:
... |
s964912569 | p03557 | u881192043 | 1594078904 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 29228 | 817 | def binary(list_a,item):
low=0
high=len(list_a)-1
while (high-low)>1:
mid=int((low+high)/2)
tmp=list_a[mid]
if tmp>item:
high=mid
elif tmp<item:
low=mid
elif tmp==item:
eq=[i for i, x in enumerate(list_a) if x == tmp]
high=eq[-1]
low=eq[0]
return low-1,high+... |
s530241322 | p03557 | u881192043 | 1594078825 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 28276 | 879 | def binary(list_a,item):
low=0
high=len(list_a)-1
while (high-low)>1:
mid=int((low+high)/2)
tmp=list_a[mid]
if tmp>item:
high=mid
elif tmp<item:
low=mid
elif tmp==item:
eq=[i for i, x in enumerate(list_a) if x == tmp]
high=eq[-1]
low=eq[0]
return low-1,high+... |
s807465161 | p03557 | u881192043 | 1594072032 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 30144 | 828 | def binary_search(list_a,item):
low=0
high=len(list_a)-1
while low<=high:
mid=int((low+high)/2)
guss=list_a[mid]
if guss>item:
high=mid-1
elif guss<item:
low=mid+1
elif guss==item:
return mid
return mid
def main():
N=int(input())
A=sorted(list(map(int,input().split()))... |
s221444966 | p03557 | u064881889 | 1593820987 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 32352 | 989 | import sys
def main():
n = sys.stdin.readline()
astr = sys.stdin.readline()
bstr = sys.stdin.readline()
cstr = sys.stdin.readline()
a = list(map(int, astr.strip().split(' ')))
b = list(map(int, bstr.strip().split(' ')))
c = list(map(int, cstr.strip().split(' '... |
s849834715 | p03557 | u812286971 | 1593573430 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8888 | 155 | from bisect from bisect_left
def search(li, x):
None
n = int(input())
li = [[] for i in range(3)]
for i in range(3):
li[i] = input.split()
print(li) |
s871238469 | p03557 | u125348436 | 1593493225 | Python | Python (3.8.2) | py | Runtime Error | 258 | 32560 | 570 | n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
al=sorted(a)
bl=sorted(b)
cl=sorted(c)
abl=[0]*n
bcl=[0]*n
i=n-1
for j in range(n-1,-1,-1):
while al[i]>=bl[j]:
i-=1
if i==-1:
break
if i==-1:
abl[j]=0
else... |
s052403072 | p03557 | u125348436 | 1593408928 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 29012 | 585 | n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
al=sorted(a)
bl=sorted(b)
cl=sorted(c)
print(al)
print(bl)
print(cl)
j=0
k=0
ans=0
saved_j=0
saved_k=0
for i in range(n):
j=saved_j
while al[i]>=bl[j]:
j+=1
saved_j=j
#print("j"... |
s858741460 | p03557 | u090406054 | 1593020313 | Python | Python (3.8.2) | py | Runtime Error | 89 | 29604 | 360 | n=int(input())
abc=[list(map(int,input().split())) for i in range(3)]
sum=0
for _ in range(n):
abc[1].append(abc[0][i])
abc[1].sort()
abc[2].sort()
p=abc[1].index(abc[0][i])
for k in range(p+1,n):
abc[2].append(a[1][k])
q=abc[2].index(abc[1][k])
sum+=n-q-1
abc[1].remove(abc[0][i])
abc[2].r... |
s320221160 | p03557 | u952656646 | 1592877926 | Python | Python (3.8.2) | py | Runtime Error | 139 | 29372 | 254 | 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_left(A, b)
c = bisect_right(C, b)
ans += a*(N-c)
print(ans) |
s453422477 | p03557 | u493520238 | 1592685601 | Python | PyPy3 (7.3.0) | py | Runtime Error | 188 | 106040 | 296 | import bisect
n = int(input())
al = list(map(int,input().split())).sort()
bl = list(map(int,input().split())).sort()
cl = list(map(int,input().split())).sort()
ans = 0
for b in bl:
a_num = bisect.bisect_left(al,b)
c_num = n - bisect.bisect_right(cl,b)
ans += a_num*c_num
print(ans) |
s031947112 | p03557 | u169696482 | 1592339916 | Python | Python (3.4.3) | py | Runtime Error | 88 | 23360 | 212 | import bisect
n = int(input())
A = list(map(int, input().split()))
B= list(map(int, input().split()))
C= list(map(int, input().split()))
print(sum(bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) for b in B)) |
s655550691 | p03557 | u277236383 | 1592007536 | Python | Python (3.4.3) | py | Runtime Error | 394 | 24180 | 387 | 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()
bc = [0]*n
bc[n-1]=n-bisect.bisect_right(c, b[n-1])
for i in range(0,n-1):
bc[n-2-i]=bc[n-1-i] + n-bisect.bisect_right(c, b[n-2-i])
ans = 0
for i i... |
s687370317 | p03557 | u781262926 | 1591736482 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 332 | import bisect
from collections import accumulate
n, *ABC = map(int, open(0).read().split())
A, B, C = ABC[:n], ABC[n:2*n], ABC[2*n:3*n]
A.sort()
B.sort()
C.sort()
D = [bisect.bisect_left(A, b) for b in B]
E = [bisect.bisect_left(B, c) for c in C]
F = list(accumulate(D))
s = 0
for e in E:
if e != 0:
s += F[e... |
s711858601 | p03557 | u789565565 | 1591732536 | Python | Python (3.4.3) | py | Runtime Error | 197 | 23328 | 270 | N =int(input())
lisA =list(map(int,input().split()))
lisB = list(map(int,input().split()))
lisC = list(map(int,input().split()))
lisA.sort()
lisB.sort()
lisC.sort()
cnt = 0
for b in lisB:
cnt+= bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))
print(cnt) |
s074803392 | p03557 | u789565565 | 1591732423 | Python | Python (3.4.3) | py | Runtime Error | 195 | 23328 | 270 | N =int(input())
lisA =list(map(int,input().split()))
lisB = list(map(int,input().split()))
lisC = list(map(int,input().split()))
lisA.sort()
lisB.sort()
lisC.sort()
cnt = 0
for b in lisB:
cnt+= bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))
print(cnt) |
s338356806 | p03557 | u789565565 | 1591732305 | Python | Python (3.4.3) | py | Runtime Error | 199 | 23160 | 240 | N =int(input())
lisA =sorted(list(map(int,input().split())))
lisB = sorted(list(map(int,input().split())))
lisC = sorted(list(map(int,input().split())))
print(sum(bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))for b in lisB)) |
s286212642 | p03557 | u789565565 | 1591732266 | Python | Python (3.4.3) | py | Runtime Error | 201 | 24096 | 240 | N =int(input())
lisA =sorted(list(map(int,input().split())))
lisB = sorted(list(map(int,input().split())))
lisC = sorted(list(map(int,input().split())))
print(sum(bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))for b in lisB)) |
s575377092 | p03557 | u789565565 | 1591732166 | Python | Python (3.4.3) | py | Runtime Error | 90 | 23328 | 217 | N =int(input())
lisA = list(map(int,input().split()))
lisB = list(map(int,input().split()))
lisC = list(map(int,input().split()))
print(sum(bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))for b in lisB)) |
s958539794 | p03557 | u945359338 | 1591416353 | Python | Python (3.4.3) | py | Runtime Error | 211 | 24096 | 289 | 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 range(N):
b = B[i]
a = bisect.bisect_left(A,b)
c = bisect.bisect_right(C,b)
ans+=(a*(len(C)-c))
print(ans) |
s907035450 | p03557 | u847923740 | 1591306134 | Python | PyPy3 (2.4.0) | py | Runtime Error | 399 | 110692 | 407 | # ABC077C
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())))
bC=[0 for i in range(N)]
for i in range(N):
bC[i]=N-bisect.bisect(C,B[i])
bCS=[0]*N+1
for i in range(N):
bCS[i+1] = bCS[i]+bC[i]
ans=0
fo... |
s731270780 | p03557 | u282978698 | 1591066022 | Python | PyPy3 (2.4.0) | py | Runtime Error | 337 | 104548 | 521 | N = int(input())
Lists = []
ans = 0
for _ in range(3):
s = [int(e) for e in input().split()]
s.sort()
print(Lists)
def a(right,left,i,j):
global ans
while(right >= left):
mid =int(left + (right-left) / 2)
if(i>=Lists[j][mid]):
left = mid + 1
else:
right = ... |
s997047906 | p03557 | u282978698 | 1591065929 | Python | PyPy3 (2.4.0) | py | Runtime Error | 349 | 104548 | 535 | N = int(input())
Lists = []
ans = 0
for _ in range(3):
s = [int(e) for e in input().split()]
s.sort()
print(Lists)
def binary(right,left,i,j):
global ans
while(right >= left):
mid =int(left + (right-left) / 2)
if(i>=Lists[j][mid]):
left = mid + 1
else:
rig... |
s471875412 | p03557 | u748241164 | 1590168951 | Python | PyPy3 (2.4.0) | py | Runtime Error | 355 | 107108 | 297 | N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
import bisect
ans = 0
for b in range(B):
k = bisect.bisect_left(A, b)
l = bisect.bisect_right(C, b)
ans += k * (N -l)
print(ans)
|
s252136799 | p03557 | u391589398 | 1590118989 | Python | Python (3.4.3) | py | Runtime Error | 1479 | 24008 | 617 | n = int(input())
A = sorted(tuple(map(int, input().split())))
B = tuple(map(int, input().split()))
C = sorted(tuple(map(int, input().split())))
count = 0
for b in B:
# Aの候補
la = -1
ra = n
while (ra - la) > 1:
mid = (la+ra)//2
if A[mid] > b:
ra = mid
else:
... |
s867399559 | p03557 | u391589398 | 1590118928 | Python | Python (3.4.3) | py | Runtime Error | 1592 | 24096 | 634 | n = int(input())
A = sorted(tuple(map(int, input().split())))
B = tuple(map(int, input().split()))
C = sorted(tuple(map(int, input().split())))
count = 0
for b in B:
# Aの候補
la = -1
ra = n
while (ra - la) > 1:
mid = (la+ra)//2
if A[mid] > b:
ra = mid
else:
... |
s647288973 | p03557 | u625007136 | 1590092901 | Python | Python (3.4.3) | py | Runtime Error | 981 | 23472 | 1132 | import sys
input = sys.stdin.readline
def binary_search(xs,target,maxlen,low,high,reverse=True):
middle = 0
while(low <= high):
middle = (low + high) // 2
can = xs[middle]
if can == target:
if reverse == False:
return middle
else:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.