Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

x = np.arange(N)

print(np.sum(x))

Fixed submission:
N = int(input())
if N % 2 == 0:
    ans = (N+1)*(N//2)
    ans -= N
    print(ans)
else:
    x = (N+1)//2
    ans = x + x * ((N-1)//2) * 2
    ans -= N
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())


print(sum(range(N)))

Fixed submission:
N = int(input())
if N % 2 == 0:
    ans = (N+1)*(N//2)
    ans -= N
    print(ans)
else:
    x = (N+1)//2
    ans = x + x * ((N-1)//2) * 2
    ans -= N
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections as col
N = int(input())
l = [input() for _ in range(N)]
count = 0
for i in range(N):
    c = col.Counter(str(l[i]))
    for j in range(i+1, N):
        d = col.Counter(str(l[j]))
        if c == d:
            count += 1
print(count)

Fixed submission:
N = int(input())
l = [input() for _ in range(N)]
ans = 0
dic = {}
for n in range(N):
    new = sorted(l[n])
    if not str(new) in dic:
        count = 1
        dic[str(new)] = count
    else:
        ans += dic[str(new)]
        dic[str(new)] += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
H[1] -= 1
for i in range(1, N-1):
    if H[i-1] > H[i] or H[i] > H[i+1]:
        H[i] -= 1
        if H[i-1] > H[i] or H[i] > H[i+1]:
            print("No")
            break
        else:
            continue
else:
    print("Yes")

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
for i in range(N-1):
    if H[i] - H[i+1] > 1:
        print("No")
        quit()

for i in range(1, N-1):
    if H[i] > H[i+1] or H[i-1] < H[i]:
        H[i] -= 1
        if H[i-1] > H[i] or H[i] > H[i+1]:
            print("No")
            break
    else:
        continue
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N = int(stdin.readline().rstrip())
num_line = [stdin.readline().rstrip() for _ in range(N)]
for i in range(N):
    save_num = num_line[i]
    num_line.pop(i)
    print(max(num_line))
    num_line.insert(i, save_num)

Fixed submission:
N = int(input())
num_line = [int(input()) for _ in range(N)]
sort_line = sorted(num_line)
for i in num_line:
    if i == sort_line[N-1]:
        print(sort_line[N-2])
    else:
        print(sort_line[N-1])

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N = int(stdin.readline().rstrip())
num_line = [stdin.readline().rstrip() for _ in range(N)]
for i in range(N):
    save_num = num_line[i]
    num_line.pop(i)
    print(max(num_line))
    num_line.insert(i, save_num)

Fixed submission:
N = int(input())
num_line = [int(input()) for _ in range(N)]
sort_line = sorted(num_line)
for i in num_line:
    if i == sort_line[N-1]:
        print(sort_line[N-2])
    else:
        print(sort_line[N-1])

Buggy python submission (verdict: Runtime Error):
import sys

N = int(stdin.readline().restrip())
num_line = [stdin.readline().restrip() for _ in range(N)]
for i in range(N):
    save_num = num_line[i]
    num_line.pop(i)
    print(max(num_line))
    num_line.insert(i, save_num)

Fixed submission:
N = int(input())
num_line = [int(input()) for _ in range(N)]
sort_line = sorted(num_line)
for i in num_line:
    if i == sort_line[N-1]:
        print(sort_line[N-2])
    else:
        print(sort_line[N-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys

N = int(input())
num_line  =[]
for e in map(int, sys.stdin):
    num_line.append(e)
for i in range(N):
    save_num = num_line[i]
    num_line.pop(i)
    print(max(num_line))
    num_line.insert(i, save_num)

Fixed submission:
N = int(input())
num_line = [int(input()) for _ in range(N)]
sort_line = sorted(num_line)
for i in num_line:
    if i == sort_line[N-1]:
        print(sort_line[N-2])
    else:
        print(sort_line[N-1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
num_line = [int(input()) for _ in range(N)]
for i in range(N):
    save_num = num_line[i]
    num_line.pop(i)
    print(max(num_line))
    num_line.insert(i, save_num)

Fixed submission:
N = int(input())
num_line = [int(input()) for _ in range(N)]
sort_line = sorted(num_line)
for i in num_line:
    if i == sort_line[N-1]:
        print(sort_line[N-2])
    else:
        print(sort_line[N-1])
Buggy python submission (verdict: Runtime Error):
print(sum(sorted(input().split())[:2]))

Fixed submission:
print(sum(sorted(list(map(int, input().split())))[:2]))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())

l = [list(map(int, input().split())) for _ in range(M)]
l = np.array(l)
ans = list(range(l[:, 0].max(), l[:, 1].min() + 1))
print(len(ans))

Fixed submission:
import numpy as np
N, M = map(int, input().split())

l = [list(map(int, input().split())) for _ in range(M)]
l = np.array(l)
ans = list(range(l[:, 0].max(), l[:, 1].min() + 1))
print(len(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(M)]
 
 
ans = set(range(l[0][0], l[0][1] + 1))
for i in range(1, M):
    ans = ans.intersection(set(range(l[i][0], l[i][1] + 1)))
print(len(ans))

Fixed submission:
import numpy as np
N, M = map(int, input().split())

l = [list(map(int, input().split())) for _ in range(M)]
l = np.array(l)
ans = list(range(l[:, 0].max(), l[:, 1].min() + 1))
print(len(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(M)]


ans = set(range(l[0][0], l[0][1] + 1))
for i in range(1, M):
    ans = ans.intersection(set(range(l[i][0], l[i][1] + 1)))
print(len(ans))

Fixed submission:
import numpy as np
N, M = map(int, input().split())

l = [list(map(int, input().split())) for _ in range(M)]
l = np.array(l)
ans = list(range(l[:, 0].max(), l[:, 1].min() + 1))
print(len(ans))
Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
#S = list(input())
ans = []
for i in range(1, N+1):
    if i < K:
        ans.append(1/N * (0.5) ** (math.ceil(math.log2(K/i))))
    else:
        ans.append(1/N)
print(sum(ans))

Fixed submission:
import math
N, K = map(int, input().split())
#S = list(input())
ans = []
for i in range(1, N+1):
    if i < K:
        ans.append(1/N * (0.5) ** (math.ceil(math.log2(K/i))))
    else:
        ans.append(1/N)
print(sum(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
ans = []
for i in range(Q):
    l, r = map(int, input().split())
    T = S[l-1:r]
    ans.append(T.count('AC'))
print(*ans, sep='\n')

Fixed submission:
N, Q = map(int, input().split())
S = input()
T = [0]*(N+1)

for i in range(1, N):
    T[i+1] = T[i] + (1 if S[i-1:i+1]=='AC' else 0)
ans = []
for _ in range(Q):
    l, r = map(int, input().split())
    ans.append(T[r] - T[l])
print(*ans, sep='\n')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
A, B = map(int, input().split())
l = max(len(bin(A)[2:]), len(bin(B)[2:]))
arr = np.zeros(l)
ans = 0
for i in range(A, B+1):
    c = np.array(list(map(int, bin(i)[2:])))
    arr[l-len(c):] += c
arr = (arr % 2).astype(np.int8)
ans = int(''.join(map(str, arr)), base=2)
print(ans)


Fixed submission:
def F(N):
    if ((N+1) // 2) % 2 == 0:
        bit = 0
    else:
        bit = 1
    if N % 2 == 0:
        return bit ^ N
    else:
        return bit

A, B = map(int, input().split())
ans = F(A-1) ^ F(B)
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
A, B = map(int, input().split())
l = max(len(bin(A)[2:]), len(bin(B)[2:]))
arr = np.zeros(l)
ans = 0
for i in range(A, B+1):
    c = np.array(list(map(int, bin(i)[2:])))
    arr[l-len(c):] += c
arr = np.flip(arr % 2)
for i in range(l):
    if arr[i] != 0:
        ans += 2 ** i
print(ans)

Fixed submission:
def F(N):
    if ((N+1) // 2) % 2 == 0:
        bit = 0
    else:
        bit = 1
    if N % 2 == 0:
        return bit ^ N
    else:
        return bit

A, B = map(int, input().split())
ans = F(A-1) ^ F(B)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int, input().split())
l = max(len(bin(A)), len(bin(B)))
ans = A
for i in range(A+1, B+1):
    ans = i ^ ans
print(ans)

Fixed submission:
def F(N):
    if ((N+1) // 2) % 2 == 0:
        bit = 0
    else:
        bit = 1
    if N % 2 == 0:
        return bit ^ N
    else:
        return bit

A, B = map(int, input().split())
ans = F(A-1) ^ F(B)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [10**10] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])

Fixed submission:
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [10**10] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [np.Infinity] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])

Fixed submission:
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [10**10] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [np.Infinity] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])

Fixed submission:
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [10**10] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [math.inf] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])

Fixed submission:
N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [10**10] * N
dp[0] = 0
for i in range(1, N):
    for j in range(1, K+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
input = input().split()
count = 0
for num in input:
  if num == "7":
    count += 1

if count = 1:
  print("YES")
else:
  print("NO")


Fixed submission:
input = input().split()
count = 0
for num in input:
  if num == "7":
    count += 1
 
if count == 1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A = [int(x) for x in input().split()]

ans =A[0]

for i in A[1:]:

    ans = ans * i

if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys
n=int(input())
A = [int(x) for x in input().split()]
bar = 10**18
ans =A[0]
if 0 in A:
    print(0)
    sys.exit()
    
for i in A[1:]:
    ans = ans * i
    if ans > bar:
        print(-1)
        sys.exit()
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k = map(int,input().split())
ans = 0
for aa in range(a):
    k -=1
    ans+=1
    if k == 0:
        print(ans)
        exit()
for bb in range(b):
        k -=1
        if k == 0:
            print(ans)
            exit()
for bb in range(c):
        k -=1
        ans -= 1
        if k == 0:
            print(ans)
            exit()

Fixed submission:
a,b,c,k = map(int,input().split())
aa=a
if k == 0:
    print(0)
elif a > k:
    print(k)
elif a+b >= k:
    print(a)
else:
    ab = a+b
    ans = aa-(k-ab)
    print(ans)
Buggy python submission (verdict: Runtime Error):
N,M= list(map(int, input().split())) 
H = list(map(int, input().split())) 
A = [0]*M
B = [0]*M

for i in range(M):
    A[i], B[i]= map(int, input().split())
    
ans = []*N
for i in range(M):
    a = A[i]-1
    b = B[i]-1
    if H[a] < H[b]:
        ans[a]=1
    elif H[a] > H[b]:
        ans[b]=1
    else:
        ans[a]=0
        ans[b]=0
print(ans.count(1))

Fixed submission:
N,M= list(map(int, input().split())) 
H = list(map(int, input().split())) 
A = [0]*M
B = [0]*M
ans = [1]*N

for i in range(M):
    A[i], B[i]= map(int, input().split())
    

for i in range(M):
    a = A[i]-1
    b = B[i]-1
    if H[a] < H[b]:
        ans[a]=0
    elif H[a] > H[b]:
        ans[b]=0
    else:
        ans[a]=0
        ans[b]=0
        
print(ans.count(1))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A= list(map(int, input().split())) 
ans = 0
for i in range(N):
    for j in range(N):
        L = i - A[j]
        R = A[i] + j
        if L==R:
            ans +=1
            
print(ans)
    




Fixed submission:
N=int(input())
A= [0]+list(map(int, input().split())) 

from collections import defaultdict
d = defaultdict(int)

ans = 0
for i in range(N,0,-1):
    ans += d[A[i]+i]
    d[i-A[i]] += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d = map(int,input().split())

while True:

    cd = c - b
    if cd <= 0:
        print('Yes')
        break
    
    ad = a - d 
    if ad <= 0:
        print('No')
        break


Fixed submission:
import math
a,b,c,d = map(int,input().split())

cb = -(-c//b)
ad = -(-a//d)
if ad < cb :
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

while True:

    cd = c - b
    if cd <= 0:
        print('Yes')
        break
    
    ad = a - d 
        if ad <= 0:
        print('No')
        break


Fixed submission:
import math
a,b,c,d = map(int,input().split())

cb = -(-c//b)
ad = -(-a//d)
if ad < cb :
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        mods[current % 2019] += 1
        x = x * 10 % 2019
    
    for i in len(mods):
        ans += mods[i] * (mods[i]-1)//2
    print(ans)
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        ans += mods[current % 2019]
        mods[current % 2019] += 1
        x = x * 10 % 2019
    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        mods[current % 2019] += 1
        x = x * 10 %2019
    
    for i in len(mods):
        ans += mods[i] * (mods[i]-1)//2
print(ans)
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        ans += mods[current % 2019]
        mods[current % 2019] += 1
        x = x * 10 % 2019
    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        mods[current % 2019] += 1
        x = x * 10 %2019
    
    for i in len(mods):
        ans += mods[i] * (mods[i]-1)//2
 
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        ans += mods[current % 2019]
        mods[current % 2019] += 1
        x = x * 10 % 2019
    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        ans += mods[current % 2019]
        mods[current % 2019] += 1
        x = x * 10 
        
    print(ans)
 
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        ans += mods[current % 2019]
        mods[current % 2019] += 1
        x = x * 10 % 2019
    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = list(int(input()))

if 7 in n:
  print("Yes")
else:
  print("No")

Fixed submission:
n= input()

if ("7" in n):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
      jj = math.gcd(i,j)
        for k in range(1,n+1):
            ans+=math.gcd(jj,k)
print(ans)

Fixed submission:
from math import gcd
n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=gcd(gcd(i,j),k)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    while b!=0:
        a, b = b,a%b
    return a

n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=gcd(gcd(i,j),k)
print(ans)

Fixed submission:
from math import gcd
n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=gcd(gcd(i,j),k)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=math.gcd(math.gcd(i,j),k)
print(ans)

Fixed submission:
from math import gcd
n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=gcd(gcd(i,j),k)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
ans=0
runrun = 0
i =1
while runrun < K:
    if i < 10:
        runrun +=1
        ans = i
    else:
        a = list(map(int,str(i)))
        for j in range(1,len(a)):
            tmp = 0
            if abs(a[j]-a[j-1])<=1:
                tmp +=1
        if tmp == len(a)-1:
            runrun +=1
            ans = i 
    i +=1
print(ans)
          


Fixed submission:
k=int(input())
cand=[[1,2,3,4,5,6,7,8,9]]
for _ in range(9): #上記の操作を9回繰り返せば10^5個以上のルンルン数を列挙できる
 tmp=[]
 for val in cand[-1]:
   if val%10!=0: #末尾が0のときは(末尾-1)を付け加えた数はルンルン数にならない
     tmp.append(val*10+(val%10-1))
   tmp.append(val*10+(val%10))
   if val%10!=9: #末尾が9のときは(末尾+1)を付け加えた数はルンルン数にならない
     tmp.append(val*10+(val%10+1))
 cand.append(tmp)
ans=[]
for i in range(len(cand)):
 for val in cand[i]:
   ans.append(val)
ans=sorted(ans)
print(ans[k-1])

Buggy python submission (verdict: Runtime Error):
ans=0
runrun = 0
i =0
while runrun = K:
    if i < 10:
        runrun +=1
    else:
        a = list(map(int,str(i)))
        for j in range(1,len(a)):
            tmp = 0
            if abs(a[j]-a[j-1])<=1:
                tmp +=1
        if tmp == len(a)-1:
            runrun +=1
            ans = i
    i +=1
print(ans)

                


Fixed submission:
k=int(input())
cand=[[1,2,3,4,5,6,7,8,9]]
for _ in range(9): #上記の操作を9回繰り返せば10^5個以上のルンルン数を列挙できる
 tmp=[]
 for val in cand[-1]:
   if val%10!=0: #末尾が0のときは(末尾-1)を付け加えた数はルンルン数にならない
     tmp.append(val*10+(val%10-1))
   tmp.append(val*10+(val%10))
   if val%10!=9: #末尾が9のときは(末尾+1)を付け加えた数はルンルン数にならない
     tmp.append(val*10+(val%10+1))
 cand.append(tmp)
ans=[]
for i in range(len(cand)):
 for val in cand[i]:
   ans.append(val)
ans=sorted(ans)
print(ans[k-1])
Buggy python submission (verdict: Runtime Error):
K,N = map(int,input().split())
A = list(map(int,input().split()))

S = [0]*(N+1)

for i in range(N):
    if i==N:
        S[i+1] = A[i] - K + A[0]
    else:
        S[i+1] = A[i+1] - A[i]

Smax = S.index(max(S))

ans = sum(S)-S[Smax]
print(ans)

Fixed submission:
K,N = map(int,input().split())
A = list(map(int,input().split()))

S = [0]*(N)

for i in range(N):
      
    if i==N-1:
        S[i] = K + A[0] -A[i]
    else:
        S[i] = A[i+1] - A[i]

Smax = S.index(max(S))

ans = sum(S)-S[Smax]
print(ans)
Buggy python submission (verdict: Runtime Error):

import numpy as np
n =int(input())
a = list(map(float,input().split()))


b = sum(np.reciprocal(a))

print(np.reciprocal(b))

Fixed submission:
import numpy as np
n =int(input())
a = list(map(float,input().split()))

b = sum(np.reciprocal(a))

print(np.reciprocal(b))
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N,M = list(map(int,input().split()))
H = list(map(int,input().split()))

# 展望台から行ける展望台の高さを格納しておく
from collections import defaultdict
d = defaultdict(int)
for i in range(M):
  A,B = list(map(int,input().split()))
  A -= 1
  B -= 1
  if d[A] < H[B]:
    d[A] = H[B]:
  if d[B] < H[A]:
    d[B] = H[A]
cnt = 0
for idx,h in enumerate(H):
  if d[idx] == 0 or h < d[idx]:
    cnt += 1
else:
  print(cnt)

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

N,M = list(map(int,input().split()))
H = list(map(int,input().split()))

# 展望台から行ける展望台の高さを格納しておく
from collections import defaultdict
d = defaultdict(int)
for i in range(M):
  A,B = list(map(int,input().split()))
  A -= 1
  B -= 1
  if d[A] < H[B]:
    d[A] = H[B]
  if d[B] < H[A]:
    d[B] = H[A]
cnt = 0
for idx,h in enumerate(H):
  if d[idx] == 0 or h > d[idx]:
    cnt += 1
else:
  print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split()))
import numpy as np
get_DP  = [[-np.inf for i in range(3)] for j in range(N)]
pass_DP = [[-np.inf for i in range(3)] for j in range(N)]
for i in range(N):
    # 常にとるやつ
    get_DP[i][0] = (pass_DP[i-1][0] if i>0 else 0) + S[i] 
    pass_DP[i][0] = get_DP[i-1][0]
    if i>0:
        get_DP[i][1] = (pass_DP[i-1][1] if i!=1 else 0) + S[i]
        pass_DP[i][1] = max(pass_DP[i-1][0], get_DP[i-1][1])
    if i>1:
        get_DP[i][2] = (pass_DP[i-1][2] if i!=2 else 0) + S[i]
        pass_DP[i][2] = max(pass_DP[i-1][1], get_DP[i-1][2])

    
print(max(get_DP[-1]))

Fixed submission:
N = int(input())
S = list(map(int,input().split()))
import numpy as np
get_DP  = [[-np.inf for i in range(3)] for j in range(N)]
pass_DP = [[-np.inf for i in range(3)] for j in range(N)]
for i in range(N):
    # 常にとるやつ
    get_DP[i][0] = (pass_DP[i-1][0] if i>0 else 0) + S[i] 
    pass_DP[i][0] = get_DP[i-1][0]
    if i>0:
        get_DP[i][1] = (pass_DP[i-1][1] if i!=1 else 0) + S[i]
        pass_DP[i][1] = max(pass_DP[i-1][0], get_DP[i-1][1])
    if i>1:
        get_DP[i][2] = (pass_DP[i-1][2] if i!=2 else 0) + S[i]
        pass_DP[i][2] = max(pass_DP[i-1][1], get_DP[i-1][2])

    
print(max(get_DP[-1]+pass_DP[-1][:1+N%2]))