Problem p02780 (python)

Fixed submission:
N,K = map(int,input().split())
P = list(map(int,input().split()))
for i in range(N):
  P[i] = (P[i]+1)/2
now = sum(P[:K])
ans = now
for j in range(N-K):
  now = now - P[j] + P[j+K]
  ans = max(ans,now)
print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
N,K = map(int,input().split())
P = list(map(int,input().split()))
ans = []
for i in range(N):
  P[i] = (P[i]+1)/2
hope = list(accumulate(P))
 
for j in range(N-K):
  ans.append(hope[j+K]-hope[j])
print(max(ans))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = list(map(int,input().split()))
for i in range(N):
  P[i] = (P[i]+1)/2
R = sum(Q[:K])
ans = R
for j in range(N-K):
  R = R - P[j] + P[j+K]
  ans = max(ans,R)
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = list(map(int,input().split()))
Q = []*N
for i in range(N):
  Q[i] = (P[i]+1)/2
R = sum(Q[:K])
ans = R
for j in range(N-K):
  R = R - Q[j] + Q[j+K]
  ans = max(ans,R)
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = [int(input()) for i in range(N)]
Q = []*N
for i in range(N):
  Q[i] = (P[i]+1)/2
R = sum(Q[:K])
ans = R
for j in range(N-K):
  R = R - Q[j] + Q[j+K]
  ans = max(ans,R)
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = [int(input()) for i in range(N)]
Q = []*N
for i in range(N):
  Q[i] = (P[i]+1)/2
R = 0
for j in range(K):
  R += Q[j]
for k in range(N-K):
  R = R - Q[k] + Q[k+K]
  ans = max(R)
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = [int(input()) for i in range(N)]
Q = []*N
for i in range(N):
  Q[i] = (P[i]+1)/2
R = 0
for j in range(K):
  R += Q[j]
for k in range(N-K)
  R = R - Q[k] + Q[k+K]
  ans = max(R)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
P = list(map(int,input().split()))
for i in range(N):
  P[i] = (P[i]+1)/2
now = sum(P[:K])
ans = now
for j in range(N-K):
  ans = ans - P[j] + P[j+K]
  ans = max(ans,now)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
P = list(map(int,input().split()))
for i in range(N):
  P[i] = (i+1)/2
now = sum(P[:K])
ans = now
for j in range(N-K):
  ans = ans - P[j] + P[j+K]
  ans = max(ans,now)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
P = list(map(int,input().split()))
for i in range(N):
  P[i] = (i+1)/2
now = sum(P[:K])
for j in range(N-K):
  ans = ans - P[j] + P[j+K]
  ans = max(ans,now)
  now = ans
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
P = list(map(int,input().split()))
for i in range(N):
  P[i] = (i+1)/2
now = P[:K]
for j in range(N-K):
  ans = ans - P[j] + P[j+K]
  ans = max(ans,now)
  now = ans
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = list(map(int,input().split()))
for i in range(N):
    ans = max(P[i]//0 for j in range(P[i])+P[i+1]//0 for j in range(P[i+1])+P[i+2]//0 for j in range(P[i+2]))
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = list(map(int,input().split()))
dp = []*N+1
dp[0] = 0
for i in range(N):
    ans = max(P[i]//0 for j in range(P[i])+P[i+1]//0 for j in range(P[i+1])+P[i+2]//0 for j in range(P[i+2]))
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
P = list(map(int,input().split()))
dp = []*N+1
dp[0] = 0
for i in range(N):
    dp[i+1] = max(dp[i]//P[i],dp[i+1]//P[i+1])
hope = max(dp[i:i+3])
hopes = sum(hope)