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

Fixed submission:
S = list(input())
s1 = list("keyence")

x = []
y = []
for i in range(7):
  if S[i] == s1[i]:
    x.append(1)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(1)
  

if sum(x) + sum(y) >= 7:
  print("YES")  
else:
  print("NO")

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

for i in range(len(n)):
  if n[i] == 1:
    n[i] = 1
  elif n[i] == 7:
    n[i] = 10
  elif n[i] == 9:
    n[i] = 100
  elif n[i] == 4:
    n[i] = 1000
    
if sum(n) == 1111:
  print("YES")
else:
  print("NO")


S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[len(x)-1])
  else:
    x.append(0)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[len(y)-1])
  else:
    x.append(0)

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[i])
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[i])
  

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[i-1])
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[i-1])
  

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
S = list(input())
s1 = list("keyence")

x = 0
y = 0
z = 0
for i in range(len(S)):
  if S[i] == s1[x]:
    x += 1
    z = 0
  elif z != 0:
    y += 1
    z = 1


if y <= 1 and x != 0:
  print("YES")  
else:
  print("NO")
Problem p03192 (python)

Fixed submission:
N = str(input())
count = 0

for i in N:
  if i=="2":
     count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())
b=0
a = int(pow(P, 1/N))
for i in range(1, a+1):
  if P % pow(a+1-i,N) == 0:
     b = a+1-i
     break
print(b)
Problem p02993 (python)

Fixed submission:
x = input().rstrip()
count = 0
temp = ""
how = True
for i in x:
  if temp == i:
    how=False
  temp = i

if how:
  print("Good")
else:
  print("Bad")

Buggy submission (verdict: Runtime Error):
x = input().rstrip().split("")
count = 0
temp = ""
how = True
for i in x:
  if temp == i:
    how=False
  temp = i

if how:
  print("Good")
else:
  print("Bad")
Problem p02999 (python)

Fixed submission:
y = list(map(int,input().rstrip().split(" ")))
X,A = y[0],y[1]
if X < A:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
    return x1[0]

y = makey(x1,x2)
print(y+1)

Buggy submission (verdict: Runtime Error):
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
    return i
y = makey(x1,x2)
print(y+1)
Problem p03000 (python)

Fixed submission:
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
  return i+1
y = makey(x1,x2)
print(y+1)

Buggy submission (verdict: Runtime Error):
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
y = makey(x1,x2)
print(y+1)
Problem p03730 (python)

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

#for i in range(1, 101):
mods = list()
i = 1
while(True):
    #print("A * i = " + str(A * i) + ", mod = " + str((A * i) % B))
    mod = (A * i) % B
    if (mod == C):
        print("YES")
        break
    elif(mod in mods):
        print("NO")
        break
    else:
        mods.append(mod)
    i += 1

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

#for i in range(1, 101):
mods = list()
while(True):
    #print("A * i = " + str(A * i) + ", mod = " + str((A * i) % B))
    mod = (A * i) % B
    if (mod == C):
        print("Yes")
        break
    elif(mod in mods):
        print("No")
        break
    else:
        mods.append(mod)
Problem p03854 (python)

Fixed submission:
def isDaydream(s):
    while s != "":
        if s.endswith("dream"):
            s = s[:-5]
        elif s.endswith("dreamer"):
            s = s[:-7]
        elif s.endswith("erase"):
            s = s[:-5]
        elif s.endswith("eraser"):
            s = s[:-6]
        else :
            return False
    return True

if(isDaydream(input())):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(s):
    if s == "":
        return True
    for string in strings:
        if s.endswith(string):
            if(isDaydream(s[:len(string)*-1])):
                return True
    return False
if(isDaydream(input())):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(startindex):
    if S[startindex:] == "":
        return True
    for string in strings:
        if S[startindex:].startswith(string):
            if(isDaydream(len(string)+startindex)):
                return True
    return False
S = input()
if(isDaydream(0)):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(startindex):
    global S
    if S[startindex:] == "":
        return True
    for string in strings:
        if S[startindex:].startswith(string):
            if(isDaydream(len(string)+startindex)):
                return True
    return False
S = input()
if(isDaydream(0)):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(s):
    if s == "":
        return True
    for string in strings:
        if s.startswith(string):
            if(isDaydream(s[len(string):])):
                return True
    return False
if(isDaydream(input())):
    print("YES")
else:
    print("NO")
Problem p03079 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a = input().split()

if a[0] == a[1] and a[1] == a[2]:
    print('Yes')
else:
    print('No')

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

nq = input().split()
s = input()
td = []
for i in range(int(nq[1])):
    td.append(input().split())

g_list = [1] * int(nq[0])

for i in range(0, int(nq[1])):
    for j in range(0, int(nq[0])):
        if td[i][0] == s[j]:
            if td[i][1] == 'R':
                if j != int(nq[0]) -1:
                    g_list[j+1] += g_list[j]
                g_list[j] = 0
            else:
                if j != 0:
                    g_list[j-1] += g_list[j]
                g_list[j] = 0
#    print(g_list)

print(sum(g_list))
Problem p03231 (python)

Fixed submission:
import math


N, M = map(int, input().split())
S = input()
T = input()

if N>M:
    N,M = M,N
    S,T = T,S
    
def gcd(a, b):
    while b:
	    a, b = b, a % b
    return a
    
L = int(M*N/gcd(N, M))

for i in range(N):
    if (M*i)%N == 0:
        j = int((M*i)/N)
        if S[i] != T[j]:
            print(-1)
            exit(0)

print(L)

Buggy submission (verdict: Runtime Error):
import math


N, M = map(int, input().split())
S = input()
T = input()

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
L = int(M*N/gcd(N, M))
X = 'A'*int(L)

for i, s in enumerate(S):
    j = int(L/N*i)
    if X[j] == 'A':
        X = X[:j]+s+X[j+1:]
    elif X[j] == s:
        continue
    else:
        print(-1)
        exit(0)

        
for i, t in enumerate(T):
    j = int(L/M*i)
    if X[j] == 'A':
        X = X[:j]+t+X[j+1:]        
    elif X[j] == t:
        continue
    else:
        print(-1)
        exit(0)

print(L)

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int, input().split())
S = input()
T = input()

L = int(M*N/math.gcd(N, M))
X = 'A'*int(L)

for i, s in enumerate(S):
    j = int(L/N*i)
    if X[j] == 'A':
        X = X[:j]+s+X[j+1:]
    elif X[j] == s:
        continue
    else:
        print(-1)
        exit(0)

        
for i, t in enumerate(T):
    j = int(L/M*i)
    if X[j] == 'A':
        X = X[:j]+t+X[j+1:]        
    elif X[j] == t:
        continue
    else:
        print(-1)
        exit(0)

print(L)
Problem p03254 (python)

Fixed submission:
N, x = input().split()
N = int(N)
x = int(x)
al = [int(a) for a in input().split()]

al.sort()

cum = [sum(al[:i+1])for i in range(len(al))]

ans = N-1
for i in range(len(al)):
    if cum[i] == x:
        ans = i+1
        break
    elif cum[i]>x:
        ans = i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
N, x = input().split()
N = int(N)
x = int(x)
al = [int(a) for a in input().split()]

al.sort()

used = 0
ans = 0
for a in enumerate(al:
    if used+a > x:
        break
    used += a
    ans += 1

print(ans)
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)

Buggy submission (verdict: Runtime Error):
n=input()
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)

Buggy submission (verdict: Runtime Error):
n=input()
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[abs(t-x*0.006) for x in h]
print(h2.index(min(h2))+1)

Buggy submission (verdict: Runtime Error):
n=input()
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[t-x*0.006 for x in h]
print(h2.index(min(h2))+1)
Problem p03369 (python)

Fixed submission:
tp=input()
ttl=700
for i in tp:
  if i == "o":
    ttl+=100
print(ttl)

Buggy submission (verdict: Runtime Error):
tp=input()
ttl=700
for i in tp:
  if i = "o":
    ttl+=100
print(ttl)
Problem p03433 (python)

Fixed submission:
n=int(input())
a=int(input())
if  n%500<=a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
a=input()
if n%500<a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
a=input()
if n<500 and a>=n:
  print("Yes")
elif n>=500 and n%500<a:
  print("Yes")
else:
  print("No")
Problem p03610 (python)

Fixed submission:
s=list(input())
s2=''
for i in range(len(s)):
  if i%2==0:
    s2+=s[i]
print(s2)

Buggy submission (verdict: Runtime Error):
s=list(input())
s2=''
for i in range(len(s)):
  if i%==0:
    s2+=s[i]
print(s2)

Buggy submission (verdict: Runtime Error):
s=list(input())
s2=""
for i in range(len(s)):
  if i%==0:
    s2+=s[i]
print(s2)

Buggy submission (verdict: Runtime Error):
s=list(input())
s2=""
for i in range(len(s)):
  if i%==2:
    s2+=s[i]
print(s2)

Buggy submission (verdict: Runtime Error):
s=list(input())
s2=""
for i in range(len(s)):
  if i%==2:
    s2+=a[i]
print(s2)
Problem p03644 (python)

Fixed submission:
n=int(input())
a=0
for i in range(100):
  if a<=n:
    a=2**(i+1)
  else:
    print(2**(i-1))
    exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
a=0
for i in 100:
  if a<n:
    a=2^(i+1)
print(2^(i-1))
Problem p03814 (python)

Fixed submission:
s=input()
sento=2000000
matubi=0

for i in range(len(s)):
  if s[i] == "A":
    sento=min(i,sento)
for i in range(len(s)):
  if s[i] == "Z" and i > sento:
    matubi=max(i,matubi)
print(matubi-sento+1)

Buggy submission (verdict: Runtime Error):
s=input()
sento=0
matubi
for i in range(s):
  if s[i] == "A":
    sento=i
    break
for i in range(s):
  if s[i] == "Z" and i > sento:
    matubi=i
    break
print(s[sento+1:matubi+1])

Buggy submission (verdict: Runtime Error):
s=input()
sento=0
matubi
for i in range(s):
  if s[i] == "A":
    sento=i
    break
for i in range(s):
  if s[i] == "Z" and i > sento:
    matubi=i
    break
print(s[sento:matubi+1])
Problem p04029 (python)

Fixed submission:
num=int(input())
candy=0
ans=0
for i in range(num):
  candy+=1
  ans+=candy
print(ans)

Buggy submission (verdict: Runtime Error):
num=input()
candy=0
ans=0
for i in range(num):
  candy+=1
  ans+=candy
print(ans)
Problem p04043 (python)

Fixed submission:
input_line = input().split()
#print(input_line)
count5 = 0
count7 = 0
#print(input_line[0])
#print(len(input_line))
for i in range(len(input_line)):
#  print(input_line[i])
  if int(input_line[i]) == 5:
#    print(input_line[i])
    count5 += 1
#    print(count5)
  elif int(input_line[i]) == 7:
    count7 += 1
#    print(count7)
if count5 == 2 and count7 == 1:
  print("YES")
#  print(count5,count7)
else:
#  print(count5,count7)
  print("NO")

Buggy submission (verdict: Runtime Error):
input_line = input().split()
#print(input_line)
count5 = 0
count7 = 0
#print(input_line[0])
#print(len(input_line))
for i in range(len(input_line)):
#  print(input_line[i])
  if int(input_line[i]) == 5:
#    print(input_line[i])
    count5 += 1
#    print(count5)
  elif int(input_line[i]) == 7:
    count7 += 1
#    print(count7)
if count5 == 2 and count7 == 1:
  print("YES")
#  print(count5,count7)
else:
#  print(count5,count7)
Problem p03059 (python)

Fixed submission:
a, b, t = map(int, input().split())

print((t // a) * b)

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

a = [int(i) for i in input().split()]

# n が 2なら 大きい方を出力して終わり

#def euclid(m, n):
#  if n == 0:
#    return m
#  new_m = n
#  new_n = m % n
#  return euclid(new_m, new_n)
#
#def array_euclid(numbers):
#  n = len(numbers)
#  v = numbers[n-1] % numbers[n-2]
#  if v == 0:
#    if n == 2:
#      return numbers[0]
#    
#    numbers.pop()
#    return array_euclid(numbers)
#
#  numbers[n-1] = numbers[n-2]
#  numbers[n-2] = v
#  return array_euclid(numbers)

#print(array_euclid(a))

#if n == 2:
#  print(euclid(a[0], a[1]))
#if n > 2:
#  max_list = []
#  max_list.append(array_euclid(a[:]))
#  for i in range(n):
#    a2 = a[:]
#    a2.pop(i)
#    max_list.append(array_euclid(a2))
#  print(max(max_list))
#


# n が3になるまでやって、大きい方が答え？

#for i in range(n-1):


#print(euclid(a[0],a[1]))


# 最大公約数を求めるには math.gcd を使う

from fractions import gcd
from functools import reduce

def gcd_list(numbers):
  return reduce(gcd, numbers)

max_list = []
max_list.append(gcd_list(a))
for i in range(n):
  a2 = a[0:i] + a[i+1:]
  #a2.pop(i)
  max_list.append(gcd_list(a2))
print(max(max_list))
Problem p03337 (python)

Fixed submission:
a, b = map(int, input().split())

ans1 = a + b
ans2 = a - b
ans3 = a * b

if ans1 > ans2:
  if ans1 > ans3:
    print(ans1)
  else:
    print(ans3)
else:
  if ans2 > ans3:
    print(ans2)
  else:
    print(ans3)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
s = input()
min_people = n - 1

def we_counter(pos):
  front = s[:pos]
  back = s[pos+1:]
  people = front.count('W') + back.count('E')
  return people


for i in range(n):
  people = we_counter(i)

  if people < min_people:
    min_people = people

print(min_people)
Problem p02921 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ans = 0
for i in range(3):
	if s[i] == t[i]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ans = 0
for i in range(3):
	if s[i] == t[i]:
    	ans += 1
print(ans)
Problem p02945 (python)

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

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

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

Fixed submission:
n = int(input())
s = [[x for x in input()] for _ in range(n)]
ans = 0
d = {}
for i in range(n):
    key = "".join(sorted(s[i]))
    if key in d:
        ans += d[key]
        d[key] += 1
    else:
        d[key] = 1

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
import math

n = int(input())
s = [input() for _ in range(n)]
ans = 0
while len(s) > 0:
    count = 1
    si = Counter([x for x in s[0]])
    j = 1
    while j < len(s):
        if si == Counter([x for x in s[j]]):
            count += 1
            s.pop(j)
        else:
            j += 1
    ans += math.factorial(count) // (2 * math.factorial(count-2))
    s.pop(0)
print(ans)
Problem p02971 (python)

Fixed submission:
n = int(input())
num = [int(input()) for _ in range(n)]
m = max(num)
sec = sorted(num)[-2]
for x in num:
    if x != m:
        print(m)
    else:
        print(sec)

Buggy submission (verdict: Runtime Error):
n = int(input())
num = [int(input()) for _ in range(n)]
m = max(num)
sec = num.sort[-2]
for x in num:
  if x != m:
    print(x)
  else:
    print(sec)
Problem p02972 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0 for _ in range(n)]
for i in range(n, 0, -1):
    if sum(b[i-1::i])%2 != a[i-1]:
        b[i-1] = 1

c = [i+1 for i in range(n) if b[i] == 1]
if len(c) != 0:
    print(len(c))
    print(*c)
else:
    print("0")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = [0 for _ in range(n)]
for i in range(1, n, -1):
    if sum(b[i::i])%2 == a[i]:
        b[i] = 0
    else:
        b[i] = 1
if sum(b)%2 == a[0]:
    b[0] = 0
else:
    b[0] = 1

if sum(b) != 0:
    print(sum(b))
    ans = []
    for i in range(n):
        if b[i] == 1:
            ans.append(i)
    print(ans.join(" "))
else:
    print("0")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
b = [0 for _ in range(n)]
for i in range(1, n, -1):
    if sum(b[i::i])%2 == a[i]:
        b[i] = 0
    else:
        b[i] = 1
if sum(b)%2 == a[0]:
    b[0] = 0
else:
    b[0] = 1

if sum(b) != 0:
    print(sum(b))
    ans = []
    for i in range(n):
        if b[i] == 1:
            ans.append(i)
    print(ans.join(" "))
else:
    print("0")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
b = [0 for _ in range(n)]
for i in range(0, n, -1):
    if sum(b[i::i])%2 == a[i]:
        b[i] = 0
    else:
        b[i] = 1
if sum(b) != 0:
    print(sum(b))
    ans = []
    for i in range(n):
        if b[i] == 1:
            ans.append(i)
    print(ans.join(" "))
else:
    print("0")
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())
m = 2019
l, r = l%m, l%m+(r-l)
if r-l >= m-1:
    print(0)

else:
    mi = 2018
    for i in range(l, r):
        for j in range(i+1, r+1):
            m = (i*j)%2019
            mi = min(m, mi)
    print(mi)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())
m = 2019
l, r = l%m, l%m+(r-l)
if r-l >= m-1:
    print(0)

mi = 2018
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            m = (i*j)%2019
            mi = min(m, mi)
    print(mi)
Problem p02995 (python)

Fixed submission:
import math
import fractions
l, r, p1, p2 = list(map(int, input().split()))
lcm = p1*p2 // fractions.gcd(p1, p2)
ans = (r-l+1) - (r//p1-(l-1)//p1) - (r//p2-(l-1)//p2) + (r//lcm)-(l-1)//lcm
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import fractions
l, r, p1, p2 = list(map(int, input().split()))
lcm = p1*p2 // fractions.gcd(p1, p2)
ans = (r-l+1) - (r//p1-(l-1)//p1) - (r//p2)-(l-1)//p2) + (r//lcm)-(l-1)//lcm
print(ans)

Buggy submission (verdict: Runtime Error):
import math
l, r, p1, p2 = list(map(int, input().split()))
lcm = int(p1*p2 / math.gcd(p1, p2))
ans = (r-l+1) - (math.floor(r/p1)-math.ceil(l/p1)+1) - (math.floor(r/p2)-math.ceil(l/p2)+1) + math.floor(r/lcm)-math.ceil(l/lcm)+1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from fractions import gcd

l, r, p1, p2 = list(map(int, input().split()))
lcm = int(l*r / gcd(p1, p2))
ans = (r-l+1) - (math.floor(r/p1)-math.ceil(l/p1)+1) - (math.floor(r/p2)-math.ceil(l/p2)+1) + math.floor(r/lcd)-math.ceil(l/lcd)+1
print(ans)
Problem p02921 (python)

Fixed submission:
pre = input().rstrip()
sur = input().rstrip()
num = len([n for n in range(len(pre)) if pre[n] == sur[n]])
print(num)

Buggy submission (verdict: Runtime Error):

pre = input().rstrip()
sur = input().rstrip()
num = len([n for n in range(len(pre)) if pre[n] = sur[n]])
print(num)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
for i in a:
    ans = bin(i).find("1") - 1
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = bin(i).find("1") - 1
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = bin(i).rfind("1") - 1
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = bin(i).rfind("1") - 1
print(round(ans))
Problem p02993 (python)

Fixed submission:
pw = input()

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

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

def gcd(x,y):

    if(y>x):
        x,y = y,x
    if(x%y==0):
        return y
    else:return gcd(y,x%y)


def lcm(x,y):
    return x*y//gcd(x,y)


Bika = B - B//C -B//D + B//lcm(C,D)
Aika = A-1 - (A-1)//C -(A-1)//D + (A-1)//lcm(C,D)

print(Bika-Aika)
Problem p03369 (python)

Fixed submission:
s = input()
t = 700 + (100 * s.count("o"))
print(t)

Buggy submission (verdict: Runtime Error):
import math
n, w = map(int, input().split())
m = list()
for i in range(n):
  m.append(int(input()))

w -= sum(m)
print(len(m) + math.floor(w/min(m)))
Problem p02969 (python)

Fixed submission:
n = int(input())

print(3 * (n ** 2))

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

a = []
maximum = 0
second_maximum = 0
for i in range(n):
    input_num = int(input())
    a.append(input_num)
    if input_num > maximum:
        second_maximum = maximum
        maximum = input_num
    elif input_num > second_maximum:
        second_maximum = input_num
        
for a_num in a:
    if a_num == maximum:
        print(second_maximum)
    else:
        print(maximum)
Problem p02958 (python)

Fixed submission:
N = int(input())
X = list(map(int,input().split()))
ctr = 0
         
for i in range(1,N):
  if X[i-1] != i:
    ctr += 1
 
if ctr > 2:
  print("NO")
else:
  print("YES")

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int,input().split())
ctr = 0
         
for i in range(1,N):
  if X[i] != i:
    ctr += 1

if ctr > 2:
  print("NO")
else:
  print("YES")
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3*r**2)

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

input_list = []
tmplist = []

for i in range(N):
  input_list.append(int(input()))

for i in input_list:
  tmplist = input_list[:]
  tmplist.remove(i)
  print(max(tmplist))
Problem p02995 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd (a, b)

A, B, C, D = map(int, input().split())

b_num = B//C + B//D - B//lcm(C, D)
a_num = (A-1)//C + (A-1)//D - (A-1)//lcm(C, D)

print((B-A+1) -(b_num - a_num))

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
 
def gcd( x, y ):
    while y != 0:
        x, y = y, x%y

ctr = 0

tmp1 = A // C
tmp2 = A // D
tmp3 = B // (C * D / gcd(C,D))
tmp4 = B // C
tmp5 = B // D

print(tmp4 + tmp5 - tmp3 - tmp1 -tmp2)