Problem p02780 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N, K = map(int, input().split())
    P = list(map(int, input().split()))

    tmp_max = sum(P[:K])
    tmp = sum(P[:K])
    for i in range(N-K):
        tmp += P[i+K]
        tmp -= P[i]

        if tmp > tmp_max:
            tmp_max = tmp

    print((tmp_max + K) / 2)

main()

Buggy submission (verdict: Runtime Error):
n,k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
a = []
for i in range(len(p)-k):
  mx = sum(p[:i+k]) - sum(p[:i])
  a.append(mx)
max_a = max(a)
ans = (max_a + k)/2
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
a = []
for i in range(len(p)-k):
  mx = p[i+k] - p[i]
  a.append(mx)
max_a = max(a)
ans = (max_a + k)/2
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
a = []
for i in range(len(c)-k):
  mx = c[i+k] - c[i]
  a.append(mx)
max_a = max(a)
ans = (max_a + k)/2
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
  a = p[i:i+k]
  ans = (max(ans,sum(a))
  if i+k == n:
       break
       
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
  a = p[i:i+k]
  ans (max(ans,sum(a))
  if i+k == n:
       break
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
P = list(map(int, input().split()))
a = []
i = 0
While K+i <= N:
  k = P[i:K+i]
  a.append(k)
  i += 1
a_max = max(a)
print((a_max+K)/2)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
p = list(map(int,input().split()))
array = []

for i in range(N-K):
a = sum(p[:K+i])-sum(p[:i])
array.append(a)

max_a = max(array)

ans=(max_a)
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
A = list(map(int, input().split()))
for a in A:
a = (1+a)/2
sumK = []

for i in range(len(A)):
  b = A[i:i+K]
  sumK.append(sum(b))
print(max(sumK))

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
A = [map(int, input().split())]
for a in A:
a = (1+a)/2
sumK = []
for i in range(len(A)):
  b = A[i:i+K]
  sumK.append(sum(b))
print(max(sumK))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(int,input().split()))

a =[]
for i in range(n-k):
  sum_k = sum(p[i:i+k])
  a.append(sum_k)
ans = (max(a)+k)/2

print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(int,input().split()))

a =[]
for i in range(n-k):
  sum_k = sum(p[i:i+k])
  a.apprnd(sum_k)
ans = (max(a)+k)/2

print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
p = list(map(int,input().split()))
array = []

for i in range(N-K):
a=sum(p[i:K+i])
array.append(a)

max_a = max(array)

ans=(max_a)
print(ans)

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
P = list(map(int,input().split()))
ans = 0
import itertools
import math
cnt_nPk = math.factorial(n)/math.factorial(k)
P_nPk = list(itertools.permutations(n,k))

sum_P_nPk = sum(P_nPk)

print(sum_P_nPk / cnt_nPk)

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
P = list(map(int,input().split()))
ans = 0
import itertools
import math
cnt_nPk = math.factorial(n)/math.factorial(k)
P_nPk = list(itertools.permutations(n,k))

for i in range(n):
  a = sum(P_nPk[i])
  ans += a

print(ans / cnt_nPk)

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
P = [map(int,input().split())]
ans = 0
import itertools
import math
cnt_nPk = math.factorial(n)/math.factorial(k)
P_nPk = list(itertools.permutations(n,k))

for i in range(n):
  a = sum(P_nPk[i])
  ans += a

print(ans / cnt_nPk)