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

Fixed submission:
from itertools import combinations
n=int(input())
if n == 1:
    print(1)
else:
    xs = []
    for _ in range(n):
        x,y=map(int,input().split())
        xs.append((x,y))
    
    def func(c):
        p,q=(xs[c[0]][0]-xs[c[1]][0],xs[c[0]][1]-xs[c[1]][1])
        ys=[(x,y) for x,y in xs if (x-p,y-q) not in xs]
        return len(ys)
    
    c = combinations(range(n),2)
    print(min(map(func, c)))

Buggy submission (verdict: Runtime Error):
from itertools import combinations
n=int(input())
xs = []
for _ in range(n):
    x,y=map(int,input().split())
    xs.append((x,y))

def func(c):
    p,q=(xs[c[0]][0]-xs[c[1]][0],xs[c[0]][1]-xs[c[1]][1])
    ys=[(x,y) for x,y in xs if (x-p,y-q) not in xs]
    return len(ys)

c = combinations(range(n),2)
print(min(map(func, c)))
Problem p03050 (python)

Fixed submission:
from math import sqrt
n=int(input())
s=0
for i in range(int(sqrt(n))):
    d,m=divmod(n,i+1)
    if m == 0:
        if d>1 and len(set(divmod(n,d-1))) == 1:
            s += d-1
print(s)

Buggy submission (verdict: Runtime Error):
from math import sqrt
n=int(input())
s=0
for i in range(int(sqrt(n))):
    d,m=divmod(n,i+1)
    if m == 0:
        if len(set(divmod(n,d-1))) == 1:
            s += d-1
print(s)
Problem p03068 (python)

Fixed submission:
input()
s = input()
k = int(input())
print(''.join(c if c == s[k-1] else '*' for c in s))

Buggy submission (verdict: Runtime Error):
input()
s = input()
k = int(input())
print(''.join(c if c == s[k] else '*' for c in s))
Problem p03069 (python)

Fixed submission:
n = int(input())
s = input()
m = s.count('.')
c = (0, m)
for i in range(n):
    if s[i] == '#':
        c = (c[0]+1, c[1])
    else:
        c = (c[0], max(c[1]-1, 0))
    m = min(c[0] + c[1], m)
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ts = ['.' * i + '#' * (n - i) for i in range(n+1)]
print(min(sum(s[i] != t[i] for i in range(n)) for t in ts))
Problem p03294 (python)

Fixed submission:
from functools import reduce
from fractions import gcd
input()
aa=list(map(int,input().split()))
lcm=reduce((lambda a,b:a*b//gcd(a,b)),aa)
m=lcm-1
print(sum(m%a for a in aa))

Buggy submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
input()
aa=list(map(int,input().split()))
lcm=reduce((lambda a,b:a*b//gcd(a,b)),aa)
m=lcm-1
print(sum(m%a for a in aa))
Problem p02606 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(b//c-(a-1)//c)

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

print(b/c-(a-1)/c)
Problem p02681 (python)

Fixed submission:
a,b=open(0);print("YNeos"[a[:-1]!=b[:-2]::2])

Buggy submission (verdict: Runtime Error):
a=input()
print(a[1])

Buggy submission (verdict: Runtime Error):
print("YNeos"[input()[1]=='n'::2])

Buggy submission (verdict: Runtime Error):
print("YNeos"[input()[0]=='s'||'k'::2])
Problem p03238 (python)

Fixed submission:
n=input()
if int(n) == 1:
  print("Hello World")
else:
  a=input()
  b=input()
  print(int(a)+int(b))

Buggy submission (verdict: Runtime Error):
n=input()
if n == 1:
  print("Hello World")
else:
  a=input()
  b=input()
  print(int(a)+int(b))

Buggy submission (verdict: Runtime Error):
n=input()
if n==1:
  print("Hello World")
else:
  a=input()
  b=input()
  print(a+b)

Buggy submission (verdict: Runtime Error):
n=input()
if (n==1):
  print("Hello World")
else:
  a=input()
  b=input()
  print(a+b)

Buggy submission (verdict: Runtime Error):
n=input()
if (n==1):
  print("Hello world")
else:
  a=input()
  b=input()
  print(a+b)

Buggy submission (verdict: Runtime Error):
n=input()
if (n==1):
　print("Hello world")
else:
　a=input()
　b=input()
　print(a+b)

Buggy submission (verdict: Runtime Error):
n=input()
if (n==1):
print("Hello world")
else:
a=input()
b=input()
print(a+b)
Problem p03281 (python)

Fixed submission:
_=int(input());c=0
for i in 'i¥½ÃÉ':
  if (_ < ord(i)):
    print(c)
    break
  c+=1

Buggy submission (verdict: Runtime Error):
import sys;print(int(sys.argv[1][-6:-5])/2)

Buggy submission (verdict: Runtime Error):
print(int(__file__[-6:-5])/2)

Buggy submission (verdict: Runtime Error):
print(int(__file__[5])/2)

Buggy submission (verdict: Runtime Error):
print(int(__file__[6])/2)

Buggy submission (verdict: Runtime Error):
print(int(__file__[4])/2)

Buggy submission (verdict: Runtime Error):
print(int(__file__[4])/2)

Buggy submission (verdict: Runtime Error):
import re;print(int(re.sub('¥D',"",__file__))/2)

Buggy submission (verdict: Runtime Error):
print __file__
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
p = 1
if a.count(0):
    print(0)
    exit(0)
for i in range(n):
    p *= a[i]
    if p > int(1E18):
        print(-1)
        exit(0)
print(p)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
p = 1
for i in range(n):
    p *= a[i]
if p > int(1E18):
    print(-1)
else
    print(p)
Problem p02576 (python)

Fixed submission:
s = input().split()
N = int(s[0])
X = int(s[1])
T = int(s[2])
a = N//X
b = N%X
k1 = a*T
k2 = k1 + T
if b == 0:
  print(k1)
else:
  print(k2)

Buggy submission (verdict: Runtime Error):
N = int(input())
k = 0
x = 0
while N > 1: 
  N = N/10
  k += 1
for i in range(k):
  N = N*10
  a = N//10
  x = x + a
  N = N - a
if x//9 == 0:
  print("yes")
else:
  print("no")

Buggy submission (verdict: Runtime Error):
[N, X, T] = input[] 

a = N/X
b = N//X
k1 = a*T
k2 = k1 + T
if b == 0:
  print(k1)
else:
  print(k2)

Buggy submission (verdict: Runtime Error):
N = float(input())
X = float(input())
T = float(input())

a = N/X
b = N//X
k1 = a*T
k2 = k1 + T
if b == 0:
  print(k1)
else:
  print(k2)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = int(input())
T = int(input())

a = N/X
b = N//X
k1 = a*T
k2 = k1 + T
if b == 0:
  print(k1)
else:
  print(k2)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = int(input())
T = int(input())

a = N/X
b = N//X
k1 = a*T
k2 = k1 + 1
if b == 0:
  print(k1)
else:
  print(k2)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = int(input())
T = int(input())

a = N/X
b = N//X
if b == 0:
  print(a*T)
else:
  print(a*T + 1)
Problem p03854 (python)

Fixed submission:
S = input()[::-1]
text = ['dream','dreamer','erase','eraser']
text = [t[::-1] for t in text]

while len(S) > 0:
  for t in text:
    if S.find(t) == 0:
      S = S[len(t):]
      break
  else:
    print('NO')
    break
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
S = input()
text = ['dream','dreamer','erase','eraser']

def search(s):
  if len(s) == 0:
    return 1
  
  flg = 0
  for t in text:
    if len(s) < len(t):
      continue
    if s.find(t) == 0:
      flg |= search(s[len(t):])
      
  return flg

if search(S):
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
S = input()
text = ['dream','dreamer','erase','eraser']

def search(s):
  if len(s) == 0:
    return 1
  
  flg = 0
  for t in text:
    if s.find(t) == 0:
      flg |= search(s[len(t):])
      
  return flg

if search(S):
  print('YES')
else:
  print('NO')
Problem p03316 (python)

Fixed submission:
S=input()
Sn=0
for i in range(1, 10):
	if i > len(S):break
	Sn+=int(S[-i])
ans = "No"
if Sn == 0 or int(S) % Sn == 0:ans = "Yes"

print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
Sn=0
for i in range(1, 10):
	if i > len(S):break
	Sn += int(S[-i])
ans = "No"
if int(S) % Sn == 0:ans = "Yes"

print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
Sn=0
for i in range(1, 10):
	if i > len(S):break
	Sn += int(S[-i])
ans = "No"
if int(S) % Sn == 0:ans = "Yes"

print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
Sn=0
for i in range(1, 10):
	if i > len(S):break
	Sn+=int(S[-i])
ans = "No"
if int(S) % Sn == 0:ans = "Yes"

print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
Sn=0
for i in range(1, 10):
	if i > len(S):break
	Sn+=int(S[-i])
ans = "No"
if int(S) / Sn == 0:ans = "Yes"
print(ans)
Problem p02600 (python)

Fixed submission:
x=input()

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

Buggy submission (verdict: Runtime Error):
x=inport()
if 400<=x<=599:
  print(8)
elif 600<=x<=799:
  print(7)
elif 800<=x<=999:
  print(6)
elif 1000<=x<=1199:
  print(5)
elif 1200<=x<=1399:
  print(4)
elif 1400<=x<=1599:
  print(3)
elif 1600<=x<=1799:
  print(2)
else:
  print(1)
Problem p03238 (python)

Fixed submission:
a=int(input())

if(a==1):
    print('Hello World')

elif(a==2):
    A=int(input())
    B=int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
n,w = map(int,input().split())
m = 1001
for i in range(n):
    a,b = map(int,input().split())
    if b <= w and a < m:
        m = a
if m == 1001:
    print("TLE")
else:
    print(m)
Problem p03264 (python)

Fixed submission:
K=int(input())

c=K%2

if(c==0):
    print(int((K/2)*(K/2)))
else:
    print(int(K/2)*(int(K/2)+1))

Buggy submission (verdict: Runtime Error):
K=int(input())

c=K%2

if(c==0):
    print((K/2)^2)
else:
    print(int(K/2)*(int(K/2)+1))
Problem p03323 (python)

Fixed submission:
a=input().strip().split(" ")
b=[int(i) for i in a]

if(b[0]<=8 and b[1]<=8):
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a=input().strip().split(" ")
b=[int(i) for in a]

if(b[0]<=8 and b[1]<=8):
    print("Yay!")
else:
    print(":(")
Problem p03605 (python)

Fixed submission:
a=input()

b=list(a)

b=[int(i) for i in b]

if(b[0]==9 or b[1]==9):
    print("Yes")
else:
    print("No")

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

b=list(a)

if(b[0]==9 or b[1]==9):
    print("Yes")
else:
    print("No")
Problem p03697 (python)

Fixed submission:
a=input().strip().split(" ")

b=[int(i) for i in a]

c=b[0]+b[1]

if(c>=10):
    print("error")
else:
    print(c)

Buggy submission (verdict: Runtime Error):
a=input()strip().split(" ")

b=[int(i) for i in a]

c=b[0]+b[1]

if(c>=10):
    print("error")
else:
    print(c)

Buggy submission (verdict: Runtime Error):
a=input()strip().split(" ")

b=[int(i) for i in a]

c=b[0]+c[1]

if(c>=10):
    print("error")
else:
    print(c)
Problem p03759 (python)

Fixed submission:
a=input().strip().split(" ")

b=[int(i) for i in a]

if(b[1]-b[0]==b[2]-b[1]):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a=input().strip().splt(" ")

b=[int(i) for i in a]

if(b[1]-b[0]==b[2]-b[1]):
    print("YES")
else:
    print("NO")
Problem p03760 (python)

Fixed submission:
O=input()
E=input()

S=''

for i in range(len(E)):
    S+=O[i]+E[i]
if(len(O)>len(E)):
    S+=O[-1]

print(S)

Buggy submission (verdict: Runtime Error):
O=input()
E=input()

b=[]

if(len(O)>len(E)):
    X=O
else:
    X=E

for i in range(len(X)):
    b.append(O[i])
    b.append(E[i])

a=str(b)

a=a.replace("'","")
a=a.replace(",","")
a=a.replace(" ","")
a=a.replace("[","")
a=a.replace("]","")



print(a)
Problem p03813 (python)

Fixed submission:
a=int(input())

if(a<1200):
    print("ABC")
else:
    print("ARC")

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

if(a<1200):
    print("ABC")
else:
    print("ARC)
Problem p03826 (python)

Fixed submission:
a=input().strip().split(" ")

b=[int(i) for i in a]

if(b[0]*b[1]>b[2]*b[3]):
    print(b[0]*b[1])
else:
    print(b[2]*b[3])

Buggy submission (verdict: Runtime Error):
a=input().strip().split(" ")

b=[int(i) for i in a]

if(a[0]*a[1]>a[2]*a[3]):
    print(a[0]*a[1])
else:
    print(a[2]*a[3])
Problem p03844 (python)

Fixed submission:
a=input().strip().split(" ")

a[0]=int(a[0])
a[2]=int(a[2])


if(a[1]=="+"):
    print(a[0]+a[2])
else:
    print(a[0]-a[2])

Buggy submission (verdict: Runtime Error):
a=input().strip().split(" ")

if(a[1]=="+"):
    print(a[0]+a[2])
else:
    print(a[0]-a[2])
Problem p03861 (python)

Fixed submission:
a, b, x = [int(x) for x in input().split()]
print(b // x - a // x + (a % x == 0))

Buggy submission (verdict: Runtime Error):
a, b, x = [int(x) for x in input().split()]
print(b // x - a // x + (a % x == 0))a,b,x=map(int,input().strip().split(" "))
count=0

count_a=a//x
count_b=b//x

if(a%x==0):
    count_a-=-1

count=count_b-count_a

print(count)
Problem p03998 (python)

Fixed submission:
def solve(sa, sb, sc, t):
	d = {'a': sa, 'b': sb, 'c': sc}
	if d[t] == '':
		return t.upper()
	u = d[t][0]
	d[t] = d[t][1:]
	return solve(d['a'], d['b'], d['c'], u)

SA = input()
SB = input()
SC = input()
print(solve(SA, SB, SC, 'a'))

Buggy submission (verdict: Runtime Error):
sa=input()
sb=input()
sc=input()

sa=list(sa)
sb=list(sb)
sc=list(sc)

for i in range(len(sa)+len(sb)+len(sc)):
    if(sa[0])
Problem p04043 (python)

Fixed submission:
a=input().strip().split(" ")

b=[int(i) for i in a]

if(b[0]==5 and b[1]==5 and b[2]==7):
    print("YES")
elif(b[1]==5 and b[2]==5 and b[0]==7):
    print("YES")
elif(b[2]==5 and b[0]==5 and b[1]==7):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a=input()

b=[int(i) for i in a]

if(b[0]==5 and b[1]==5 and b[2]==7):
    print("YES")
elif(b[1]==5 and b[2]==5 and b[0]==7)
    print("YES")
elif(b[2]==5 and b[0]==5 and b[1]==7)
    print("YES")
else:
    print("NO")
Problem p04044 (python)

Fixed submission:
N,L=map(int,input().strip().split(" "))
a=[]

for i in range(N):
    a.append(input())

a.sort()

b=str(a)
b=b.replace(",","")
b=b.replace("[","")
b=b.replace("]","")
b=b.replace("'","")
b=b.replace(" ","")


print(b)

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().strip().split(" "))
a=[]

for i in range(L):
    a.append(input())

a.sort()

b=str(a)
b=b.replace(",","")
b=b.replace("[","")
b=b.replace("]","")
b=b.replace("'","")
b=b.replace(" ","")


print(b)
Problem p02576 (python)

Fixed submission:
n, x, t = map(int, input().split())
if n % x == 0:
    ans = n//x
else :
    ans = n//x + 1
 
ans *= t
print(ans)

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

ans=N//X*T if N%X==0 else ans=(N//X+1)*T
print(ans)
Problem p02582 (python)

Fixed submission:
s = input()

if s == "RRR":
  print(3)
elif s == "RRS" or s == "SRR":
  print(2)
elif s == "SSS":
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
s = input()

if s = "RRR":
  print(3)
elif s = "RRS" or s = "SRR":
  print(2)
elif s = "SSS":
  print(0)
else:
  print(1)
Problem p02675 (python)

Fixed submission:
n=int(input())
n=n%10

if n in [2,4,5,7,9]:
  print("hon")
elif n in [0,1,6,8]:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
n=input()
n=list(n)
if n[len(n)-1]==3:
  print("bon")
elif n[len(n)-1]==0 or n[len(n)-1]==1 or n[len(n)-1]==6 or n[len(n)-1]==8:
  print("pon"):
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
n=input()
n=list(n)
if n[len(n)-1]==3:
  print("bon")
elif n[len(n)-1]==0,1,6,8:
  print("pon"):
else:
  print("hon")
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
a=0
for i in range(len(S)):
  if S[i]!=T[i]:
    a+=1
if a==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S,T=input()
a=0
for i in range(len(S)):
  if S[i]!=T[i]:
    a+=1
if a==0:
  print("Yes")
else:
  print("No")
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
if A-B*2<0:
  print(0)
else:
  print(A-B*2)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A=B*2<0:
  print(0)
else:
  print(A-B*2)
Problem p02921 (python)

Fixed submission:
s=input()
t=input()
cnt=0
for i in range(3):
  if s[i]==t[i]:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
s,t=input().split()
cnt=0
for i in range(3):
  if s[i]==t[i]:
    cnt+=1
print(cnt)
Problem p03238 (python)

Fixed submission:
n=int(input())

if n==1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)

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

if n==1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)
Problem p03493 (python)

Fixed submission:
s=input()
print(s.count('1'))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count=0
 
while all(a%2==0 for a in A):
  A=[a//2 for a in A]
  count+=1
 
print(count)
Problem p03494 (python)

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

while all(i%2==0 for i in A):
  A=[i//2 for i in A]
  cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
cnt=0
while True:
  if A%2==0:
    cnt+=1
  else:
    break
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
a=False
count=0

while True:
  for i in range(n):
    if A[i]%2==1:
      a=True
      break
    A[i]//=2
  if a=True:
    break    
  else:
    count+=1
  
print(count)
Problem p03729 (python)

Fixed submission:
A,B,C=input().split()

if A[len(A)-1]==B[0] and B[len(B)-1]==C[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A,B,C=input().split()

if A[len(A)-1]==B[0] and B[len(B-1)]==C[0]:
  print('YES')
else:
  print('NO')
Problem p03844 (python)

Fixed submission:
A,op,B=input().split()

if op=='+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
A,op,B=input().split()

if op=='+':
  print(int(A)+int(B))
else:
  print(int(-A)-int(B))
Problem p03860 (python)

Fixed submission:
a,s,c=input().split()
print(a[0]+s[0]+c[0])

Buggy submission (verdict: Runtime Error):
a,s,c=input().split()
print(a[0+s[0]+c[0])
Problem p02582 (python)

Fixed submission:
s = input()
ans = 0
for i in range(3):
  if s[i] == 'R':
  	ans += 1
  else:
    if ans == 1:
      break
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range(3):
  if s[i] == 'R'
  	ans += 1
  else:
    if ans == 1:
      break
print(ans)
Problem p02613 (python)

Fixed submission:
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
  s = input()
  if s == 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'TLE':
    tle += 1
  else:
    re += 1
print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))

Buggy submission (verdict: Runtime Error):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  s = input()
  if s == 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'tle':
    tle += 1
  else:
    re += 1
print('AC x ' + ac)
print('WA x ' + wa)
print('TLE x ' + tle)
print('RE x ' + re)
Problem p02630 (python)

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

ans = 0
n = [0] * 100005
for i in range(N):
    n[A[i]] += 1
    ans += A[i]
Q = int(input())
for i in range(Q):
    b, c = map(int, input().split())
    ans += c * n[b] - b * n[b]
    print(ans)
    n[c] += n[b]
    n[b] = 0

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

ans = 0
n = [0] * 10005
for i in range(N):
    n[A[i]] += 1
    ans += A[i]
Q = int(input())
for i in range(Q):
    b, c = map(int, input().split())
    ans += c * n[b] - b * n[b]
    print(ans)
    n[c] += n[b]
    n[b] = 0
Problem p02639 (python)

Fixed submission:
x = list(map(int, input().split()))
for i in range(5):
  if x[i] != i+1:
    print(i+1)

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split()))
for i in range(5):
  if x[i] != i+1
  	print(i+1)
Problem p02664 (python)

Fixed submission:
s = input()
print(s.replace('?', 'D'))

Buggy submission (verdict: Runtime Error):
s = input()
for i in range(len(s)):
    if s[i] == '?':
        s[i] = 'D'
print(s)
Problem p02755 (python)

Fixed submission:
A, B = map(int,input().split())

min8 = (A * 25 + 1) // 2 
max8 = ((A+1) * 25 - 1) // 2
min10 = B * 10
max10 = (B+1) * 10 - 1

if min10 > max8 or min8 > max10:
	print(-1)
else:
	print(max([min8, min10]))

Buggy submission (verdict: Runtime Error):
A, B = map(int,input().split())

min8 = (A * 25 + 1) // 2 
max8 = ((A+1) * 25 - 1) // 2
min10 = A * 10
max10 = (A+1) * 10 - 1

if min10 > max8 or min8 > mix10:
	print(-1)
else:
	print(min[min8, min10])
Problem p02791 (python)

Fixed submission:
min = 10000000
cnt = 0
N = int(input())
P = list(map(int, input().split()))

for i in range(N):
	p = P[i]
	if min >= p:
		min = p
		cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
max = 0
cnt = 0
N = int(input())
for _ in range(N):
	p = int(input())
	if max < p:
		max = p
		cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
max = 0
cnt = 0
N = int(input())
for _ in range(N):
	p = int(input())
	if max < p
		max = p
		cnt += 1
print(cnt)
Problem p02848 (python)

Fixed submission:
N = int(input())
S = input()
ans = ''
for i in range(len(S)):
  temp = ord(S[i]) - ord('A') + N
  ans += chr(ord("A") + temp%26 )
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
a = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
ans = ''
for i in range(len(S)):
  ans += a[(ord(S[i])-ord('A')+N)%26]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
a = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
ans = ''
for i in range(len(S)):
  ans += S[(i+N)%26]
print(ans)
Problem p02898 (python)

Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
ans = 0
for i in range(N):
	if h[i] >= K:
		ans += 1
print(ans)

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

ans = 0
for i in range(N):
	if h[i] >= K:
		ans += 1
print(ans)
Problem p02909 (python)

Fixed submission:
S = input()
if S == 'Sunny':
  print('Cloudy')
if S == 'Cloudy':
  print('Rainy')
if S == 'Rainy':
  print('Sunny')

Buggy submission (verdict: Runtime Error):
S = input()
if S == 'Sunny':
  print('Cloudy')
if S == 'Cloudy':
  print('Rainy'):
if S == 'Rainy':
  print('Sunny')
Problem p02910 (python)

Fixed submission:
S = input()
flag = 0
for i in range(len(S)):
	if i%2 == 0 and (S[i] not in ['R', 'U', 'D']):
		flag = 1
	if i%2 == 1 and (S[i] not in ['L', 'U', 'D']):
		flag = 1
if flag == 0:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
S = input()
flag = 0
for i in range(N):
	if i%2 == 0 and (S[i] not in ['R', 'U', 'D']):
		flag = 1
	if i%2 == 1 and (S[i] not in ['L', 'U', 'D']):
		flag = 1
if flag == 0:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
S = input()
flag = 0
for i in range(N):
	if i%2 = 0 and (S[i] not in ['R', 'U', 'D']):
		flag = 1
	if i%2 = 1 and (S[i] not in ['L', 'U', 'D']):
		flag = 1
if flag == 0:
	print('Yes')
else:
	print('No')
Problem p02917 (python)

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

ans = B[0]

for i in range(N-2):
	ans += min([B[i], B[i+1]])

ans += B[N-2]

print(ans)

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

ans = 0
for i in range(N):
	ans += min([A[i], A[i+1]])

ans += A[N-1]

print(ans)

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

ans = 0
for i in range(N):
	ans += min(A[i], A[i+1])

ans += A[N-1]

print(ans)
Problem p02775 (python)

Fixed submission:
n = list(map(int,input()))[::-1]
n.append(0)
for i in range(len(n)):
    if n[i] >= 6 or (n[i] == 5 and n[i+1] >= 5):
        n[i] = 10 - n[i]
        n[i+1] += 1
print(sum(n))

Buggy submission (verdict: Runtime Error):
n = list(map(int,input()))[::-1]
n.append(0)
for i in range(len(n)):
	if n[i] >= 6 or (n[i] == 5 and n[i+1] >= 5):
    	n[i] = 10 - n[i]
        n[i+1] += 1
print(sum(n))