Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02837 (python)

Fixed submission:
N=int(input())
L=[[] for i in range(N)]
for i in range(N):
  M=int(input())
  L[i]=[list(map(int,input().split())) for j in range(M)]
#print(L)

L_2=[[i,None] for i in range(N)]
L_3=[0 for i in range(N)]
ans=0
for k in range(2**N):
	L_3=[0 for i in range(N)]
	Y_N=True
	count=0
	for a in range(N):
		if ((k >> a) & 1):  # 正直者のリストを作る
			L_3[a]=1
	for a in range(N):  # このループが一番のポイント
		if ((k >> a) & 1):  # 正直者のリスト
			count += 1
			for b in range(len(L[a])):
				if L_3[a] == 0: #もし正直者じゃないとされてたら
					Y_N=False #破綻
				person = L[a][b][0]-1
				if L_3[person]==1-L[a][b][1]: #すでに言われてることと矛盾
					Y_N=False #破綻
				L_3[person]=L[a][b][1] #証言の内容で人となりをアップデート
				#print(L_3,a,b)
	#print(L_3,count,Y_N)
	if Y_N:
		ans = max(ans, count)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=[[] for i in range(N)]
for i in range(N):
  M=int(input())
  L[i]=[list(map(int,input().split())) for j in range(M)]
#print(L)

L_2=[[i,None] for i in range(N)]
L_3=[0 for i in range(N)]
ans=0
for k in range(2**N):
	L_3=[0 for i in range(N)]
    Y_N=True
	count=0
	for a in range(N):
		if ((k >> a) & 1):  # 正直者のリストを作る
			L_3[a]=1
	for a in range(N):  # このループが一番のポイント
		if ((k >> a) & 1):  # 正直者のリスト
			count += 1
			for b in range(len(L[a])):
				if L_3[a] == 0: #もし正直者じゃないとされてたら
					Y_N=False #破綻
				person = L[a][b][0]-1
				if L_3[person]==1-L[a][b][1]: #すでに言われてることと矛盾
					Y_N=False #破綻
				L_3[person]=L[a][b][1] #証言の内容で人となりをアップデート
				#print(L_3,a,b)
	#print(L_3,count,Y_N)
	if Y_N:
		ans = max(ans, count)
print(ans)
Problem p02838 (python)

Fixed submission:
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log(max(max(A),1),2)) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Buggy submission (verdict: Runtime Error):
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log(max(A),2)) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Buggy submission (verdict: Runtime Error):
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log2(max(A))) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Buggy submission (verdict: Runtime Error):
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log2(max(A))) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)
Problem p02882 (python)

Fixed submission:
import math
a,b,x=map(int,input().split())
if x/a>=a*b/2:
  tangent= 2*b/a-2*x/a**3
else:
  tangent=a*b*b /(2*x)
print(math.degrees(math.atan(tangent)))

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if x==a*a*b:
  print(0)
elif x/a>=a*b/2:
  tangent= 2*b/a-2*x/a**3
else:
  tangent=a*b*b /(2*x)
print(math.degrees(math.atan(tangent)))

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if x/2>=a*b/2:
  tangent=a**2 / ((a*b-x/a)*2)
  print(90-math.atan(tangent)*180/math.pi)
else:
  tangent=2*x/(a*(b**2))
  print(90-math.atan(tangent)*180/math.pi)
Problem p02888 (python)

Fixed submission:
from bisect import bisect_left
 
N = int(input())
L = sorted(list(map(int, input().split())))
 
ans = 0
for i in range(N):
    for j in range(i + 1, N):
        a = L[i]
        b = L[j]
        idx = bisect_left(L, a + b)
        ans += idx - 1 - j
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
count = 0

for i in range(N):
  for j in range(i+1,N):
    summation = L[i] + L[j]
    subtract  = L[j] - L[i]
    D=L.copy()
    del D[j]
    del D[i]
    #E=[ D[k] for k in range(N) if k!= i and k!= j ]
    ##summationより小さいかを二分探索
    high = N-3
    low = 0
    if D[0] >= summation:
      upper = 0 #1つも満たさない
      #print(L[i],L[j],E,upper)
    elif D[-1] < summation:
      upper = N-2 #N-2個すべてOK
    else:
      while high > low+1:
        mid =(high + low) // 2
        if D[mid] >= summation: #大きすぎ
          high = mid
          # mid = low
        else: #小さすぎかちょうど
          low = mid
          # mid =high 
      upper = high
    #print("summation",summation,E,upper)
    ##subtractより大きいかを二分探索
    high = N-3
    low = 0
    if D[0] > subtract:
      lower = 0 #N-2個すべてOK
    elif D[-1] <= subtract:
      lower = N-2 #1つも満たさない
    else:
      while high > low+1:
        mid =(high + low) // 2
        if D[mid] > subtract: #大きすぎ
          high = mid
          # mid = low
        else: #小さすぎかちょうど
          low = mid 
          # mid =high 
      lower = high
    #print("subtract",subtract,E,lower)
    count += upper - lower
print(count//3)
Problem p02923 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
ans =[]
cnt = 0
if N == 1:
  print (0)
  exit()
for i in range( N-1 ):
  if H[i] >= H[i+1]:
    cnt += 1
  else:
    ans.append(cnt)
    cnt = 0
  ans.append(cnt)
print(max(ans))

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
i = 0
ans =[]
cnt = 0
for i in range( N-1 ):
  if H[i] >= H[i+1]:
    cnt += 1
  else:
    ans.append(cnt)
    cnt = 0
  ans.append(cnt)
print(max(ans))
Problem p03545 (python)

Fixed submission:
S=input()
N=len(S)
A=[int(i) for i in S]
D=["+" for i in range(N-1)]
output=S[0]
for i in range(2**N):
  C=A
  B=D
  for j in range(N-1):
    if ((i>>j)&1):
      C[j+1]= -1*int(str(S[j+1]))
      B[j]=  "-"
    else:
      C[j+1]= int(str(S[j+1]))
      B[j]=  "+"
  #print(C,B,sum(C))
  if sum(C) ==7:
    for i in range(1,N):
      output += B[i-1] + str(S[i])
    print(output+"=7")
    break

Buggy submission (verdict: Runtime Error):
S=input()
N=len(S)
A=[int(i) for i in S]
B=["+" for i in range(N-1)]
output=S[0]
for i in range(2**N):
  for j in range(1,N):
    if (i>>j)&1:
      A[j]= -1*int(str(S[j]))
      B[j]=  "-"
  #print(A,B,sum(A))
  if sum(A) ==7:
    for i in range(1,N):
      output += B[i-1] + str(S[i])
    print(output+"=7")
    break
Problem p02600 (python)

Fixed submission:
n=int(input(""))
if(n>=400 and n<=599):
        print("8")
elif(n>=600 and n<=799):
        print("7")
       
elif(n>=800 and n<=999):
        print("6")
       
elif(n>=1000 and n<=1199):
        print("5")
        
elif(n>=1200 and n<=1399):
        print("4")
       
elif(n>=1400 and n<=1599):
        print("3")
       
elif(n>=1600 and n<=1799):
        print("2")
        
elif(n>=1800 and n<=1999):
        print("1")

Buggy submission (verdict: Runtime Error):
ist=[]
starting = 400
for I in range(400,2001):
    list.append(starting)
    starting += 1
n=int(input(""))
for I in list:
    if(n>=400 and n<=599):
        print("8")
        break
    elif(n>=600 and n<=799):
        print("7")
        break
    elif(n>=800 and n<=999):
        print("6")
        break
    elif(n>=1000 and n<=1199):
        print("5")
        break
    elif(n>=1200 and n<=1399):
        print("4")
        break
    elif(n>=1400 and n<=1599):
        print("3")
        break
    elif(n>=1600 and n<=1799):
        print("2")
        break
    elif(n>=1800 and n<=1999):
        print("1")
        break
Problem p02606 (python)

Fixed submission:
L,R,d= map(int, input().split())
count=0
for I in range(L, R+1):
    if(I%d == 0):
        count= count +1
print(count)

Buggy submission (verdict: Runtime Error):
L= int(input(""))
R= int(input(""))
d= int(input(""))
count=0
for I in range(L, R+1):
    if(I%d == 0):
        count= count +1
print(count)

Buggy submission (verdict: Runtime Error):
L= int(input(""))
R= int(input(""))
d= int(input(""))
list=[]
list2=[]
for I in range(L, R+1):
    list.append(I)
for I in list:
    if(I%d == 0):
        list2.append(I)
count=0
for I in list2:
        count= count +1
print(count)
Problem p02612 (python)

Fixed submission:
N = int(input())
print(1000-N % 1000 if N % 1000 else 0)

Buggy submission (verdict: Runtime Error):
print(1000-int(input()) % 1000 if int(input()) % 1000 else 0)
Problem p02613 (python)

Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))

Buggy submission (verdict: Runtime Error):
N, *s = map(open(0).read().split())
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))

Buggy submission (verdict: Runtime Error):
N, *s = map(int, open(0).read().split())
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))

Buggy submission (verdict: Runtime Error):
N, *s = map(int, open(0).read().split()
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))
Problem p02639 (python)

Fixed submission:

l = list(map(int, input().split()))

for i in range(5):
    if l[i] == 0:
        print(i+1)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N
    for i in range(N):
        A[i] = abs(l[i] - X)
        S = A.count(0)
        if S == 0:
            print(X)
        else:
            for i in range(1, N):
                S = A.count(N)
                if S == 1:
                    if l.count(X - 1) == 0:
                        print(X - 1)
                        break
                    else:
                        print(X + 1)
                        break
                else:
                    pass
else:
    print(X)
Problem p02641 (python)

Fixed submission:
X, N, *d = map(int, open(0).read().split())
if N == 0:
    print(X)
else:
    ans = -100
    for i in range(102):
        if i not in d and abs(i - X) < abs(ans - X):
            ans = i

    print(ans)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N
    ok == 0

    for i in range(N):
        A[i] = abs(l[i] - X)

    S = A.count(0)
    if S == 0:
        print(X)
        ok = 1

    if ok == 0:
        for i in range(1, 101):
            S = A.count(i)
            if S == 0:
                print(X - 1)
                break
            if S == 1:
                if l.count(X - i) == 0:
                    print(X - i)
                    break
                else:
                    print(X + i)
                    break
            else:
                pass

else:
    print(X)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N

    for i in range(N):
        A[i] = abs(l[i] - X)

    S = A.count(0)
    if S == 0:
        print(X)
        ok = 1

    if ok != 1:
        for i in range(1, 101):
            S = A.count(i)
            if S == 0:
                print(X - 1)
                break
            if S == 1:
                if l.count(X - i) == 0:
                    print(X - i)
                    break
                else:
                    print(X + i)
                    break
            else:
                pass

else:
    print(X)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N

    for i in range(N):
        A[i] = abs(l[i] - X)

    S = A.count(0)
    if S == 0:
        print(X)

    for i in range(1, N + 1):
        S = A.count(i)
        if S == 0:
            print(X-1)
        if S == 1:
            if l.count(X - i) == 0:
                print(X - i)
                break
            else:
                print(X + i)
                break
        else:
            pass

else:
    print(X)
print(A)
Problem p02646 (python)

Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if V > W and abs(A - B) <= abs((W - V) * T):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if (abs(A-B) % abs(W-V)) == 0 and abs(A-B) >= abs((W - V) * T):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if (abs(A-B) % abs(W-V)) = 0 and abs(A-B) >= abs((W - V) * T):
    print("YES")
else:
    print("NO")
Problem p02675 (python)

Fixed submission:
N = input()
M = str(N)
K = len(M)
if N[K-1] == '2' or N[K-1] == '4' or N[K-1] == '5' or N[K-1] == '7' or N[K-1] == '9':
    print('hon')
elif N[K-1] == '0' or N[K-1] == '1' or N[K-1] == '6' or N[K-1] == '8':
    print('pon')
else:
    print('bon')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) <= K:
    print(S)
else:
    print(S[0:K]+'...')
Problem p02730 (python)

Fixed submission:
S = input()
n = len(S)
a = S[:int((n - 1) / 2)]
b = S[int((n + 1) / 2):]
if a == b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
a = len(S)
if S[:(a - 1) / 2] == S[(a + 1) / 2:]:
    print("Yes")
else:
    print("No")
Problem p02731 (python)

Fixed submission:
print(int(input())**3/27)

Buggy submission (verdict: Runtime Error):
print(float((input())**3/27))
Problem p02678 (python)

Fixed submission:
import sys
from collections import defaultdict
input = sys.stdin.readline
N, M = map(int, input().split())
g = defaultdict(list)
for i in range(M):
  a, b = map(int, input().split())
  g[a].append(b)
  g[b].append(a)
que = [1]
ans = [0 for _ in range(N+1)]
while len(que)>0:
  current = que.pop(0)
  for next in g[current]:
    if ans[next] == 0:
      que.append(next)
      ans[next] = current
print('Yes')
for i in range(2,N+1):
  print(ans[i])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
g = {}
for i in range(M):
  a, b = map(int, input().split())
  if a in g.keys():
    g[a].append(b)
  else:
    g[a] = [b]
  if b in g.keys():
    g[b].append(a)
  else:
    g[b] = [a]
ans = [0 for _ in range(N+1)]
#print(g)
current = [1]
while 0 in ans[2:]:
  #print(ans)
  for i in current:
    next = []
    #print('i',i)
    for j in g[current]:
      if ans[j] == 0:
        ans[j] = i
        next.append(j)
  current = next
print('Yes')
for i in range(2,N+1):
  print(ans[i])
Problem p02687 (python)

Fixed submission:
S = input()
ans = 'ABC'
if S == 'ABC':
  ans = 'ARC'
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
ans = 'ABC'
if S = 'ABC':
  ans = 'ARC'
print(ans)
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 'Yes'
if N == 1:
  print(ans)
else:
  for i in range(N-1):
    if i == 0:
      if H[0]-1 > H[1]:
        ans = 'No'
        break
      elif H[0]-1 == H[1]:
        H[0] -= 1
        continue
    else:
      if H[i] <= H[i+1]:
        if H[i-1]<=H[i]-1:
          H[i] -=1
        continue
      elif H[i]-1 > H[i+1]:
        ans = 'No'
        break
      elif H[i]-1 == H[i+1]:
        if H[i-1] == H[i]:
          ans = 'No'
          break
        else:
          H[i] -= 1
  print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 'Yes'
if N == 1:
  print(ans)
else:
  for i in range(N):
    if i == 0:
      if H[0]-1 > H[1]:
        ans = 'NO'
        break
      elif H[0] > H[1]:
        H[0] -= 1
    else:
      if H[i] <= H[i+1]:
        continue
      elif H[i]-1 > H[i+1]:
        ans = 'No'
        break
      elif H[i] > H[i+1]:
        if H[i-1] == H[i]:
          ans = 'No'
          break
        else:
          H[i] -= 1
  print(ans)
Problem p03386 (python)

Fixed submission:
A,B,K = map(int, input().split())
ans = []
for i in range(A, A+K):
  ans.append(i)
for i in range(B-K+1, B+1):
  ans.append(i)
ans = list(set(ans))
ans.sort(reverse=False)
for i in ans:
  if i>=A and i<=B:
    print(i)

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
ans = []
for i in range(A, A+K):
  ans.append(i)
for i in range(B-K+1, B+1):
  ans.append(i)
ans = list(set(ans)).sort(reverse=True)
for i in ans:
  if i>=A and i<=B:
    print(i)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if a%2 == 1 and b%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a%2 == 1 and b% == 1:
  print('Odd')
else:
  print('Even')
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = []
for i in A:
  cnt = 0
  while i%2 == 0:
    cnt += 1
    i /= 2
  ans.append(cnt)
print(min(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(input().split())
ans = []
for i in A:
  cnt = 0
  while i%2 == 0:
    cnt += 1
    i /= 2
  ans.append(cnt)
print(min(ans))
Problem p03813 (python)

Fixed submission:
a = int(input())
if a >= 1200:
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
a = input()
if a >= 1200:
  print('ARC')
else:
  print('ABC')
Problem p03846 (python)

Fixed submission:
import math
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
half = math.floor(N/2)
ans = 2**(half)
if N%2 == 1 and A[-1] !=0:
  ans = 0
for i in range(half):
  if A[2*i] == N-2*i-1 and A[2*i+1] == N-2*i-1:
    continue
  else:
    ans = 0
    break
print(ans%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
half = math.floor(N/2)
ans = 2**(half)
if N%2 == 1 and A[-1] !=0:
  ans = 0
for i in range(half):
  if A[2*i] == N-2*i-1 and A[2*i+1] == N-2*i-1:
    continue
  else:
    ans = 0
    break
print(ans/(10**9+7))
Problem p04029 (python)

Fixed submission:
N = int(input())
print(int(N*(N+1)/2))

Buggy submission (verdict: Runtime Error):
N = int(imput())
print(N*(N+1)/2)
Problem p02921 (python)

Fixed submission:
s=input()
t=input()
result=0
if s[:1]==t[:1]:
    result=result+1

if s[1:2]==t[1:2]:
    result=result+1

if s[2:3]==t[2:3]:
    result=result+1
print(result)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
if s[1]==1:
	print(0)
else:
  	num=1
	cost=s[0]
	while cost < s[1]:
    	num+=1
    	cost+=(s[0]-1)
print(num)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
num=1
cost=s[0]
while cost < s[1]:
    num+=1
    cost=num*s[0]-1
print(num)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
num=1
cost=s[0]
while cost < s[1]:
  num=num+1
  cost=num*s[0]-1
print(num)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
num=1
cost=s[0]
while cost < s[1]:
  num+=1
  cost=num*s[0]-1
print(num)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
num=1
cost=s[0]
while cost < s[1]:
    num+=1
    cost=num*s[0]-1
print(num)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
num=1
cost=s[0]
while cost < s[1]:
    num+=1
    cost=num*s[0]-1
print(num)
Problem p03030 (python)

Fixed submission:
N = int(input())
list = [None]*N
for i in range(N):
  s, p = input().split()
  list[i]=(i,s,int(p)*-1)
for i in sorted(list, key = lambda x: (x[1],x[2])):
  print(i[0]+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
list = [None]*N
for i in range(N):
  s, P = input().split()
  list[i]=(i,s,int(p)*-1)
for i in sorted(list, key = lambda x: (x[1],x[2])):
  print(i[0]+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
list = [None]*N
for i in range(N):
  s, P = input().split()
  list[i]=(i,s,int(p)*-1)
for i in sorted(list, key = lamda x: (x[1],x[2])):
  print(i[0]+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
list = [None]*N
for i in range(N):
  s, P = input().split()
  list[i]=(i,s,int(p)*-1)
for i in sorted(list, key = lamda x: (x[1],x[2])):
  print(i[0]+1)
Problem p03032 (python)

Fixed submission:
n,k=map(int,input().split())
v=list(map(int,input().split()))
 
ans=0
 
for a in range(50):
  for b in range(50):
    if a+b <= min(n,k):
      li=v[:a]+v[n-b:]
      sumv = sum(li)
      li.sort()
      for i in range(min(k-a-b,len(li))):
        if li[i] < 0:
          li[i] = 0
        else:
          break
      ans=max(ans,sum(li))
      
print(ans)

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

ans=0

for a in range(50):
  for b in range(50):
    if a+b <= min(n,k):
      li=v[:a]+v[n-b:]
      sumv = sum(li)
      li.sort()
      for i in range(min(k-a-b,len(li))):
        if li[i] < 0:
          li[i] = 0:
        else:
          break:
      ans=max(ans,sum(li))
      
print(ans)
Problem p03037 (python)

Fixed submission:
minlist=[]
maxlist=[]
 
n,m=map(int,input().split())
for i in range(m):
  l,r=list(map(int,input().split()))
  minlist.append(l)
  if r>0:
    maxlist.append(r)
ans=0
dif=min(maxlist)-max(minlist)
if(dif>=0):
  ans=dif+1
else:
  ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
minlist=[]
maxlist=[]

n,m=map(int,input().split())
for i in range(m):
  l,r=list(map(int,input().split()))
  minlist.append(l)
  if r>0:
    maxlist.append(r)
ans=0
dif=max(minlist)-min(maxlist)
if(diff>=0):
  ans=diff+1
else:
  ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
minlist=[]
maxlist=[]

n,m=map(int,input().split())
for i in range(m):
  l,r=list(map(int,input().split()))
  minlist.append(l)
  if r>0:
    maxlist.append(r)
ans=0
dif=max(linlist)-min(maxlist)
if(diff>=0):
  ans=diff+1
else:
  ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
for i in range(m):
  l,r=list(map(int,input().split()))
  minlist.append(l)
  if r>0:
    maxlist.append(r)
ans=0
dif=max(linlist)-min(maxlist)
if(diff>=0):
  ans=diff+1
else:
  ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
for i in range(m):
  l,r=list(map(int,input().split()))
ans=0
dif=max(l)-min(r)
if(diff>=0):
  ans=diff+1
else:
  ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
for i in range(m):
  l,r=list(map(int,input().split()))
ans=0
dif=max(l)-min(r)
if(diff>=0):
  ans=diff+1
else:
  ans=0
Problem p03059 (python)

Fixed submission:
a,b,t=map(int,input().split())
ans=int(((t+0.5)//a)*b)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
xlist=[]
ylist=[]
v=list(map(int,input().split()))
c=list(map(int,input().split()))
for i in range(n):
  if v[i]>c[i]:
    xlist.append(v[i])
    ylist.append(c[i])
ans=sum(xlist)-sum(ylist)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,t=map(input().split())
ans=0.0
ans=int(((t+0.5)//a)*b)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,t=map(int,input().split())
ans=0
ans=(((t+0.5)//a)*b
print(int(ans))

Buggy submission (verdict: Runtime Error):
a,b,t=map(input().split())
ans=0
ans=int(((t+0.5)//a)*b)
print(ans)
Problem p03060 (python)

Fixed submission:
n=int(input())
xlist=[]
ylist=[]
v=list(map(int,input().split()))
c=list(map(int,input().split()))
for i in range(n):
  if v[i]>c[i]:
    xlist.append(v[i])
    ylist.append(c[i])
ans=0
ans=sum(xlist)-sum(ylist)
print(ans)

Buggy submission (verdict: Runtime Error):
n=map(int,input().split())
xlist=[]
ylist=[]
v=list(map(int,input().split()))
c=list(map(int,input().split()))
for i in range(n):
  if v[i]>c[i]:
    xlist.append(v[i])
    ylist.append(c[i])
ans=sum(xlist)-sum(ylist)
print(ans)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if (a%2==1)and(b%2==1):
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a%2==1)&&(b%2==1):
  print('Odd')
else:
  print('Even')