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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s343914306 | p03776 | u074220993 | 1597669864 | Python | Python (3.8.2) | py | Runtime Error | 39 | 10964 | 478 | import statistics
import math
N, A, B = map(int, input().split())
v = [int(x) for x in input().split()]
v.sort()
base = v[N-A:]
rem = v[:N-A]
mean_max = statistics.mean(base)
cnb = 0
while mean_max == statistics.mean(base) or not len(rem) == 0:
same = base.count(base[0])
extra = rem.count(base[0])
cnb += m... |
s715579051 | p03776 | u074220993 | 1597669770 | Python | Python (3.8.2) | py | Runtime Error | 40 | 10960 | 457 | import statistics
import math
N, A, B = map(int, input().split())
v = [int(x) for x in input().split()]
v.sort()
base = v[N-A:]
rem = v[:N-A]
mean_max = statistics.mean(base)
cnb = 0
while mean_max == statistics.mean(base):
same = base.count(base[0])
extra = rem.count(base[0])
cnb += math.factorial(same+ex... |
s984905469 | p03776 | u332657092 | 1597512892 | Python | PyPy3 (7.3.0) | py | Runtime Error | 81 | 74148 | 406 | from math import factorial
n, a, b = map(int, input().split())
V = sorted(map(int, input().split()), reverse=True)
av = sum(V[:a]) / a
print(av)
num = V[a]
m = V.count(num)
k = V[:a].count(num)
#print(m, k, a)
if a != k:
ans = factorial(m) // (factorial(k) * factorial(m - k))
else:
ans = 0
for i in range(... |
s368134842 | p03776 | u699522269 | 1595688908 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8996 | 17 | 4 2 3
10 20 10 10 |
s334330418 | p03776 | u145231176 | 1595603759 | Python | PyPy3 (7.3.0) | py | Runtime Error | 174 | 83748 | 1965 | 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,... |
s528248525 | p03776 | u145231176 | 1595603080 | Python | PyPy3 (7.3.0) | py | Runtime Error | 195 | 77876 | 2023 | 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,... |
s245182097 | p03776 | u145231176 | 1595602529 | Python | PyPy3 (7.3.0) | py | Runtime Error | 219 | 83600 | 1915 | 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,... |
s765459887 | p03776 | u054514819 | 1595383547 | Python | PyPy3 (7.3.0) | py | Runtime Error | 91 | 74564 | 637 | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N, A, B = mapint()
Vs = list(mapint())
Vs.sort(reverse=True)
from collections import defaultdict, Counter
from scipy.special import comb
count = defaultdict(int)
c = Counter(Vs)
ans ... |
s132759142 | p03776 | u617515020 | 1595296340 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9248 | 437 | N,A,B=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
a=v[:A]
b=v[:B]
avg=sum(a)/A
print(avg)
c=[[0]*51 for _ in range(51)]
c[0][0]=1
for i in range(50):
c[i+1][0]=1
c[i+1][i+1]=1
for j in range(i):
c[i+1][j+1]=c[i][j]+c[i][j+1]
if a[0]==a[-1]:
ans=0
x=v.count(a[0])
for i ... |
s557485618 | p03776 | u375616706 | 1595125064 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74476 | 1412 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e18;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, a, b) for (int i = b - 1; i >= a; i--)
#define int ll
using pint = pair<int, int>;
signed main() {
int n, a, b;
cin >> n >> a >> b;
double v[n];
map<d... |
s133145438 | p03776 | u375616706 | 1595123716 | Python | PyPy3 (7.3.0) | py | Runtime Error | 96 | 74864 | 995 | from collections import Counter
from math import factorial
def comb(n,r):
return factorial(n)//factorial(r)//factorial(n-r)
N,A,B = map(int,input().split())
V=list(map(int,input().split()))
V_C=Counter(V)
max_val=max(V)
CC=V_C[max_val]
if A<=CC<=B:
ans=0
for v in range(A,min(B,CC)+1):
ans+=comb(... |
s590907558 | p03776 | u375616706 | 1595123523 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 74768 | 1135 | from collections import Counter
from math import factorial
from operator import mul
from functools import reduce
def comb(n,r):
r = min(n-r,r)
if r == 0: return 1
over = reduce(mul, range(n, n - r, -1))
under = reduce(mul, range(1,r + 1))
return over // under
N,A,B = map(int,input().split())
V=lis... |
s222754064 | p03776 | u375616706 | 1595123184 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 74856 | 1081 | from collections import Counter
from math import factorial
from operator import mul
from functools import reduce
def comb(n,r):
r = min(n-r,r)
if r == 0: return 1
over = reduce(mul, range(n, n - r, -1))
under = reduce(mul, range(1,r + 1))
return over // under
N,A,B = map(int,input().split())
V=lis... |
s832768865 | p03776 | u375616706 | 1595123078 | Python | PyPy3 (7.3.0) | py | Runtime Error | 104 | 74484 | 869 | from collections import Counter
from math import factorial
from scipy.special import comb
N,A,B = map(int,input().split())
V=list(map(int,input().split()))
V_C=Counter(V)
max_val=max(V)
CC=V_C[max_val]
if A<=CC<=B:
ans=0
for v in range(A,min(B,CC)+1):
ans+=comb(CC,v)
print(max_val)
print(ans)
... |
s160937169 | p03776 | u375616706 | 1595122285 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 74832 | 806 | from collections import Counter
from math import factorial
N,A,B = map(int,input().split())
V=list(map(int,input().split()))
V_C=Counter(V)
max_val=max(V)
CC=V_C[max_val]
if A<=CC<=B:
ans=0
for v in range(A,min(B+1,CC+1)):
ans+=factorial(CC)//factorial(v)//factorial(CC-v)
print(max_val)
print(... |
s606911446 | p03776 | u375616706 | 1595122256 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 74740 | 790 | from collections import Counter
from math import factorial
N,A,B = map(int,input().split())
V=list(map(int,input().split()))
V_C=Counter(V)
max_val=max(V)
CC=V_C[max_val]
if A<=CC<=B:
ans=0
for v in range(A,min(B+1,CC+1)):
ans+=factorial(CC)//factorial(v)//factorial(CC-v)
print(max_val)
print(... |
s530213610 | p03776 | u375616706 | 1595120078 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74768 | 389 | from collections import Counter
N,A,B = map(int,input().split())
V=list(map(int,input().split()))
V_C=Counter(V)
tmp_sum=0
tmp_num=0
for key in sorted(V_C.keys(),reverse=True):
val = V_C[val]
if tmp_num+val<=B:
tmp_num+=val
tmp_sum+=key*val
if tmp_num>=A:
break
else:
#Aๅใซใชใใพใง... |
s856576449 | p03776 | u514687406 | 1594873951 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9348 | 460 | import sys
import collections
input = lambda: sys.stdin.readline()
exec("try:sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w')\nexcept:pass")
n, a, b = map(int, input().split())
A = list(map(int, input().split()))
d = collections.Counter(A)
A.sort(reverse=1)
ans = []
for i in range(a, b):
ans.appen... |
s636139620 | p03776 | u633450100 | 1591737125 | Python | Python (3.4.3) | py | Runtime Error | 158 | 13172 | 746 | if __name__ == '__main__':
from collections import Counter
from scipy.mist import comb
N,A,B = [int(i) for i in input().split()]
V = [int(i) for i in input().split()]
V.sort(reverse = True)
max_list = [V[0:A]]
max = sum(V[0:A]) / A
for i in range(A+1,B+1):
a = sum(V[0:i]) / i
... |
s853085645 | p03776 | u633450100 | 1591737061 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3316 | 748 | if __name__ == '__main__':
from collections import Counter
from mist.special import comb
N,A,B = [int(i) for i in input().split()]
V = [int(i) for i in input().split()]
V.sort(reverse = True)
max_list = [V[0:A]]
max = sum(V[0:A]) / A
for i in range(A+1,B+1):
a = sum(V[0:i]) / ... |
s541597532 | p03776 | u633450100 | 1591735571 | Python | Python (3.4.3) | py | Runtime Error | 181 | 14328 | 598 | if __name__ == '__main__':
from collections import Counter
from scipy.special import comb
N,A,B = [int(i) for i in input().split()]
V = [int(i) for i in input().split()]
V.sort(reverse = True)
max_list = V[0:A]
max = sum(V[0:A]) / A
for i in range(A+1,B+1):
a = sum(V[0:i]) / i... |
s594994583 | p03776 | u991134049 | 1591453863 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 38512 | 715 | from operator import mul
from functools import reduce
def cmb(n,r):
r = min(n-r,r)
if r == 0: return 1
over = reduce(mul, range(n, n - r, -1))
under = reduce(mul, range(1,r + 1))
return over // under
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v = sorted(v)
maxv = sum(v... |
s854919498 | p03776 | u991134049 | 1591453313 | Python | PyPy3 (2.4.0) | py | Runtime Error | 189 | 38384 | 697 | from operator import mul
from functools import reduce
def cmb(n,r):
r = min(n-r,r)
if r == 0: return 1
over = reduce(mul, range(n, n - r, -1))
under = reduce(mul, range(1,r + 1))
return over // under
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v = sorted(v)
maxv = sum(v... |
s067792342 | p03776 | u922449550 | 1590556324 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 672 | comb_memo = {}
def comb(n, r):
global comb_memo
if (n, r) in comb_memo:
return comb_memo[(n, r)]
else:
r = min(r, n-r)
res = 1
for _ in range(r):
res *= n
n -= 1
for i in range(1, r+1):
res //= i
comb_memo[(n, r)] = res
comb_memo[(n, n-r)] = res
return res
N, A, ... |
s426246337 | p03776 | u922449550 | 1590555809 | Python | Python (3.4.3) | py | Runtime Error | 1300 | 689908 | 791 | import sys
sys.setrecursionlimit(10**9)
f_memo = {0:1, 1:1}
def f(x):
global f_memo
if x in f_memo:
return f_memo[x]
else:
res = x * f(x-1)
f_memo[x] = res
return res
comb_memo = {}
def comb(n, r):
global comb_memo
if (n, r) in comb_memo:
return comb_memo[(n, r)]
else:
a = f(n)
... |
s276813812 | p03776 | u922449550 | 1590555741 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3972 | 750 | f_memo = {0:1, 1:1}
def f(x):
global f_memo
if x in f_memo:
return f_memo[x]
else:
res = x * f(x-1)
f_memo[x] = res
return res
comb_memo = {}
def comb(n, r):
global comb_memo
if (n, r) in comb_memo:
return comb_memo[(n, r)]
else:
a = f(n)
b = f(n-r)
c = f(r)
res = a // b... |
s037637007 | p03776 | u497952650 | 1590106199 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 409 | nCr = {}
def cmb(n, r):
if r == 0 or r == n: return 1
if r == 1: return n
if (n,r) in nCr: return nCr[(n,r)]
nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
return nCr[(n,r)]
N,A,B = map(int,input().split())
v = sorted(list(map(int,input().split())),reverse=True)
if len(set(v)) == 1:
print(xx)
m = sum... |
s336506512 | p03776 | u497952650 | 1590106162 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 419 | nCr = {}
def cmb(n, r):
if r == 0 or r == n: return 1
if r == 1: return n
if (n,r) in nCr: return nCr[(n,r)]
nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
return nCr[(n,r)]
N,A,B = map(int,input().split())
v = sorted(list(map(int,input().split())),reverse=True)
if len(set(v)) == 1:
print(xx)
m = sum... |
s228749389 | p03776 | u993435350 | 1589845119 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3688 | 908 | from operator import mul
from functools import reduce
N,A,B = map(int,input().split())
V = sorted(list(map(int,input().split())),reverse = True)
a = A - 1
top = V[0]
ans = 0
if top == V[a]:
d = 1
for i in range(a,N):
if V[i] != top:
b = i
break
if A == B:
n = reduce(mul,[t for t in range(A,... |
s099430643 | p03776 | u993435350 | 1589842481 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 782 | import itertools
import collections
from operator import mul
from functools import reduce
N,A,B = map(int,input().split())
V = sorted(list(map(int,input().split())),reverse = True)
a = A - 1
top = V[0]
ans = 0
if top == V[a]:
d = 1
for i in range(1,B + 1):
if V[i] != top:
B = i
break
for i in ra... |
s444955217 | p03776 | u993435350 | 1589839470 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3692 | 707 | import itertools
import collections
from operator import mul
from functools import reduce
N,A,B = map(int,input().split())
V = sorted(list(map(int,input().split())),reverse = True)
ans = 0
if len(set(V)) == 1:
d = reduce(mul,[i for i in range(1,A)])
for i in range(A,B + 1):
n = 1
d *= i
for j in rang... |
s345692310 | p03776 | u993435350 | 1589836241 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3684 | 755 | import itertools
import collections
from operator import mul
from functools import reduce
N,A,B = map(int,input().split())
V = sorted(list(map(int,input().split())),reverse = True)
total = 0
pattern = 0
if len(set(V)) == 1:
for i in range(1,B):
c = 1
for j in range(B,B - i,-1):
c *= j
d = [t for ... |
s799039276 | p03776 | u250795848 | 1589753011 | Python | PyPy3 (2.4.0) | py | Runtime Error | 183 | 38640 | 403 | import sys
def main():
input = sys.stdin.readline
N, K = map(int, input().split())
count = 0
d = []
l = {}
for i in range(N):
a,b = map(int, input().split())
d.append(a)
l[a] = b
d.sort()
for i in d:
count += l[i]
if count >= K:
pr... |
s191443705 | p03776 | u250795848 | 1589708986 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38384 | 2367 | import sys
from collections import deque
import math
import numpy as np
def main():
def perm(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
input = sys.stdin.readline
N, A, B = map(int, input().split())
d = [0] * N
q = []
d[:] = map(int, input().spl... |
s466126951 | p03776 | u250795848 | 1589708790 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38384 | 2350 | import sys
from collections import deque
import math
import numpy as np
def main():
def perm(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
input = sys.stdin.readline
N, A, B = map(int, input().split())
d = [0] * N
q = []
d[:] = map(int, input().spl... |
s095608351 | p03776 | u600402037 | 1588299728 | Python | Python (3.4.3) | py | Runtime Error | 154 | 12648 | 683 | # coding: utf-8
import sys
import numpy as np
from math import factorial
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, A, B = lr()
V = np.array(lr(), np.float64)
V.sort()
V = V[::-1]
Vcum = V.cumsum()
ave = Vcum / np.arange(1, N+1)
ma = ave[A-1:B].max()... |
s406456664 | p03776 | u600402037 | 1588299622 | Python | Python (3.4.3) | py | Runtime Error | 148 | 12512 | 689 | # coding: utf-8
import sys
import numpy as np
from math import factorial
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, A, B = lr()
V = np.array(lr(), np.float64)
V.sort()
V = np.flip(V)
Vcum = V.cumsum()
ave = Vcum / np.arange(1, N+1)
ma = ave[A-1:B].ma... |
s366870997 | p03776 | u871980676 | 1588299205 | Python | Python (3.4.3) | py | Runtime Error | 188 | 14432 | 868 | from scipy.special import comb
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v = sorted(v,reverse=True)
# (ๅ่จ, ๅๆฐ)
max_avg = (sum(v[:A]), A)
t = v[A-1]
num1 = v[:A].count(t)
num2 = v[A:].count(t)
fact = [0]*(N+1)
ifact = [0]*(N+1)
inv = [0]*(N+1)
p=170141183460469231731687303715884105727
d... |
s876360709 | p03776 | u342075214 | 1588298415 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 1021 | #include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define int long long
const int MOD=1e9+7;
const int INF=1e15;
map<int,int> lar;
signed main(){
int N,A,B;cin>>N>>A>>B;
vector<int>V(N);
REP(i,N)cin>>V[i... |
s045129940 | p03776 | u995062424 | 1588218147 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 848 | from collections import Counter
import math
def main():
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
c = Counter(v)
base = 0
num = []
for i in range(min(A, B)):
base += v[i]
if not v[i] in num:
num.append(v[i])... |
s980478257 | p03776 | u995062424 | 1588216875 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3316 | 857 | from collections import Counter
import math
def main():
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
c = Counter(v)
base = 0
num = []
for i in range(min(A, B)):
base += v[i]
if not v[i] in num:
num.append(v[i])... |
s911022222 | p03776 | u995062424 | 1588213728 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 815 | from collections import Counter
import math
def main():
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
c = Counter(v)
base = 0
num = []
for i in range(min(A, B)):
base += v[i]
if not v[i] in num:
num.append(v[i])... |
s047306483 | p03776 | u531436689 | 1584632864 | Python | PyPy3 (2.4.0) | py | Runtime Error | 333 | 66284 | 1404 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque, Counter
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ret... |
s996968872 | p03776 | u531436689 | 1584632758 | Python | PyPy3 (2.4.0) | py | Runtime Error | 306 | 66924 | 1399 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque, Counter
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ret... |
s033898235 | p03776 | u600402037 | 1582526209 | Python | Python (3.4.3) | py | Runtime Error | 149 | 12392 | 743 | import sys
import numpy as np
from math import factorial
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, A, B = lr()
V = np.array(lr())
V.sort()
if A == 1:
ave = V[-A]
else:
ave = V[-A:].sum() / A
print(ave)
left_i = np.searchsorted(V, V[-A], side... |
s856126152 | p03776 | u457901067 | 1580859776 | Python | Python (3.4.3) | py | Runtime Error | 31 | 3828 | 784 | from operator import mul
from functools import reduce
from math import sqrt
def cmb(n,r):
r = min(n-r,r)
if r == 0: return 1
over = reduce(mul, range(n, n - r, -1))
under = reduce(mul, range(1,r + 1))
return over // under
N, A, B = list(map(int, input().split()))
V = list(map(int, input().split())... |
s715833724 | p03776 | u557494880 | 1580175676 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 520 | from math import factorial
def combi(n,r):
return factorial(n) / factorial(r) / factorial(n - r)
N,A,B = map(int,input().split())
V = list(map(int,input().split()))
V.sort()
x = V[-1]
ans = 0
for i in range(1,A+1):
ans += V[-i]
x = V[-i]
ans = ans/A
print(ans)
count = 0
import bisect
y = N - bisect.bisect(V... |
s739109977 | p03776 | u329407311 | 1579749882 | Python | Python (3.4.3) | py | Runtime Error | 160 | 13172 | 649 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s630968654 | p03776 | u329407311 | 1579749785 | Python | Python (3.4.3) | py | Runtime Error | 183 | 14348 | 661 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s627297752 | p03776 | u329407311 | 1579749694 | Python | Python (3.4.3) | py | Runtime Error | 174 | 13424 | 647 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s701704400 | p03776 | u329407311 | 1579749638 | Python | Python (3.4.3) | py | Runtime Error | 205 | 14572 | 659 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s924486749 | p03776 | u329407311 | 1579749571 | Python | Python (3.4.3) | py | Runtime Error | 196 | 15220 | 603 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s239219629 | p03776 | u329407311 | 1579749533 | Python | Python (3.4.3) | py | Runtime Error | 164 | 13172 | 634 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s727504353 | p03776 | u329407311 | 1579749492 | Python | Python (3.4.3) | py | Runtime Error | 159 | 13172 | 653 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s321484602 | p03776 | u329407311 | 1579749459 | Python | Python (3.4.3) | py | Runtime Error | 174 | 14060 | 654 | import bisect
import math
from scipy.misc import comb
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num... |
s303182783 | p03776 | u329407311 | 1579747942 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 580 | import bisect
import math
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num2 = N - bisect.bisect_right(... |
s545739080 | p03776 | u329407311 | 1579747723 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 616 | import bisect
import math
N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)
mini = List[A-1]
ans = 0
if List[A-1] != List[A]:
ans = sum(List[:A])/A
print(ans)
print(1)
else:
num = List.count(List[A-1])
List = sorted(List)
num2 = N - bisect.bisect_right(... |
s189599458 | p03776 | u970197315 | 1579358589 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3316 | 906 | # ABC057 D - Maximum Average Sets
from collections import defaultdict
from math import factorial
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
def perm(n,r):
return factorial(n)//factorial(n-r)
def comb(n,r):
return perm(n,r)/... |
s436928922 | p03776 | u970197315 | 1579325500 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 1052 | # ABC057 D - Maximum Average Sets
from collections import defaultdict
from math import factorial
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
def perm(n,r):
return factorial(n)//factorial(n-r)
def comb(n,r):
return perm(n,r)/... |
s539549220 | p03776 | u970197315 | 1579323584 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 942 | # ABC057 D - Maximum Average Sets
from collections import defaultdict
from math import factorial
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
def perm(n,r):
return factorial(n)//factorial(n-r)
def comb(n,r):
return perm(n,r)/... |
s064804894 | p03776 | u989345508 | 1578585352 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 893 | import math
#from scipy.special import comb
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def groupby(a):
a2=[[a[0],1]]
for i in range(1,len(a)):
if a2[-1][0]==a[i]:
a2[-1][1]+=1
else:
a2.append([a[i],1])
re... |
s192637337 | p03776 | u989345508 | 1578584666 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 918 | import math
#from scipy.special import comb
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def groupby(a):
a2=[[a[0],1]]
for i in range(1,len(a)):
if a2[-1][0]==a[i]:
a2[-1][1]+=1
else:
a2.append([a[i],1])
re... |
s819804454 | p03776 | u989345508 | 1578584188 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 868 | import math
#from scipy.special import comb
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def groupby(a):
a2=[[a[0],1]]
for i in range(1,len(a)):
if a2[-1][0]==a[i]:
a2[-1][1]+=1
else:
a2.append([a[i],1])
re... |
s238062325 | p03776 | u989345508 | 1578582187 | Python | Python (3.4.3) | py | Runtime Error | 160 | 15240 | 936 | import math
from scipy.special import comb
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def groupby(a):
a2=[[a[0],1]]
for i in range(1,len(a)):
if a2[-1][0]==a[i]:
a2[-1][1]+=1
else:
a2.append([a[i],1])
retu... |
s908097803 | p03776 | u380933932 | 1578460185 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 683 | nab=list(map(int,input().split()))
v=list(map(int,input().split()))
v.sort(reverse=True)
vmin=v[:nab[1]]
print(sum(vmin)/len(vmin))
mini=1
if len(vmin)>1:
for i in range(nab[1]):
if vmin[-2-i]==vmin[-1]:
mini+=1
else:
break
ex=0
if nab[1]<nab[2]:
for i in range(nab[0]-nab... |
s147600407 | p03776 | u380933932 | 1578460085 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 691 | nab=list(map(int,input().split()))
v=list(map(int,input().split()))
v.sort(reverse=True)
vmin=v[:nab[1]]
print(sum(vmin)/len(vmin))
mini=1
if len(vmin)>1:
for i in range(nab[1]):
if vmin[-2-i]==vmin[-1]:
mini+=1
else:
break
ex=0
if nab[1]<nab[2]:
for i in range(nab[0]-nab... |
s285874084 | p03776 | u380933932 | 1578459882 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 555 | nab=list(map(int,input().split()))
v=list(map(int,input().split()))
v.sort(reverse=True)
vmin=v[:nab[1]]
print(sum(vmin)/len(vmin))
mini=1
if len(vmin)>1:
for i in range(nab[1]):
if vmin[-2-i]==vmin[-1]:
mini+=1
else:
break
ex=0
if nab[1]<nab[2]:
for i in range(nab[0]-nab... |
s096444141 | p03776 | u380933932 | 1578459220 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 590 | nab=list(map(int,input().split()))
v=list(map(int,input().split()))
v.sort(reverse=True)
vmin=v[:nab[1]]
print(sum(vmin)/len(vmin))
mini=1
if len(vmin)>1:
for i in range(nab[1]):
if vmin[-2-i]==vmin[-1]:
mini+=1
else:
break
ex=0
if nab[1]<nab[2]:
for i in range(nab[0]-nab... |
s805983031 | p03776 | u314089899 | 1576903284 | Python | Python (3.4.3) | py | Runtime Error | 175 | 14360 | 787 | #57d
from bisect import bisect_left, bisect_right
from scipy.special import comb
N,A,B = map(int, input().split())
v_list = [int(e) for e in input().split()]
v_list.sort(reverse = True)
print(sum(v_list[0:A])/A)
min_value = v_list[A-1]
v_list.sort(reverse=False)
min_value_left = bisect_left(v_list, min_value)
min_v... |
s532018081 | p03776 | u777068250 | 1576902791 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 701 | def count(v,n,x):
result = 0
for i in range(n):
if v[i] == x:
result += 1
return result
def getAverage(v,a):
result = 0
for i in range(a):
result += v[i]
return result/a
choose = [[1]*51 for i in range(51)]
for i in range(1,51):
for j in range(1,i):
choo... |
s153569506 | p03776 | u503283842 | 1576881574 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 864 | def ncr(x,y):
ans=1
q=x-y
while x>y:
ans*=x
x=x-1
while q>1:
ans=ans/q
q=q-1
return ans
x=input().split()
n=int(x[0])
a=int(x[1])
b=int(x[2])
v=[0]*n
x = input().split()
ind=0
M={1:0}
M2={1:0}
for i in x:
v[ind]=int(i)
if int(i) in M:
M[v[ind]]+=1
else:
M[v[ind]]=1
ind+=1
v.sort(reverse=True)
... |
s405678621 | p03776 | u503283842 | 1576880211 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 818 | def ncr(x,y):
ans=1
q=x-y
while x>y:
ans*=x
x=x-1
while q>1:
ans=ans/q
q=q-1
return ans
x=input().split()
n=int(x[0])
a=int(x[1])
b=int(x[2])
v=[0]*n
x = input().split()
ind=0
M={1:0}
M2={1:0}
for i in x:
v[ind]=int(i)
if int(i) in M:
M[v[ind]]+=1
else:
M[v[ind]]=1
ind+=1
v.sort(reverse=True)
... |
s710182437 | p03776 | u254871849 | 1576827563 | Python | Python (3.4.3) | py | Runtime Error | 209 | 15196 | 632 | import sys
from bisect import bisect_left as bi_l, bisect_right as bi_r
import scipy.special
def comb(n, r):
return scipy.special.comb(n, r, exact=True)
n, a, b, *v = map(int, sys.stdin.read().split())
def main():
v.sort()
ma = v[n-a:n]
yield sum(ma) / a
lo = ma[0]
hi = ma[-1]
res = 0
... |
s997298436 | p03776 | u905582793 | 1576568102 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 578 | from math import factorial
import bisect
def cmb(n,r):
if n<0 or r<0:
return 0
else:
return factorial(n)//factorial(n-r)//factorial(r)
n,a,b=map(int,input().split())
x = list(map(int,input().split()))
ans=0
x.sort(reverse=True)
print(sum(x[:a])/a)
if n==a:
print(1)
elif x[0]==x[a]:
for i in range(n):
... |
s700836926 | p03776 | u905582793 | 1576567942 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 556 | from math import factorial
import bisect
def cmb(n,r):
if n<0 or r<0:
return 0
else:
return factorial(n)//factorial(n-r)//factorial(r)
n,a,b=map(int,input().split())
x = list(map(int,input().split()))
ans=0
x.sort(reverse=True)
print(sum(x[:a])/a)
if x[0]==x[a]:
for i in range(n):
if x[0] != x[i]:
... |
s662564195 | p03776 | u905582793 | 1576567490 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 413 | from math import factorial
def cmb(n,r):
if n<0 or r<0:
return 0
else:
return factorial(n)//factorial(n-r)//factorial(r)
n,a,b=map(int,input().split())
x = list(map(int,input().split()))
ans=0
x.sort(reverse=True)
print(sum(x[:a])/a)
if x[0]==x[a]:
for i in range(n):
if x[0] != x[i]:
k=i
b... |
s870480191 | p03776 | u332906195 | 1576348306 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 39152 | 474 | from math import factorial
N, A, B = map(int, input().split())
V = sorted(list(map(int, input().split())), reverse=True)
print(sum(V[:A]) / A)
if V[0] == V[A - 1]:
n = sum([1 for v in V if v == V[0]])
print(sum([factorial(n) // factorial(r) // factorial(n - r)
for r in range(A, B + 1)]))
else:
... |
s398103417 | p03776 | u864197622 | 1575866633 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38256 | 674 | N, W = map(int, input().split())
w0, v0 = map(int, input().split())
X = [[] for _ in range(4)]
X[0].append(v0)
for _ in range(N-1):
w, v = map(int, input().split())
X[w-w0].append(v)
X = [[0] + sorted(x)[::-1] for x in X]
for i in range(4):
for j in range(1, len(X[i])):
X[i][j] += X[i][j-1]
ma = 0
... |
s234378300 | p03776 | u595716769 | 1575357580 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 474 | import math
def pcount(n, r):
return math.factorial(n) // (math.factorial(r)* math.factorial(n - r))
n, a, b = map(int, input().split())
L = [int(i) for i in input().split()]
L.sort(reverse=True)
T = L[:a]
print(sum(T)/a)
s = 0
Tmin = min(T)
countTminT = T.count(Tmin)
countTminL = L.count(Tmin)
if a == 1 and co... |
s383884854 | p03776 | u383828019 | 1575081646 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 851 | import math
nab = [int(x) for x in input().split()]
n = nab[0]
a = nab[1]
b = nab[2]
counts = []
nums = [int(x) for x in input().split()]
means = []
nums.sort(reverse = True)
for i in range(a, b+1):
#means.append(sum(nums[:i])/i)
j = i
while j<n:
if nums[j-1]==nums[j]:
j+=1
else:
brea... |
s349804672 | p03776 | u761529120 | 1574909387 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38896 | 849 | from operator import mul
from functools import reduce
def cmb(n,r):
r = min(n-r,r)
if r == 0: return 1
over = reduce(mul, range(n, n - r, -1))
under = reduce(mul, range(1,r + 1))
return over // under
def main():
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
so... |
s474753341 | p03776 | u682985065 | 1574229604 | Python | Python (3.4.3) | py | Runtime Error | 191 | 14604 | 357 | from scipy.special import comb
n, a, b = map(int,input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
max_avg = sum(v[:a]) / a
min_v = min(v[:a])
ans = 0
for i in range(a, b+1):
if max_avg != sum(v[:i]) / i: break
cnt1 = v[:i].count(min_v)
cnt2 = v.count(min_v)
ans += comb(cnt2, ... |
s677631256 | p03776 | u923659712 | 1573758908 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 416 | import math
n,a,b=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
x.reverse()
j=a+1
moto=0
h=0
d=x[a-1]
asd=0
l=x.count(d)
for i in range(a):
moto+=x[i]
if x[i]==x[a-1]:
h+=1
print(moto/a)
if x[0]==x[a-1]:
for i in range(a,b+1):
asd+=math.factorial(l)//(math.factorial(l-i)*math.factori... |
s819198624 | p03776 | u923659712 | 1573758870 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 418 | import math
n,a,b=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
x.reverse()
j=a+1
moto=0
h=0
d=x[a-1]
asd=0
l=x.count(d)
for i in range(a):
moto+=x[i]
if x[i]==x[a-1]:
h+=1
print(moto/a)
if moto/a==x[a-1]:
for i in range(a,b+1):
asd+=math.factorial(l)//(math.factorial(l-i)*math.facto... |
s352702594 | p03776 | u819048695 | 1573405223 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38512 | 917 | n,a,b=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
ans=0
for i in range(a):
ans+=v[i]
ans/=a
k=a-1
count=1
while k<=n-2:
if v[k]==v[k+1]:
count+=1
k+=1
continue
else:
break
k=a-1
cnt=1
while k>=1:
if v[k]==v[k-1]:
count+=1
... |
s414195253 | p03776 | u883574098 | 1571646785 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38640 | 805 | from collections import Counter
def binomialCoeff(n , k):
C = [0 for i in range(k+1)]
C[0] = 1
for i in range(1,n+1):
j = min(i ,k)
while (j>0):
C[j] = C[j] + C[j-1]
j -= 1
return C[k]
n,x,b=map(int,input().split())
mp={}
a=list(map(int,input().split()... |
s018294610 | p03776 | u883574098 | 1571645471 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 611 | from collections import Counter
def binomialCoeff(n , k):
if k==0 or k ==n :
return 1
return binomialCoeff(n-1 , k-1) + binomialCoeff(n-1 , k)
n,x,b=map(int,input().split())
mp={}
a=list(map(int,input().split()))
mp=Counter(a)
a=list(set(a))
a.sort()
ss=0
pq=0
op=0
tot=0
for i in range(len(a)-1,-1,... |
s953068621 | p03776 | u883574098 | 1571645434 | Python | PyPy3 (2.4.0) | py | Runtime Error | 163 | 38512 | 611 | from collections import Counter
def binomialCoeff(n , k):
if k==0 or k ==n :
return 1
return binomialCoeff(n-1 , k-1) + binomialCoeff(n-1 , k)
n,x,b=map(int,input().split())
mp={}
a=list(map(int,input().split()))
mp=Counter(a)
a=list(set(a))
a.sort()
ss=0
pq=0
op=0
tot=0
for i in range(len(a)-1,-1,... |
s045676733 | p03776 | u626337957 | 1567723590 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 610 | N, A, B = map(int, input().split())
nums = list(map(int, input().split()))
nums.sort(reverse=True)
least = nums[A-1]
cnt = 1
for i in range(A-1)[::-1]:
if nums[i] == least:
cnt += 1
need = cnt
for i in range(A, B+1):
if nums[i] == least:
cnt += 1
else:
break
nCr = {}
def cmb(n, r):
if r == 0 or r ... |
s614967906 | p03776 | u644778646 | 1567716116 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38640 | 803 | def nck(n, k):
ret = 1
for i in range(min(n - k, k)):
ret *= (n - i)
ret /= (i + 1)
return ret
def main():
n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v = sorted(v, reverse=True)
d = defaultdict(int)
for i in range(n):
d[v[i]] += 1
... |
s414680401 | p03776 | u606045429 | 1567690075 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 262 | def divisors(N):
U = int(N ** 0.5)
L = [i for i in range(1, U) if N % i == 0]
C = [U] if M % U == 0 else []
R = [N // r for r in reversed(L)]
return L + C + R
N, M = map(int, input().split())
print(max(d for d in divisors(M) if d * N <= M))
|
s732641947 | p03776 | u017810624 | 1567539327 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 611 | import math
n,a,b=map(int,input().split())
v=list(map(int,input().split()))
v.sort()
v.reverse()
if a==n:
print(sum(v)/n)
print(1)
elif v[a-1]!=v[a]:
print(sum(v[0:a])/a)
print(1)
elif v[0]!=v[a-1]:
print(sum(v[0:a])/a)
ct1=0;ct2=0
for i in range(n):
if v[i]==v[a-1]:
ct1+=1
if i<a:
... |
s839483608 | p03776 | u603253967 | 1565623513 | Python | Python (3.4.3) | py | Runtime Error | 186 | 14400 | 750 | from collections import defaultdict, deque, Counter
import sys
from scipy.special import comb
import heapq
import math
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
def main():
N, A, B = [int(a) for a in input().split()]
V = sorted([int(a) for a in input().spli... |
s001023287 | p03776 | u838644735 | 1565553363 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38640 | 935 | import math
N, A, B = map(int, input().split())
V = list(map(int, input().split()))
# print(N, A, B, V)
V.sort(reverse=True)
max_list = V[:A]
max_sum = sum(max_list)
print(max_sum / A)
replace = max_list[-1]
num_replace = 0
for v in V:
if v == replace:
num_replace += 1
if num_replace == 1:
print(... |
s048959846 | p03776 | u918935103 | 1564891394 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 735 | n,a,b = map(int,input().split())
v = list(map(int,input().split()))
v.sort()
ans1 = 0
for i in range(a):
ans1 = ans1 + v[n-1-i]
ans = ans1/a
if v[n-a] != v[n-a-1]:
print(ans)
print("1")
else:
if v[n-a] < v[n-1]:
count = 1
for i in range(n-a):
if v[i] == v[n-a]:
... |
s729445418 | p03776 | u532966492 | 1564468638 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38256 | 450 | from statistics import mean
from collections import Counter
n,a,b=map(int,input().split())
v=sorted(list(map(int,input().split())),reverse=True)
avg=mean(v[:a])
print(avg)
p=Counter(v[:a])[v[a]]
q=Counter(v)[v[a]]
def n_func(n):
ans=1
for i in range(1,n+1):ans=(ans*i)
return ans
def nCr(n,r):
return ... |
s715053431 | p03776 | u761529120 | 1563502903 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 782 | from math import factorial
def combinations_count(n, r):
''' ็ตใฟๅใใ '''
return factorial(n) // (factorial(n - r) * factorial(r))
def max_ave():
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
sort_v = sorted(v, reverse=True)
# ๅนณๅใฎๆๅคงๅคใๆฑใใ
sum_A = 0
for i in range... |
s117627945 | p03776 | u170201762 | 1561740188 | Python | Python (3.4.3) | py | Runtime Error | 190 | 14628 | 538 | from scipy.special import comb
N,A,B = map(int,input().split())
v = list(map(int,input().split()))
v.sort(reverse=True)
ans = 0
if v[A-1] == v[0]:
mean = v[0]
count = 0
for i in range(N):
if v[i] == v[0]:
count += 1
for i in range(A,min(B,count)+1):
ans += comb(count,i,exact... |
s012008357 | p03776 | u204236873 | 1560572330 | Python | Python (3.4.3) | py | Runtime Error | 153 | 12516 | 1413 | from sys import stdin
import operator as op
import numpy
import math
def combination_table(N):
C = []
for i in range(N+1):
C.append([0] * (N+1))
for i in range(N+1):
for j in range(i+1):
if (j==0 or j==i):
C[i][j] = 1
else:
C[i][j] = C[i-1][j-1]+C[i-1][j]
return C
if __name__ == "__main__":
N, ... |
s500952531 | p03776 | u204236873 | 1560570662 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3688 | 1256 | from sys import stdin
import operator as op
from functools import reduce
def nCr(n, r):
r = min(r, n-r)
numer = reduce(op.mul, range(n, n-r, -1), 1)
denom = reduce(op.mul, range(1, r+1), 1)
return numer / denom
if __name__ == "__main__":
N, A, B = stdin.readline().split(" ")
N = int(N)
A = int(A)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.