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

Fixed submission:
import math
x=int(input())

serach_number = 100004

def sieve_of_eratosthenes(target, x):
    dest = int(math.sqrt(target))
    target_list = list(range(2, target + 1))
    prime_list = []

    while True:
        num_min = min(target_list)
        if num_min >= dest:
            prime_list.extend(target_list)
            break
        prime_list.append(num_min)


        i = 0

        while True:
            if i >= len(target_list):
                break
            elif target_list[i] % num_min == 0:
                target_list.pop(i)
            i += 1
    while True:
        if (x in prime_list) == True:
            print(x)
            break
        else:
            x +=1


sieve_of_eratosthenes(serach_number, x)

Buggy submission (verdict: Runtime Error):

import math
x=int(input())
serach_number = 100000


def sieve_of_eratosthenes(target, c):
    k=0
    dest = int(math.sqrt(target))
    target_list = list(range(2, target + 1))
    prime_list = []

    while True:
        num_min = min(target_list)
        if num_min >= dest:
            prime_list.extend(target_list)
            break
        prime_list.append(num_min)
        if num_min>=x:
            k=1
        if k==1:
            print(num_min)
            return
        i = 0

        while True:
            if i >= len(target_list):
                break
            elif target_list[i] % num_min == 0:
                target_list.pop(i)
            i += 1




sieve_of_eratosthenes(serach_number, c)

Buggy submission (verdict: Runtime Error):
x=int(input())
import math

serach_number = 100000


def sieve_of_eratosthenes(target):
    dest = int(math.sqrt(target))
    target_list = list(range(2, target + 1))
    prime_list = []

    while True:
        num_min = min(target_list)
        if num_min >= dest:
            prime_list.extend(target_list)
            break
        prime_list.append(num_min)
        if num_min<x:
            b=num_min

        i = 0

        while True:
            if i >= len(target_list):
                break
            elif target_list[i] % num_min == 0:
                target_list.pop(i)
            i += 1

    a=prime_list.index(b)
    print(prime_list[a+1])


sieve_of_eratosthenes(serach_number)
Problem p02831 (python)

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


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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math
a, b=map(int, input().split())


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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
a, b=map(int, input().split())
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)




print(lcm(a, b))
Problem p02862 (python)

Fixed submission:

a, b = map(int, input().split())

aa=int(0)
x=max([a, b])
y=min([a, b])

if (x+y)%3 ==0 and x <= y*2:
    aa=int(1)

n=int((x+y)/3)
k=int((n-(x-y))/2)


def comb(n, k, mod=10**9+7):
    numer = denom = 1
    for i in range(k):
        numer = (numer * (n-i)) % mod
        denom = (denom * (i+1)) % mod
    return (numer * pow(denom, mod-2, mod)) % mod

if aa==1:
    print(comb(n,k))
else:
    print(aa)

Buggy submission (verdict: Runtime Error):

a, b = map(int, input().split())

a=int(0)
x=max([a, b])
y=min([a, b])

if x+y % 3 ==0 and x < y*2:
    a=int(1)

n=(x+y)/3
r=(x-y)/2
n2=int(1)
r2=int(1)
r3=int(1)
for i in range(n):
    n2=n2*(i+1)
for i in range(r):
    r2=r2*(i+1)
for i in range(n-r):
    r3=r3*(i+1)
ans=(n2/r2/r3)//(10**9+7)

if a==1:
    print(ans)
else:
    print(a)
Problem p02897 (python)

Fixed submission:
n=float(input())
ans=float(0)
if n%2==0:
    ans=1/2
else:
    ans=((n//2)+1)/n

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=float(0)
if n%2=0:
    ans=1/2
else:
    ans=(n//2)+1

print(ans)
Problem p03221 (python)

Fixed submission:
n,m = map( int, input().split())
  
result= {}
input_list = [[] for i in range(n)]


for i in range(m):
  p,y = map(int, input().split())
  input_list[p-1].append((y,i))
  
for i in input_list :
  i.sort()

result = [None]*m

for p,i in enumerate(input_list) :
  for n, (a,b) in enumerate(i):
    result[b] = str(p+1).zfill(6)+str(n+1).zfill(6)
    
print(*result, sep = '\n')

Buggy submission (verdict: Runtime Error):
n,m = map( int, input().split())
  input_list = [[] for i in range(n)]

for i in range(m):
  p,y = map(int, input().split())
  input_list[p-1].append((y,i))
  
for i in input_list :
  i.sort()

result = [None]*m

for p,i in enumerate(input_list) :
  for n, (a,b) in enumerate(i):
    result[b] = str(p+1).zfill(6)+str(n+1).zfill(6)
    
print(*result, sep = '\n')
Problem p02623 (python)

Fixed submission:
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  if A[n] > K:
    break
  while B[j] > K - A[n]:
      j -= 1
  ans = max(ans, n + j)
print(ans)

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

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  while B[j] > K - A[n]:
      j -= 1
  ans = max(ans, n + j)
print(ans)

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

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  while True:
    time = A[n] + B[j]
    if time > K:
      j -= 1
    else:
      ans = max(ans, n + j)
      break
print(ans)

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

A = [0]
B = [0]
if N > 0:
  for i in range(N):
    A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  while True:
    time = A[n] + B[j]
    if time <= K:
      ans = max(ans, n + j)
      break
    else:
      j -= 1
      if j < 0:
        break
print(ans)

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

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
if M > 0:
  for i in range(M):
    B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  while True:
    time = A[n] + B[j]
    if time <= K:
      ans = max(ans, n + j)
      break
    else:
      j -= 1
      if j < 0:
        break
print(ans)

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

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
j = M
for n in range(N + 1):
  while True:
    time = A[n] + B[j]
    if time <= K:
      ans = max(ans, n + j)
      break
    else:
      j -= 1
      if j < 0:
        break
print(ans)

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

A = [0]
B = [0]
for i in range(N):
  A.append(A[i] + a[i])
for i in range(M):
  B.append(B[i] + b[i])
  
ans = 0
m = M
for n in range(N + 1):
  while True:
    time = A[n] + B[m]
    if time <= K:
      ans = max(ans, n + m)
      break
    else:
      j -= 1
print(ans)
Problem p02693 (python)

Fixed submission:
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%k==0:
    print("OK")
    break
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%k==0:
    print("OK")
   	break
else:
  print("NG")
Problem p02707 (python)

Fixed submission:
n=int(input())

f=[0 for i in range(n)]
for i in input().split():
  f[int(i)-1]+=1
print(*f)

Buggy submission (verdict: Runtime Error):
n=int(inptu())
l=[int(i) for i in input().split()]
f=[0 for i in range(n)]
s=set(l)
for i in s:
  f[i-1]=l.count(i)
print(*f)
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
print(int(input()+1)//2)
Problem p02777 (python)

Fixed submission:
a,b=input().split()
d={}
d[a]=0
d[b]=0
d[a],d[b]=map(int,input().split())
x=input()
d[x]-=1
print(d[a],d[b])

Buggy submission (verdict: Runtime Error):
a,b=input().spit()
d={}
d[a]=0
d[b]=0
d[a],d[b]=map(int,input().split())
x=input()
d[x]-=1
print(d[a],d[b])
Problem p02831 (python)

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

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


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

print(lcm(a,b))

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

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


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

print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
def lcm(x, y):
    if x > y:
      greater = x
    else:
      greater = y
    while(True):
      if((greater % x == 0) and (greater % y == 0)):
        lcm = greater
        break
      greater += 1
    return lcm
n,m=mpa(int,input().split())
print(lcm(n,m))
Problem p02935 (python)

Fixed submission:
t=int(input())
l=sorted(map(int, input().split()))
s=l[0]
for i in range(1,t):
  
  s+=l[i]
  s/=2
print(s)

Buggy submission (verdict: Runtime Error):
t=int(input())
l=sorted(map(int, input().split()))
s=l[0]
for i in rnage(1,t):
  s+=l[i]
  s/=2
print(s)

Buggy submission (verdict: Runtime Error):
t=int(input())
l=sorted(map(int, input().split()))
s=l[0]
for i in rnage(1,t):
	s+=l[i]
    s/=2
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(i) for i in input().split()]
s=0
for i in range(n-1):
	f=l[i]
    for j in range(n):
      if i!=j:
        f+=l[j]
        f=f/2
    if s<f:
      s=f
      
      

print(s)

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

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

Fixed submission:
s = list(input())

s.sort()
if s[0]==s[1] and s[2]==s[3] and s[0]!=s[3]:
  print("Yes")
else:
  print("No")

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

s.sort()
if s[0]==s[1] and s[2]==s[4]:
  print("Yes")
else:
  print("No")
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
l = [1]*(n+1)
#kubaru_dp = [1]*n

for i in range(m):
    a = int(input())
    l[a] = 0

# l = [1,1,1,0,1,1,1]
for i in range(2,n+1):
    if l[i]==0:
        continue
    l[i] = l[i-1]+l[i-2]
else:
    print(l[-1]%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [1]*n
#kubaru_dp = [1]*n

for i in range(m):
    a = int(input())
    l[a] = 0

# l = [1,1,1,0,1,1,1]
for i in range(2,n+1):
    if l[i]==0:
        continue
    l[i] = l[i-1]+l[i-2]
else:
    print(l[-1]%(10**9+7))
Problem p03137 (python)

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

d = []

X.sort()
for i in range(M-1):
    d.append(X[i+1]-X[i])
else:
    d.sort()
    d = d[::-1]

res = sum(d) - sum(d[0:N-1])

print(res)

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

d = []

X.sort()
for i in range(M-1):
    d.append((X[i+1]-X[i]))
else:
    d.sort()
    d = d[::-1]

res = sum(d)
for i in range(N-1):
    res -= d[i]
else:
    print(res)
Problem p03207 (python)

Fixed submission:
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
else:
    print(sum(l)-max(l)//2)

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

for I in range(n):
    l.append(int(input())
else:
    print(int(sum(l)-max(l)/2))
Problem p03307 (python)

Fixed submission:
a = int(input())

if a % 2 ==0:
    print(a)
else:
    print(a*2)

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

if a % 2 ==0:
  print(n)
else:
  print(n*2)
Problem p02689 (python)

Fixed submission:
ri = lambda: map(int, input().split())

N, M = ri()
H = list(ri())
T = [0]*N
for _ in range(M):
    a, b = ri()
    T[a-1] = max(T[a-1], H[b-1])
    T[b-1] = max(T[b-1], H[a-1])

print(sum(1 for i, h in enumerate(T) if h == 0 or h < H[i]))

Buggy submission (verdict: Runtime Error):
ri = lambda: map(int, input().split())

N, M = ri()
H = list(ri())
G = [[0]*N for _ in range(N)]
for _ in range(M):
    a, b = ri()
    G[a-1][b-1] = H[b-1]
    G[b-1][a-1] = H[a-1]

T = [max(r) for r in G]
print(sum(1 for i, h in enumerate(T) if h == 0 or h < H[i]))
Problem p02729 (python)

Fixed submission:
ans=0

n,m=map(int,input().split())
if n > 1:
	for i in range(1,n):
		ans += i

if m > 1:
	for i in range(1,m):
		ans += i

print(ans)

Buggy submission (verdict: Runtime Error):
ans=0

n,m=map(input().split())
if n > 1:
	for i in range(1,n):
		ans += i

if m > 1:
	for i in range(1,m):
		ans += i

print(ans)
Problem p03242 (python)

Fixed submission:
input_line = str(input())
s = []

for i in range(len(input_line)):
    if input_line[i] == '9':
        s.append('1')
    elif input_line[i] == '1':
        s.append('9')
    else:
        s.append(input_line[i])

mojiretu = ''

for x in s:
    mojiretu += x

print(int(mojiretu))

Buggy submission (verdict: Runtime Error):
input_line = str(input())
s = []

for i in range(len(input_line)):
    if input_line[i] == '9':
        s.append('1')
    elif input_line[i] == '1':
        s.append('9')
    else:
        s.append(input_line[i])

print(s)

mojiretu = ''

for x in s:
    mojiretu += x

print(int(mojiretu)

Buggy submission (verdict: Runtime Error):
input_line = str(input())
s = []

for i in range(len(input_line)):
  if input_line == '9':
    s.append('1')
  elif input_line == '1':
    s.append('9')
  else:
    s.append(input_line[i])

for x in s:
    mojiretu += x
    
print(mojiretu)
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()
if len(S)>K:
   print( S[:K] + "...")
else:
    print(S)

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(s)>K:
    s = s[:k] + "..."

print(s)
Problem p02711 (python)

Fixed submission:
N=input()
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    print("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
N=input()
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    prnt("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
if N[-1] == '7':
     print("Yes")
elif N[-2] == '7':
    prnt("Yes")
elif N[-3] == '7':
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
if N[-1] == 7:
     print("Yes")
elif N[-2] == 7:
    prnt("Yes")
elif N[-3] == 7:
    print("Yes")
else :
    print("No")
Problem p02753 (python)

Fixed submission:
s=input()
if s == "ABB" :
    print("Yes")
elif s == "AAB" :
    print("Yes")
elif s == "ABA" :
    print("Yes")
elif s == "BAA" :
    print("Yes")
elif s == "BBA" :
    print("Yes")
elif s == "BAB" :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
s=input()
if s == ABB :
    print("Yes")
elif s == AAB :
    print("Yes")
elif s == ABA :
    print("Yes")
elif s == BAA :
    print("Yes")
elif s == BBA :
    print("Yes")
elif s == BAB :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
s=input()
if s == AAA :
    print("Yes")
elif s == ABB :
    print("Yes")
elif s == AAB :
    print("Yes")
elif s == ABA :
    print("Yes")
elif s == BAA :
    print("Yes")
elif s == BBA :
    print("Yes")
elif s == BAB :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s == AAA :
    print("Yes")
elif s == ABB :
    print("Yes")
elif s == AAB :
    print("Yes")
elif s == ABA :
    print("Yes")
elif s == BAA :
    print("Yes")
elif s == BBA :
    print("Yes")
elif s == BAB :
    print("Yes")
else :
    print("No")
Problem p02771 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a == b != c :
    print("Yes")
elif b == c != a :
    print("Yes")
elif a == c != b :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a = b != c :
    print("Yes")
elif b = c != a :
    print("Yes")
elif a = c != b :
    print("Yes")
else :
    print("No")
Problem p02790 (python)

Fixed submission:
a,b = input().split()
atxt = ''.join([a for _ in range(int(b))])
btxt = ''.join([b for _ in range(int(a))])
if atxt <= btxt :
    print(atxt)
else :
    print(btxt)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a < b :
    print(aをb桁)
elif b < a :
    print(bをa桁)
else :
    print(aをb桁)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a < b :
    print(aをb桁)
elif b < a :
    print(bをa桁)
else :
    print(aをb桁)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a ==
Problem p02829 (python)

Fixed submission:
a=int(input())
b=int(input())
if a==3 and b==1 :
  print(2)
elif a==1 and b==2 :
  print(3)
elif a==2 and b==3 :
  print(1)
elif a==3 and b==2 :
  print(1)
elif a==1 and b==3 :
  print(2)
elif a==2 and b==1 :
  print(3)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==3 and b==1 :
  print(2)
elif a==1 and b==2 :
  print(3)
elif a==2 and b==3 :
  print(1)
elif a==3 and b==2 :
  print(1)
elif a==1 and b==3 :
  print(2)
elif a==2 and b==1 :
  print(3)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==3 and b==1 :
  print(2)
elif a==1 and b==2 :
  print(3)
elif a==2 and b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=int(input())
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=int,input().split()
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=map(int(input().split())
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=map(int(input().split())
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=int(input())
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a==3,b==1 :
  print(2)
elif a==1,b==2 :
  print(3)
elif a==2,b==3 :
  print(1)
Problem p02835 (python)

Fixed submission:
a1,a2,a3=map(int,input().split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')

Buggy submission (verdict: Runtime Error):
a1,a2,a3=int(input(),split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<=21 :
    print('win')

Buggy submission (verdict: Runtime Error):
a1=int(input())
a2=int(input())
a3=int(input())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<=21 :
    print('win')

Buggy submission (verdict: Runtime Error):
a1=int(input())
a2=int(input())
a3=int(input())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')

Buggy submission (verdict: Runtime Error):
a1,a2,a3=int(input(),split())
if a1+a2+a3>=22 :
    print('bust')
elif a1+a2+a3<22 :
    print('win')
Problem p02879 (python)

Fixed submission:
a,b = map(int,input().split())
if a <= 9 and b <= 9 :
    print(a*b)
else :
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b = map(int.input(),split())
if a <= 9 and b <= 9 :
    print(a*b)
else :
    print(-1)
Problem p02897 (python)

Fixed submission:
N=int(input())
if N%2==0:
    print(0.5)
if N%2==1:
    print((N+1)/(2*N))

Buggy submission (verdict: Runtime Error):
n - int(input())
if n == 1 :
    print(1/1)
elif n % 2 == 0 :
    print(1/2)
else :
    print(((n+1)/2)/n)
Problem p02689 (python)

Fixed submission:

n,m = list(map(int,input().split()))
h = list(map(int,input().split()))
d = [1] * n
for i in range(m):
  a,b = list(map(int,input().split()))
  a -= 1
  b -= 1
  if h[a] > h[b]:
    d[b] = 0
  elif h[b] > h[a]:
    d[a] = 0
  else:
    d[a] = 0
    d[b] = 0

print(sum(d))

Buggy submission (verdict: Runtime Error):
h = list(map(int,input().split()))
d = [1] * n
for i in range(m):
  a,b = list(map(int,input().split()))
  a -= 1
  b -= 1
  if h[a] > h[b]:
    d[b] = 0
  elif h[b] > h[a]:
    d[a] = 0
  else:
    d[a] = 0
    d[b] = 0

print(sum(d))
Problem p02753 (python)

Fixed submission:
s = input()

if (s == 'AAA' ) or (s == 'BBB') :
  print('No')
else:
  print('Yes')

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

if (s=='AAA') or (S=='BBB'):
  print('No')
  exit()
else:
  print('Yes')
Problem p02757 (python)

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

if p == 2 or p == 5:
  ans = 0
  for i,s in enumerate(S):
    if int(s)%p == 0:
      ans += i+1
  print(ans)
  exit()

def MS(i,s,pre):
  return (s*i +pre)%p
 
M = [0]*p
M[0] = 1
t = 1
now = 0
for i in S[::-1]:
    i = int(i)
    now += i*t
    now %= p
    M[now] += 1
    t = t*10%p

ans = sum(map(lambda m:(m*(m-1))//2, M))
print(ans)

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

if p == 2 or p == 5:
  ans = 0
  for i,s in enumerate(S):
    if int(s)%p == 0:
      ans += i+1
  print(ans)
  exit()

def MS(i,s,pre):
  return (s*i +pre)%p
 
M = [0]*p
M[0] = 1
t = 1
pre = 0
for s in S[::-1]:
  pre += (int(s)*t)%p
  M[pre] += 1
  t *= 10

ans = sum(map(lambda m:(m*(m-1))//2, M))
print(ans)

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

if p == 2 or p == 5:
  ans = 0
  for i,s in enumerate(S):
    if int(s)%p == 0:
      ans += i+1
  print(ans)
  exit()

M = [0]*p
pre = 0
ans = 0
i = 1
for s in S[::-1]:
  pre += s*i
  pre %= p
  M[pre] += 1
  i *= 10

M[0] += 1
ans = sum(map(lambda m:(m*(m-1))//2, M))
print(ans)

Buggy submission (verdict: Runtime Error):

n,p = list(map(int,input().split()))
s = input()

M = [s[-n:] for n in range(1,n+1)]
M = list(map(lambda x:int(x)%p, M))

ans = 0
U = set(M)

for u in U:
  cnt = M.count(u)
  if u == 0:
    ans += (cnt*(cnt+1))//2
  else:
    ans += (cnt*(cnt-1))/2

print(int(ans))
Problem p02790 (python)

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

ab = str(a) *b
ba = str(b) *a

print(min([ab,ba]))

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

res = [False for x in range(N)]
for i in range(1,N):
  if P[i-1] >= P[i] :
    res[i] = True

print(int(sum(res)+1))

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

res = [False for x in range(N)]
for i in range(1,N):
  if P[i-1] >= P[i] :
    res[i] = True
  
print(sum(res)+1)

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

res = [False for x in range(N)]
for i in range(1,N):
  if P[i-1] > P[i] :
    res[i] = True
  
print(sum(res)+1)