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

Fixed submission:
c = input()
l = c.split()

x = int(l[0])
a = int(l[1])

if x < a:
    print(0)

elif a <= x:
    print(10)

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())

x = int(l[0])
a = int(l[1])

if x < a:
    print(0)

elif a <= x:
    print(10)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

X = input()
A = input()

x = int(X)
a = int(A)

if x < a:
    print(0)

elif a <= x:
    print(10)

Buggy submission (verdict: Runtime Error):
x = int(X)
a = int(A)

if x < a:
    print(0)

elif a <= x:
    print(10)

Buggy submission (verdict: Runtime Error):
if X < A:
    print(0)

elif A <= X:
    print(10)

else:
    pass

Buggy submission (verdict: Runtime Error):
X = input()
A = input()

if X < A:
    print(0)

elif A <= X:
    print(10)

Buggy submission (verdict: Runtime Error):
X = input()
A = input()

x = int(X)
a = int(A)

if x < a:
    print(0)

elif a <= x:
    print(10)

Buggy submission (verdict: Runtime Error):
X = input()
A = input()

x = int(X)
a = int(A)

if x < a:
    print(0)

elif a >= x:
    print(10)

Buggy submission (verdict: Runtime Error):
X = input()
A = input()

x = int(X)
a = int(A)

if x < a:
    print(0)

else :
    print(10)

Buggy submission (verdict: Runtime Error):
X = input()
A = input()

x = int(X)
a = int(A)

if x < a:
    print(0)

elif a <= x:
    print(10)

Buggy submission (verdict: Runtime Error):
X = input()
A = input()

x = int(X)
a = int(A)

if x < a:
    print(0)

elif a > x:
    print(10)
Problem p02641 (python)

Fixed submission:
import numpy as np
x,n = map(int, input().split())
if n != 0:
    p = list(map(int, input().split()))
if n == 0:
    print(x)
    exit()
ll = np.ones(1)*(-1)
for i in range(102):
    ll = np.append(ll,int(i))
    
for j in p:
    ll= ll[~(ll == j)]

if len(ll) == 0:
    print(x)
    exit()
# print(ll)

a = np.zeros(len(ll))
for i in range(len(ll)):
    a[i]=abs(x-ll[i])
# print(ll)
print(int(ll[np.argmin(a)]))

Buggy submission (verdict: Runtime Error):
import numpy as np
x,n = map(int, input().split())
if n != 0:
    p = list(map(int, input().split()))
if n == 0:
    print(x)
    exit()
ll = np.ones(1)
for i in range(99):
    ll = np.append(ll,int(i+1))
    
for j in p:
    ll= ll[~(ll == j)]

# print(ll)

a = np.zeros(len(ll))
for i in range(len(ll)):
    a[i]=abs(x-ll[i])
# print(ll)
print(int(ll[np.argmin(a)]))
Problem p02684 (python)

Fixed submission:
n,k = map(int, input().split())
a = list(map(int, input().split()))
import numpy as np
link = set()
next = a[0]
link.add(1)
while next not in link:
    link.add(next)
    next = a[next-1]

# print(next)
link2 = set()
next2 = a[0]
link2.add(1)
while next not in link2:
    link2.add(next2)
    next2 = a[next2-1]

link2.remove(next)
ans = 0

rep = len(link) - len(link2)
# print(rep)
if (len(link2) == 0):
    p = k%rep
    # print('e')
    for i in range(p+rep):
        next = a[next-1]
elif(k > len(link2)):
    # print('f')
    p = (k-len(link2))%rep
    # print(p)
    # print(next)
    for i in range(p+rep):
        next = a[next-1]
else:
    # print('d')
    next = a[0]
    for i in range(k-1):
        next = a[next-1]
# print(next)
ans = next
# print(link,link2)
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
a = list(map(int, input().split()))
import numpy as np
link = set()
next = a[0]
link.add(1)
while next not in link:
    link.add(next)
    next = a[next-1]
# print(next)
# print(list)

link2 = set()
next2 = a[0]
link2.add(1)
while next not in link2:
    link2.add(next2)
    next2 = a[next2-1]

ans = 0
rep = len(link)+1-len(link2)
# print(rep)
if(k > len(link2)-1):
    p = (k-len(link2)+2)%rep
    # print(p)

    # print(next)
    for i in range(len(link)-1):
        next = a[next]
else:
    for i in range(k):
        next = a[0]

ans = next
print(ans)

# for i in range(p):
Problem p02724 (python)

Fixed submission:
a = int(input());
b = a//500
c = a % 500 //5
print(b*1000+c*5)

Buggy submission (verdict: Runtime Error):
a = list(input())
if (a[2] == a[3]) & (a[4] == a[5]):
    print('Yes')
else:
    print('No')
Problem p02801 (python)

Fixed submission:
c = input()

l = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','y','z']
num = int(l.index(c))+1
print(l[num])

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

l = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','y','u','v','w','y','z']
num = int(l.index(c))+1
print(l[num])
Problem p02802 (python)

Fixed submission:
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=[]
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.append(h[i][0])
            penalty += p[i-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))
Problem p02969 (python)

Fixed submission:
import sys
r = int(input());
ans = 3*r*r;
print(ans);

Buggy submission (verdict: Runtime Error):
import sys
import math
import copy
a = int(input());
b = [int(input()) for i in range(a)];
c = 0;
f = max(b);
for i in range(a):
    if max(b) > b[i]:
        print(f);
    elif max(b) == b[i]:
        d = copy.copy(b);
        del d[i]
        e = max(d);
        print(e);
Problem p02971 (python)

Fixed submission:
import sys
import math
import copy
a = int(input());
b = [int(input()) for i in range(a)];
c = 0;
first = max(b);
g = b.copy();
h = g.index(first);
del g[h];
second = max(g);

for i in range(a):
    if first > b[i]:
        print(first);
    elif first == b[i]:
        print(second);

Buggy submission (verdict: Runtime Error):
import sys
import math
import copy
a = int(input());
b = [int(input()) for i in range(a)];
c = 0;
first = max(b);
g = b.copy();
h = list(g.index(first));
del g[h];
second = max(g);

for i in range(a):
    if max(b) > b[i]:
        print(first);
    elif first == b[i]:
        print(second);
Problem p03323 (python)

Fixed submission:
c = input().split()

a = int(c[0])
b = int(c[1])

if a > 8:
    print(':(')

elif b > 8:
    print(':(')

elif a+b > 16:
    print(":(")

else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
i = int(input())
ii = input().split()

a = int(0)
n = int(0)
m = int(0)
k = int(0)
for n in ii:
    a = int(n)
    for m in range(i):
      while (a % 1 == 0):
        a = a/2
        if (a % 1 == 0):
            k += 1

print(k)

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

a = input()
b = input()

a = int(a)
b = int(b)
if a > 8:
    print(':(')

elif b > 8:
    print(':(')

elif a+b > 16:
    print(":(")

else:
    print("Yay!")
Problem p02714 (python)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline                               
def I(): return list(map(int,inp().split()))
from collections import Counter
from numpy import prod

n=I()[0]
s=input() 
cut=0
for i in range(len(s)):
    for j in range(i+1,len(s)):
        if 2*j-i>=len(s): break
        if len({s[i],s[j],s[2*j-i]})==3:
            cut+=1
d=Counter(s)
if len(d)<3: print(0)
else: print(prod(list(d.values()))-cut)

Buggy submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline                               
def I(): return list(map(int,inp().split()))
from collections import Counter
from numpy import prod

n=I()[0]
s=input() 
cut=0
for i in range(len(s)):
    for j in range(i+1,len(s)):
        if 2*j-i>=len(s): break
        if len({s[i],s[j],s[2*j-i]})==3:
            cut+=1
d=Counter(s)
print(prod(list(d.values()))-cut)

Buggy submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline                               
def I(): return list(map(int,inp().split()))
from collections import Counter
from numpy import prod

n,=I()
s=input() 
cut=0
for i in range(len(s)):
    for j in range(i+1,len(s)):
        if 2*j-i>=len(s): break
        if len({s[i],s[j],s[2*j-i]})==3:
            cut+=1
d=Counter(s)
print(prod(list(d.values()))-cut)
Problem p02882 (python)

Fixed submission:
import math
a,b,x=map(int,input().split())
c1=a*a*b/2
if x==a*a*b:
    print(0.0)
    exit(0)
if x>c1:
    ans=math.atan((a*a*a)/((2*a*a*b)-(2*x)))
    ans=math.degrees(ans)
    print(90-ans)
else:
    ans=math.atan((2*x)/(a*b*b))
    ans=math.degrees(ans)
    print(90-ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
c1=a*a*b/2
if x=a*a*b:
    print(0.0)
    exit(0)
if x>c1:
    ans=math.atan((a*a*a)/((2*a*a*b)-(2*x)))
    ans=math.degrees(ans)
    print(90-ans)
else:
    ans=math.atan((2*x)/(a*b*b))
    ans=math.degrees(ans)
    print(90-ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
c1=a*a*b/2
if x=a*a*b:
    print(0.0)
if x>c1:
    ans=math.atan((a*a*a)/((2*a*a*b)-(2*x)))
    ans=math.degrees(ans)
    print(90-ans)
else:
    ans=math.atan((2*x)/(a*b*b))
    ans=math.degrees(ans)
    print(90-ans)

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

Fixed submission:
from fractions import gcd
a,b,c,d=map(int,input().split())
ans=(b-a+1)
lcm=(c*d)//gcd(c,d)
dba=(a//c-int(a%c==0))+(a//d-int(a%d==0))-(a//lcm-int(a%lcm==0))
dbb=(b//c)+(b//d)-(b//lcm)
dbb-=dba
ans-=dbb
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c,d=map(int,input().split())
ans=(b-a+1)
lcm=(c*d)//gcd(c,d)
dba=(a//c-int(a%c==0))+(a//d-int(a%d==0))-(a//lcm-int(a%lcm==0))
dbb=(b//c)+(b//d)-(b//lcm)
dbb-=dba
ans-=dbb
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()
from math import gcd
a,b,c,d=map(int,input().split())
ans=(b-a+1)
lcm=(c*d)//gcd(c,d)
dba=(a//c-int(a%c==0))+(a//d-int(a%d==0))-(a//lcm-int(a%lcm==0))
dbb=(b//c)+(b//d)-(b//lcm)
dbb-=dba
ans-=dbb
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()
from math import gcd
a,b,c,d=map(int,input().split())
ans=(b-a+1)
lcm=(c*d)//gcd(c,d)
dba=(a//c-int(a%c==0))+(a//d-int(a%d==0))-(a//lcm-int(a%lcm==0))
dbb=(b//c)+(b//d)-(b//lcm)
dbb-=dba
ans-=dbb
print(ans)
Problem p03160 (python)

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
b=[0]*n
b[n-2]=abs(a[n-1]-a[n-2])
for i in range(n-3,-1,-1):
    b[i]=min(abs(a[i]-a[i+1])+b[i+1],abs(a[i]-a[i+2])+b[i+2])
print(b[0])

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
k=2
a=[int(i) for i in input().split()]
b=[0]*n
b[n-2]=abs(a[n-1]-a[n-2])
for i in range(n-3,-1,-1):
    mini=math.inf
    for j in range(i+1,min(n,i+k+1)):
        x=abs(a[j]-a[i])+b[j]
        mini=min(mini,x)
    b[i]=mini
print(b[0])
Problem p03161 (python)

Fixed submission:
import math
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[0]*n
b[n-2]=abs(a[n-1]-a[n-2])
for i in range(n-3,-1,-1):
    c=[]
    for j in range(i+1,min(n,i+k+1)):
        c.append(abs(a[j]-a[i])+b[j])
    b[i]=min(c)
print(b[0])

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
k=2
a=[int(i) for i in input().split()]
b=[0]*n
b[n-2]=abs(a[n-1]-a[n-2])
for i in range(n-3,-1,-1):
    c=[]
    for j in range(i+1,min(n,i+k+1)):
        c.append(abs(a[j]-a[i])+b[j])
    b[i]=min(c)
print(b[0])

Buggy submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[0]*n
b[n-2]=abs(a[n-1]-a[n-2])
for i in range(n-3,-1,-1):
    mini=math.inf
    for j in range(i+1,min(n,i+k+1)):
        x=abs(a[j]-a[i])+b[j]
        mini=min(mini,x)
    b[i]=mini
print(b[0])

Buggy submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[0]*n
b[n-2]=abs(a[n-1]-a[n-2])
for i in range(n-3,-1,-1):
    mini=math.inf
    for j in range(i+1,min(n,i+k+1)):
        x=abs(a[j]-a[i])+(b[j] if j<n-1 else b[n-1])
        mini=min(mini,x)
    b[i]=mini
print(b[0])
Problem p03308 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Amin = min(A)
Amax = max(A)
print(abs(Amax-Amin))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
Amin = min(A)
Amax = max(A)
print(abs(Amax-Amin))
Problem p03337 (python)

Fixed submission:
A, B = map(int, input().split())
print(max(A+B, A-B, A*B))

Buggy submission (verdict: Runtime Error):
A, B = map(int(input()))
print(max(A+B, A-B, A*B))
Problem p03477 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
lw = A+B 
rw = C+D 
if lw > rw:
    print('Left')
elif lw < rw:
    print('Right')
else:
    print('Balanced')

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
lw = A+B 
rw = C+D 
if lw > rw:
    print(Left)
elif lw < rw:
    print(Right)
else:
    print(Balanced)
Problem p03777 (python)

Fixed submission:
a, b = input().split()
if a == 'H' and b =='H':
    print('H')
elif a == 'H' and b == 'D':
    print('D')
elif a == 'D' and b == 'H':
    print('D')
elif a == 'D' and b == 'D':
    print('H')

Buggy submission (verdict: Runtime Error):
a, b = input().split()
if a = 'H' and b ='H':
    print('H')
elif a = 'H' and b ='D':
    print('D')
elif a = 'D' and b = 'H':
    print('D')
elif a = 'D' and b = 'D':
    print('H')
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
print((a+b)*h/2)
Problem p04011 (python)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N >= K:
    print(K*X + (N-K)*Y)
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())
print(K*X + (N-K)*Y)
Problem p02576 (python)

Fixed submission:
N,X,T=[int(i) for i in input().split()]
a=divmod(N,X)
x=a[0]
if a[1]<X and a[1] != 0:
  x += 1
print(x*T)

Buggy submission (verdict: Runtime Error):
N,X,T=[int(i) fir i in input().split()]
a=divmod(N,X)
x=a[0]
if a[1]<X and a[1] != 0:
  x += 1
print(x*T)
Problem p02687 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
if S == "ABC":
    print(ARC)
else:
    print(ABC)

Buggy submission (verdict: Runtime Error):
S = input()
if S == ABC:
    print(ARC)
else:
    print(ABC)
Problem p02694 (python)

Fixed submission:
x = int(input())
y = 100
a = 0
while y < x:
    y += y // 100
    a += 1
print(a)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = 100
A = 0
While X < Y:
    Y *= 1.01
    A += 1
print(A)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = 100
A = 0
While X < Y:
    Y *= a * 1.01
    A += 1
print(A)
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, (input().split()))
h = list(map(int, input().split()))

x = []

for i in h:
    b = abs(t - 0.006 * i - a)
    x.append(b)

print(x.index(min(x)) + 1)

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

x = []

for i in h:
    b = t - 0.006 * j - a
    x.append(b)

print(x.index(min(x)))
Problem p03254 (python)

Fixed submission:
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0
for i in a:
    if x < i:
        break
    cnt += 1
    x -= i
else:
    if x > 0:
        cnt -= 1
print(cnt)

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

a.sort()
count = 0

for i in a:
    if x >= a[min]:
        x -= i
        count += 1
    else:
        pass
        
print(count)

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

a.sort()
count = 0

while x > min(a):
for i in a:
    if x >= i:
        x -= i
        count += 1
    else:
        pass
        
print(count)
Problem p03285 (python)

Fixed submission:
n = int(input())

count = 0

for i in range(26):
    for j in range(15):
        if 4 * i + 7 * j == n:
            count += 1
            break
        else:
            pass

if count == 0:
    print("No")
else:
    print("Yes")

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

a = n // 4
b = n // 7
count = 0

for i in range(a + 1):
    n = n - i * 4
    for j in range(b + 1):
        if 4 * i + 7 * j == n:
            print(yes)
            count += 1
            break
        else:
            pass

if count == 0:
    print("No")
else:
    pass
Problem p03308 (python)

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

x.sort()

answer = x[-1] - x[0]

print(answer)

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

list.sort()

answer = list[-1] - list[0]

print(answer)
Problem p03448 (python)

Fixed submission:
abc = [int(input()) for i in range(3)]
x = int(input())

count = 0

for i in range(abc[0] + 1):
    for j in range(abc[1] +1):
        for k in range(abc[2] +1):
            if 500*i + 100*j + 50*k == x:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
abc = [int(input()) for i in range(3)]
x = int(input())

count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i + 100*j + 50*k == x:
                count += 1
print(count)
Problem p03455 (python)

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

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

Fixed submission:
x = int(input())
y = list(map(int, input().split()))

z = True
count = -1
while z == True:
    count += 1
    for i, j in enumerate(y):
        if j % 2 == 0:
            y[i] = j / 2
        else:
            z = False

print(count)

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

count = 0

for i in y:
    if i % 2 = 0:
        y[i] == i % 2
        count += 1
    else:
        pass
Problem p03502 (python)

Fixed submission:
n = int(input())

f = False

x = sum(list(map(int, str(n))))

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")

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

f = False

x = sum(map(int,list(n)))

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")
Problem p03658 (python)

Fixed submission:
n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse = True)

length = sum(l[0 : k])

print(length)

Buggy submission (verdict: Runtime Error):
15 14
50 26 27 21 41 7 42 35 7 5 5 36 39 1 45
Problem p03814 (python)

Fixed submission:
S = input()
print(S.rfind("Z") - S.find("A")+1)

Buggy submission (verdict: Runtime Error):
c = input()
s = []
for i in c:
    s.append(i)

list_a = []
list_z = []

while "a" in s:
    list_a.append(s.index("a"))
    s[s.index("a")] = "b"

while "z" in s:
    list_z.append(s.index("z"))
    s[s.index("z")] = "v"

answer = list_z[-1] - list_a[0] + 1
print(answer)
Problem p03854 (python)

Fixed submission:
s = input()
n = len(s)

list = ["dream", "dreamer", "erase", "eraser"]

s = s[::-1]

while True:
    if s.startswith(list[0][::-1]):
        n -= 5
        s = s[5:]
    elif s.startswith(list[1][::-1]):
        n -= 7
        s = s[7:]
    elif s.startswith(list[2][::-1]):
        n -= 5
        s = s[5:]
    elif s.startswith(list[3][::-1]):
        n -= 6
        s = s[6:]
    else:
        break

if s == "":
    print("YES")
else:
    print("NO")

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

list = ["dream", "dreamer", "erase", "eraser"]

for i in list:
    s = s.replace(i, "x")

s.sort()

if s[0] == s[-1] and s[-1] == "x":
    print("YES")
else:
    print("NO")
Problem p04043 (python)

Fixed submission:
l = list(map(int, input().split()))
l.sort()

if l == [5, 5, 7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
List = list(map(int, input().split()))
if sum(list) == 17 and List.count(5) == 2:
    print('YES')
else:
    print('NO')
Problem p03106 (python)

Fixed submission:
import fractions
A,B,K=map(int,input().split())
C=fractions.gcd(A,B)
cnt=0
for x in range(C,0,-1):
    if C%x==0:
        cnt+=1
        if cnt==K:
            print(x)
            break

Buggy submission (verdict: Runtime Error):
import math
A,B,K=map(int,input().split())
C=math.gcd(A,B)
cnt=0
for x in range(C,0,-1):
    if C%x==0:
        cnt+=1
        if cnt==K:
            print(x)
            break

Buggy submission (verdict: Runtime Error):
import math
A,B,K=map(int,input().split())
C=math.gcd(A,B)
cnt=0
for x in range(C,-1,-1):
    if C%x==0:
        cnt+=1
        if cnt==K:
            print(x)
            break

Buggy submission (verdict: Runtime Error):
import math
A,B,K=map(int,input().split())
C=math.gcd(A,B)
count=0
for x in range(C,-1,-1):
    if C%x==0:
        count+=1
    if count==K:
        print(x)
        break

Buggy submission (verdict: Runtime Error):
import math
A,B,K=map(int,input().split())
C=math.gcd(A,B)
count=0
for x in range(C,-1,-1):
    if C%x==0:
        count+=1
        if count==K:
            print(x)
            break

Buggy submission (verdict: Runtime Error):
import math
A,B,K=map(int,input().split())
C=math.gcd(A,B)
count=0
for x in range(C,-1,-1):
    if C%x==0:
        count+=1
        if count==K:
            print(x)
            break

Buggy submission (verdict: Runtime Error):
from math import gcd
A,B,K=map(int,input().split())
C=gcd(A,B)
count=0
for x in range(C,-1,-1):
    if C%x==0:
        count+=1
        if count==K:
            print(x)
            break
exit()

Buggy submission (verdict: Runtime Error):
from math import gcd
A,B,K=map(int,input().split())
C=gcd(A,B)
count=0
for x in range(C,-1,-1):
    if C%x==0:
        count+=1
        if count==K:
            ans=x
            break
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
A,B,K=map(int,input().split())
C=gcd(A,B)
count=0
for x in range(C,-1,-1):
    if C%x==0:
        count+=1
        if count==K:
            print(x)
            break

Buggy submission (verdict: Runtime Error):
from math import gcd
A,B,K=map(int,input().split())
C=gcd(A,B)
count=0
for x in range(1,C+1):
    if C%x==0:
        count+=1
        if count==K:
            print(x)
            break
Problem p03145 (python)

Fixed submission:
A,B,C=map(int,input().split())
print(int(A*B/2))

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