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

Fixed submission:
import re
S = input().replace('?', '.')
T = input()
for i in range(len(S)-len(T), -1, -1):
    if re.match(S[i:i+len(T)], T):
        S = S.replace('.', 'a')
        print(S[:i]+T+S[i+len(T):])
        exit()
print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
import itertools
S=input()
T=input()

n=len(T)
Thatena=[[T[j] if (i>>j)&1 else "?" for j in range(n)] for i in range(2**n)] #Tのうち0文字以上を?に置き換えたものの集合
#print(Thatena)
#print(len(Thatena))
ans=[]
for t in Thatena:
    if S.find("".join(t))!=-1:
        anslist.append(S.rfind("".join(t)))
        break
if anslist==[]:
    print("UNRESTORABLE")
    exit()
#print(anslist[0],anslist[0]+len(T))
ans=S[:anslist[0]]+T+S[anslist[0]+len(T):]
print("".join([c if c!="?" else "a" for c in ans]))

Buggy submission (verdict: Runtime Error):
import itertools
S=input()
T=input()

n=len(T)
Thatena=[[T[j] if (i>>j)&1 else "?" for j in range(n)] for i in range(2**n)] #Tのうち0文字以上を?に置き換えたものの集合
#print(Thatena)
#print(len(Thatena))
anslist=[S.find("".join(t)) for t in Thatena if S.find("".join(t))!=-1]

#print(anslist[0],anslist[0]+len(T))
ans=S[:anslist[0]]+T+S[anslist[0]+len(T):]
print("".join([c if c!="?" else "a" for c in ans]))

Buggy submission (verdict: Runtime Error):
import itertools
S=input()
T=input()

def insert_hint(item,hintindex,S):
  for i in hintindex:
    item.insert(i,S[i])
  return item
  
hintindex=[n for _,n in enumerate(range(len(S))) if S[n]!="?"]

zenbu=list(itertools.permutations(
  list("abcdefghijklmnopqrstuvwxyz"),
  len(S)-len(hintindex)
))
zenbu=[insert_hint(list(item),hintindex,S) for item in zenbu]
#print(zenbu[-1])

anslist=[item for item in zenbu if "".join(item).find(T)!=-1]

#print(anslist)
print("".join(sorted(anslist)[0]))

Buggy submission (verdict: Runtime Error):
import itertools
S=input()
T=input()

def insert_hint(item,hintindex,S):
  for i in hintindex:
    item.insert(i,S[i])
  return item
  
hintindex=[n for _,n in enumerate(range(len(S))) if S[n]!="?"]

zenbu=list(itertools.permutations(
  list("abcdefghijklmnopqrstuvwxyz"),
  len(S)-len(hintindex)
))
zenbu=[insert_hint(list(item),hintindex,S) for item in zenbu]
#print(zenbu[-1])

anslist=[item for item in zenbu if "".join(item).find(T)!=-1]

print(anslist)
print("".join(sorted(anslist)[0]))
Problem p03627 (python)

Fixed submission:
import collections
import heapq
n=int(input())
a=[-int(item) for item in input().split()]
c = [item for item in list(collections.Counter(a).items()) if item[1]>1]
heapq.heapify(c)
#print(c)

if len(c)==0:
  print(0)
  exit()
if sum([item[1] for item in c])<4:
  print(0)
  exit()

x=heapq.heappop(c)
if c!=[]:
  y=heapq.heappop(c)
else:
  y=(0,0)
if x[1]>=4:
  print(x[0]*x[0])
else:
  print(x[0]*y[0])

Buggy submission (verdict: Runtime Error):
import collections
import heapq
n=int(input())
a=[-int(item) for item in input().split()]
c = [item for item in list(collections.Counter(a).items()) if item[1]>1]
if c==[]:
  print(0)
  exit()
#print(c)
x=heapq.heappop(c)
y=heapq.heappop(c)
kouho=[]
if x[1]>=4:
  print(x*x)
else:
  print(x*y)

Buggy submission (verdict: Runtime Error):
import collections
import heapq
n=int(input())
a=[-int(item) for item in input().split()]
c = [item for item in list(collections.Counter(a).items()) if item[1]>1]
#print(c)
x=heapq.heappop(c)[0]
y=heapq.heappop(c)[0]
print(x*y)
Problem p03739 (python)

Fixed submission:
from copy import copy
n = int(input())
a = [int(x) for x in input().split()]
ans1=[(-1)**i for i in range(n)]

b=copy(a)
res_b=0
sb=0
c=copy(a)
res_c=0
sc=0
for i in range(n):
  sb+=a[i]
  if ans1[i]*sb>0:
    pass
  else:
    b[i]=ans1[i]-(sb-b[i])
    sb=sb-a[i]+b[i]
    res_b+=abs(b[i]-a[i])

  sc+=a[i]
  if -1*ans1[i]*sc>0:
    pass
  else:
    c[i]=-1*ans1[i]-(sc-c[i])
    sc=sc-a[i]+c[i]
    res_c+=abs(c[i]-a[i])
  
print(min(res_b,res_c))

Buggy submission (verdict: Runtime Error):
import copy
 
N=int(input())
l=list(map(int, input().split()))  #リスト入力
cp = copy.copy(l)
#c=0
 
for k in range(1,N):
 
  if sum(l[:k])==0:
    #c=c+1
    if l[k]>0:
      l[k]=l[k]+1
    else:
      l[k]=l[k]-1
 
  if sum(l[:k])*sum(l[:k+1])>0:
    
    if sum(l[:k+1])>0:
      l[k]=l[k]-(sum(l[:k+1])-(-1))
      #c=c+abs(sum(l[:k+1])-(-1))
    else:
      l[k]=l[k]+(1-sum(l[:k+1]))
      #c=c+abs(1-sum(l[:k+1]))
 
 
if sum(l)==0:
  c=c+1
  l[-1]=l[-1]+1
 
#print(l)
print(sum([abs(l[n]-cp[n]) for n in range(N)]))

Buggy submission (verdict: Runtime Error):
import copy

N=int(input())
l=list(map(int, input().split()))  #リスト入力
cp = copy.copy(l)
#c=0

for k in range(N-1):

  if sum(l[:k+1])==0:
    #c=c+1
    if l[k+1]>0:
      l[k+1]=l[k+1]+1
    else:
      l[k+1]=l[k+1]-1

  if sum(l[:k])*sum(l[:k+1])>0:
    
    if sum(l[:k+1])>0:
      l[k]=l[k]-(sum(l[:k+1])-(-1))
      #c=c+abs(sum(l[:k+1])-(-1))
    else:
      l[k]=l[k]+(1-sum(l[:k+1]))
      #c=c+abs(1-sum(l[:k+1]))


if sum(l)==0:
  c=c+1
  l[-1]=l[-1]+1

  
print(sum([abs(l[n]-cp[n]) for n in range(N)]))

Buggy submission (verdict: Runtime Error):
import copy

N=int(input())
l=list(map(int, input().split()))  #リスト入力
cp = copy.copy(l)
#c=0

for k in range(N-1):

  if sum(l[:k+1])==0:
    #c=c+1
    if l[k+1]>0:
      l[k+1]=l[k+1]+1
    else:
      l[k+1]=l[k+1]-1

  if sum(l[:k])*sum(l[:k+1])>0:
    print(k,sum(l[:k]),sum(l[:k+1]),l[k+1])
    if sum(l[:k+1])>0:
      l[k]=l[k]-(sum(l[:k+1])-(-1))
      #c=c+abs(sum(l[:k+1])-(-1))
    else:
      l[k]=l[k]+(1-sum(l[:k+1]))
      #c=c+abs(1-sum(l[:k+1]))
    print(l[k])

if sum(l)==0:
  c=c+1
  l[-1]=l[-1]+1
#print(l)
#print(c)
print(sum([abs(l[n]-cp[n]) for n in range(N)]))
Problem p04031 (python)

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(min([sum([(x-item)**2 for x in a]) for item in list(range(-100,101)
                                                         )
          ]
         )
     )

Buggy submission (verdict: Runtime Error):
n=int(input())
print(min([sum([(x-item)**2 for x in [int(x) for x in input().split()]]) for item in list(range(-100,101))]))
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())

x=-1
y=-1
z=-1

Ten=10000
Five=5000
One=1000

count=0

max_x=int(Y//Ten)

if max_x <= N:
	for i in reversed(range(0,max_x+1)):
		if count == 1:
			break
		elif count == 0:
			max_y = int((Y - Ten*i)//Five)
			if (max_y + i) <= N:
				for j in reversed(range(0, max_y+1)):
					if (Ten*i + Five*j + One*(N-i-j))==Y:
						x=i
						y=j
						z=N - i - j
						count+=1
						break

print(x, y, z)

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())

x=-1
y=-1
z=-1

Ten=10000
Five=5000
One=1000

count=0

max_x=int(Y//Ten)

if max_x <= N:
	for i in reversed(range(0,max_x+1)):
		if count ==0:
			max_y = int((Y - Ten*i)//Five)
			if (max_y + i) <= N:
				for j in reversed(range(0, max_y+1)):
					if (Ten*j + Five*i + One*(N-i-j))==Y:
						x=i
						y=j
						z=max_z
						count+=1
						break

print(x, y, z)
Problem p03494 (python)

Fixed submission:
n = int(input())
a=list(map(int, input().split()))
count = 0
boolean = True

while boolean == True:
	for i in range(n):
		if a[i]%2 == 0 :
			a[i] = a[i]/2
			if i == (n-1):
				count += 1
		else:
			boolean = False
			break

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a=input()
count = []

for i in range(n):
	count.append(0)
	while True:
		if a[i]%2 == 0 :
			a[i] = a[i]/2
			count[i] += 1
		else:
			break

print(max(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
a=input()
count = []

for i in n:
	count[i] = 0
	while True:
		if a[i]%2=0 :
			a[i] = a[i]/2
			count[i] += 1
		else:
			break

max(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a=input()
count = []

for i in n:
	while True:
		if a[i]%2=0 :
			a[i] = a[i]/2
			count[i] += 1
		else:
			break

max(count)
Problem p02958 (python)

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

counter = 0
for pair in zip(p_list, range(1, len(p_list) + 1)):
    if pair[0] - pair[1] != 0:
        counter += 1

if counter == 0 or counter == 2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys

N = int(input())
p_list = list(map(int, input().split()))

different_index = -1
should_place = -1
for i, p in enumerate(p_list):
    if different_index >= 0 and p != i + 1 and i != should_place:
        print("NO")
        sys.exit(1)

    if different_index == -1 and p != i + 1:
        different_index = i
        should_place = p - 1
        continue
    

if different_index == -1:
    print("YES")
elif p_list[should_place] == different_index + 1:
    print("YES")
else:
    print("NO")
Problem p02982 (python)

Fixed submission:
import numpy as np

# 入力行N，列D
N, D = map(int, input().split())
points = [list(map(int, input().split())) for i in range(N)]

def calc_distance(p1, p2):
    sum = 0
    for i in range(len(p1)):
        sum += (p1[i] - p2[i]) ** 2
    return np.sqrt(sum)

count = 0
for i, point in enumerate(points):
    for point2 in points[i + 1:]:
        outp = calc_distance(point, point2)
        if outp.is_integer():
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np

# 入力行N，列D
N, D = map(int, input().split())
points = [list(map(int, input().split())) for i in range(N)]

def calc_distance(p1, p2):
    sum = 0
    for i in range(len(p1)):
        sum += (p1[i] - p2[i]) ** 2
    return np.sqrt(sum)

count = 0
for i, point in enumerate(points):
    for point2 in points[i + 1:]:
        outp = calc_distance(point, point2)
        if outp.is_integer():
            count += 1

print(count)
Problem p02886 (python)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))

total = 0

for i in range(0,len(d)-1):
    for j in range(i+1,len(d)):
        total += d[i]*d[j]
print(total)

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

total = 0

for i in range(d.count()-1):
    for j in range(1,d.count()):
        total += d[i]*d[j]


print(total)
Problem p02887 (python)

Fixed submission:
n = int(input())
s = list(input())

a = s[0]
ans = list(s[0])
for i in range(1,len(s)):
    if a != s[i]:
        a = s[i]
        ans.append(s[i])

print(len(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())

a = s[0]
for i in range(1,len(s)):
    if a != s[i]:
        a = s[i]
    else:
        del s[i]

print(len(s))
Problem p02952 (python)

Fixed submission:
n = int(input())

count = 0
count
for i in range(1,n+1):
    if (len(str(i)) % 2 != 0):
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
n = input()
count = 0
start = 1
while start < len(n):
    count += 10**start - 10**(start -1)
    start +=2

if len(n) % 2 == 0:
    print(count)
else:
    print(count + int(n[1:]) + 1)
Problem p03109 (python)

Fixed submission:
from datetime import datetime
s = input()
inputDate = datetime.strptime(s,'%Y/%m/%d')
heiseiDate = datetime.strptime('20190430','%Y%m%d')

if inputDate > heiseiDate:
    print('TBD')
else:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
from dateutil.parser import parse
s = input()
inputDate = parse(s)
heiseiDate = parse('20190430')

if inputDate > heiseiDate:
    print('TBD')
else:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
s = input()
from dateutil.parser import parse
inputDate = parse(s)
heisei = parse('20190430')

if inputDate > heisei:
    print('TBD')
else:
    print('Heisei')
Problem p03238 (python)

Fixed submission:
n = int(input())


if n ==1:
    print('Hello World')
if n == 2:
    a = int(input())
    b = int(input())
    print(a+b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

if n ==1:
    print('Hello World')
if n == 2:
    print(a+b)
Problem p03493 (python)

Fixed submission:
math = input()
count = 0
for i in range(len(math)):
    if math[i] == '1':
        count +=1
print(count)

Buggy submission (verdict: Runtime Error):
math = input()
count = 0
for i in range(len(math)):
    if math[i] == '1'
        count +=1
print(count)

Buggy submission (verdict: Runtime Error):
math = input()
count = 0
for i in range(len(math)):
    if math[i] == '1'
        count +=1
print(count)
Problem p03545 (python)

Fixed submission:
import sys
s = input()
a  = 7
n = len(s)
for i in range(2**(n-1)):
    total = int(s[0])
    ans = [s[0]]
    for j in range(n-1):
        if (i >> j) & 1:
            total += int(s[j+1])
            ans.append('+' + s[j+1])
        else:
            total -= int(s[j+1])
            ans.append('-'+s[j+1])
    if total == 7:
        print(''.join(ans) + '=7')
        sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
s = input()
a  = 7
n = len(s)
for i in range(2**(n-1)):
    total = int(s[0])
    ans = [s[0]]
    for j in range(n-1):
        if (i >> j) & 1:
            total += int(s[j+1])
            ans.append('+' + s[j+1])
        else:
            total -= int(s[j+1])
            ans.append('-'+s[j+1])
    if total == 7:
        print(''.jon(ans) + '=7')
        sys.exit()
Problem p03635 (python)

Fixed submission:
n,m = map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
print((n-1)*(m-1) if (n-1) > a and (m-1) > 1 else 0)
Problem p03671 (python)

Fixed submission:
a = list(map(int,input().split()))
print(sum(a) - max(a))

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
print(sum(a) - max(a))
Problem p03037 (python)

Fixed submission:
import sys
args = sys.stdin.readlines()
n, m = map(int, args[0].split(' '))
l_1 = 1
r_1 = n

for gate in args[1:]:
  l, r = map(int, gate.split(' '))  
  if l > l_1:
    l_1 = l
  if r < r_1:
    r_1 = r

ids = r_1 - l_1 + 1
if ids < 0:
  print(0)
else:
  print(ids)

Buggy submission (verdict: Runtime Error):
import sys
args = sys.stdin.readlines()
n, m = map(int, args[0].split(' '))
gates = []
for gate in args[1:]:
  l, r = map(int, gate.split(' '))
  gates.append((l, r))
  
ids = gates[0]
for gate in gates[1:]:
  l, r = gate
  ids = ids[l-ids[0]:r-ids[-1]+1]
  
print(len(ids))

Buggy submission (verdict: Runtime Error):
import sys
args = sys.stdin.readlines()
n, m = map(int, args[0].split(' '))
gates = []
for gate in args[1:]:
  l, r = map(int, gate.split(' '))
  gates.append((l, r))
  
ids = gates[0]
for gate in gates[1:]:
  l, r = gate
  ids = [x for x in ids in range(l, r+1)]
  
print(len(ids))

Buggy submission (verdict: Runtime Error):
import sys
args = sys.stdin.readlines():
n, m = map(int, args[0].split(' '))
gates = []
for gate in args[1:]:
  l, r = map(int, gate.split(' '))
  gates.append((l, r))
  
ids = gates[0]
for gate in gates[1:]:
  l, r = gate
  ids = [x for x in ids in range(l, r+1)]
  
print(len(ids))
Problem p02971 (python)

Fixed submission:
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(A)[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(set(A))[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)

Buggy submission (verdict: Runtime Error):
import copy
N = int(input())

A = [0]*N

for r in range(N):
  A[r] = int(input())
Elias_A = copy.copy(A)
A.sort()
Sorted_A = copy.copy(A)
  
for r in range(N):
  if N >= 3:
    if A[r] == Sorted_A[N-1]: print(A[r])
    elif A[r] == Sorted_A[N-2]: print(A[r])
    elif A[r] == sorted_A[N-3]: print(A[r])
    else:
      A.remove(Elias_A[r])
      print(A[N-2])
      A = copy.copy(Sorted_A)
  else:
    A.remove(Elias_A[r])
    print(A[N-2])
    A = copy.copy(Sorted_A)
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-2):
    for j in range(i+1,n-1):
        k = bisect_left(l,l[i]+l[j])
        ans += k - j - 1

print(ans)

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

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        k = bisect_left(l, l[i] + l[j])
        ans += k - j - 1
print(ans)

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

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        k = bisect_left(l[j:], l[i] + l[j]) + j
        ans += k - j - 1
print(ans)

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

ans = 0
for i in range(len(l)):
    for j in range(len(l))[i + 1:]:
        k = bisect_left(l[j:], l[i] + l[j]) + j
        ans += len(l[j:k]) - 1
print(ans)

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

ans = 0
for i in range(len(l)):
    for j in range(len(l))[i + 1:]:
        k = bisect(l[j+1:], l[i] + l[j]) + j+1
        ans += len(l[j+1:k])
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import collections as cl
n=int(input())
l=np.asarray(list(map(int,input().split())))
rng=np.arange(n)
i=np.tile(rng,(n**2,1)).T.ravel()
j=np.tile(np.tile(rng.copy(),(n,1)).ravel(),(n,1)).T.ravel()
k=np.tile(rng.copy(),(n**2,1)).ravel()
tmp=(l[i]<l[j]+l[k])*(l[j]<l[i]+l[k])*(l[k]<l[i]+l[j])*(i!=j)*(i!=k)*(j!=k)
tmp=np.asarray(np.where(tmp.reshape(n,n,n))).T.astype(str)
tmp.sort(axis=-1)
ans=[]
for t in tmp:
    ans.append(t[0]+t[1]+t[2])
print(len(cl.Counter(ans)))

Buggy submission (verdict: Runtime Error):
import numpy as np
import collections as cl
n=int(input())
l=np.asarray(list(map(int,input().split())))
i=np.tile(np.arange(len(l)),(n**2,1)).T.ravel()
j=np.tile(np.tile(np.arange(len(l)),(n,1)).ravel(),(n,1)).T.ravel()
k=np.tile(np.arange(n),(n**2,1)).ravel()
tmp=(l[i]<l[j]+l[k])*(l[j]<l[i]+l[k])*(l[k]<l[i]+l[j])*(i!=j)*(i!=k)*(j!=k)
tmp=np.asarray(np.where(tmp.reshape(n,n,n))).T.astype(str)
tmp.sort(axis=-1)
ans=[]
for t in tmp:
    ans.append(t[0]+t[1]+t[2])
print(len(cl.Counter(ans)))

Buggy submission (verdict: Runtime Error):
import numpy as np
import collections as cl
n=int(input())
l=np.asarray(list(map(int,input().split())))
i=np.tile(np.arange(len(l)),(n**2,1)).T.ravel()
j=np.tile(np.tile(np.arange(len(l)),(n,1)).ravel(),(n,1)).T.ravel()
k=np.tile(np.arange(n),(n**2,1)).ravel()
tmp=(l[i]<l[j]+l[k])*(l[j]<l[i]+l[k])*(l[k]<l[i]+l[j])*(i!=j)*(i!=k)*(j!=k)
tmp=np.asarray(np.where(tmp.reshape(n,n,n))).T.astype(str)
tmp.sort(axis=-1)
ans=[]
for t in tmp:
    ans.append(t[0]+t[1]+t[2])
print(len(cl.Counter(ans)))
Problem p02909 (python)

Fixed submission:
input=input()
weather={"Sunny":0,"Cloudy":1,"Rainy":2}
output={0:"Sunny",1:"Cloudy",2:"Rainy"}
s=weather[input]+1
if s>=3:
	s=s-3
	print(output[s])
else:
	print(output[s])

Buggy submission (verdict: Runtime Error):
  input=input()
  
  weather={"Sunny":0,"Cloudy":1,"Rainy":2}
  output={0:"Sunny",1:"Cloudy",2:"Rainy"}
  s=weather[input]+1
  if s>=3:
           s=s-3
           print(output[s])
　else:
		　　print(output[s])
Problem p02993 (python)

Fixed submission:
input=list(input())


if int(input[0])==int(input[1]) or int(input[1])==int(input[2]) or int(input[2])==int(input[3]):
	 print("Bad")
else:
	print("Good")

Buggy submission (verdict: Runtime Error):
input=list(input())
if int(input[0])==int(input[1]) or int(input[1])==int(input[2]) or int(input[2])==int(input[3]):
　print("Bad")
else:
 print("Good")

Buggy submission (verdict: Runtime Error):
 input=list(input())
  
 if int(input[0])==int(input[1]) or int(input[1])==int(input[2]) or int(input[2])==int(input[3]):
          print("Bad")
 else:
          print("Good")
Problem p03001 (python)

Fixed submission:
#整数＋リスト
w, h, x, y = list(map(int, input().split()))

f = 0
if ((x*2 == w) and (y*2 == h)):
    f = 1

print(w*h/2,f)

Buggy submission (verdict: Runtime Error):
#整数＋リスト
w, h, x, y = list(map(int, input().split()))


xxx = x
yyy = y
if (x/w > y/h):
    xxx = y
    yyy = x
    
############
#print(xxx,yyy)

a = xxx*h
b = yyy*w
c = w*w*(h-yyy)/(w-xxx)/2

mmm = w*h

if (a > mmm/2):
    a = mmm - a

if (b > mmm/2):
    b = mmm - b

if (c > mmm/2):
    c = mmm - c

#############
#print(a,b,c)

rtn = max(a,b,c)
f = -1
if (a == rtn):
    f += 1
if (b == rtn):
    f += 1
if (c == rtn):
    f += 1
if (f == 2):
    f = 1

print('{0:.6f}'.format(rtn), f)
Problem p02886 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
s,res = l[0],0
for i in range(1,n):
  res+=s*l[i]
  s+=l[i]
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [*map(int,input().split())]
s,res = l[0],0
for i in range(1,n):
  res+=s*l[i]
  s+=l[i]
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [*map(int,input().split())]
s,res = l[0],0
for i in range(1,n):
  res+=s*l[i]
  s+=l[i]
print(s)
Problem p02988 (python)

Fixed submission:
n=int(input())
l = list(map(int, input().split()))
res = 0
for i in range(1,n-1):
  if l[i-1]<l[i] and l[i]<l[i+1] or l[i-1]>l[i] and l[i]>l[i+1]: res+=1
print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
l = [*map(int, input().split())]
res = 0
for i in range(1,n-1):
  if l[i-1]<l[i] and l[i]<l[i+1] or l[i-1]>l[i]andl[i]>l[i+1]: res+=1
print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
l = [*map(int, input().split())]
res = 0
for i in range(1,n-1):
  if l[i-1]<l[i]<l[i+1] or l[i-1]>l[i]>l[i+1]: res+=1
print(res)
Problem p02885 (python)

Fixed submission:
a=input().split()
b=int(a[0])
c=int(a[1])
if c*2>=b:
  print(0)
else: print(b-c*2)

Buggy submission (verdict: Runtime Error):
a,b=int(input.split())
if b*2>=a:
  print(0)
else: print(a-b*2)
Problem p03325 (python)

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


count = 0
for i in nums:
    w = i
    while not w & 1:
        w = int(w / 2)
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = list(map(int, input().split()))


def renew(arr):
    res = []
    changed = False
    for i in arr:
        if not i & 1 and not changed:
            res.append(int(i / 2))
            changed = True
        else:
            res.append(i * 3)
    if changed:
        return res
    else:
        return []


count = 0
cs = renew(nums)
print(cs)
while len(cs) > 0:
    count += 1
    cs = renew(cs)


print(count)
Problem p02921 (python)

Fixed submission:
S = input()
S.split()
T = input()
T.split()
count = 0
for i in range(0, 3):
    if S[i] == T[i]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
tmp = input()
H = [int(x.strip()) for x in tmp.split(' ')]
n = 0
lists = list()
lists.append(0)
count = 0
while n <= N-2:
    if H[n] >= H[n+1]:
        while H[n] >= H[n+1]:
            count += 1
            n += 1
            if n == N-1:
                lists.append(count)
                break
        lists.append(count)
        count = 0
    else:
        n += 1
print(max(lists))
Problem p02923 (python)

Fixed submission:
N = int(input())
tmp = input()
H = [int(x.strip()) for x in tmp.split(' ')]
n = 0
lists = list()
lists.append(0)
count = 0
while n <= N-2:
    if H[n] >= H[n+1]:
        while H[n] >= H[n+1]:
            count += 1
            n += 1
            if n == N-1:
                lists.append(count)
                break
        lists.append(count)
        count = 0
    else:
        n += 1
print(max(lists))

Buggy submission (verdict: Runtime Error):
# Nマス H[N-1]まである
N = int(input())
tmp = input()
H = [int(x.strip()) for x in tmp.split(' ')]
n = 0
lists = list()
lists.append(0)
count = 0
while True:
    if H[n] >= H[n+1]:
        while H[n] >= H[n+1]:
            count += 1
            n += 1
            if n == N-1:
                lists.append(count)
                break
        lists.append(count)
        count = 0
        if n == N-1:
            break
    else:
        n += 1
        if n == N-1:
            break
print(max(lists))
print(lists)
Problem p02945 (python)

Fixed submission:
a, b = list(map(int, input().split()))
print(max(a+b, max(a-b, a*b)))

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
print(max(a+b, max(a-b, a*b))