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

Fixed submission:
# D - Factorization

N, M = map(int, input().split())
MOD = 10**9 + 7

def prime_factorization(n):
    prime_factors = []
    if n < 2:
        return 0
    for i in range(2, int(pow(n, 0.5)+1)):
        if n%i==0:
            ex = 0
            while n%i==0:
                ex += 1
                n //= i
            prime_factors.append((i, ex))
    if n!=1:
        prime_factors.append((n,1))
    return prime_factors

fac = [1, 1]
inv = [0, 1]
finv = [1, 1]

for i in range(2, N+36):
    fac.append(fac[-1] * i % MOD)
    inv.append(MOD - inv[MOD%i] * (MOD//i) % MOD)
    finv.append(finv[-1] * inv[-1] % MOD)

def comb_mod(n, r, m):
    if (n<0 or r<0 or n<r): return 0
    r = min(r, n-r)
    return fac[n] * finv[n-r] * finv[r] % m

primes = prime_factorization(M)
ans = 1
if primes != 0:
    for (p, ex) in primes:
        ans = (ans * comb_mod(ex+N-1, N-1, MOD)) % MOD

print(ans)

Buggy submission (verdict: Runtime Error):
# D - Factorization

N, M = map(int, input().split())
MOD = 10**9 + 7

def prime_factorization(n):
    prime_factors = []
    if n < 2:
        return 0
    for i in range(2, int(pow(n, 0.5)+1)):
        if n%i==0:
            ex = 0
            while n%i==0:
                ex += 1
                n //= i
            prime_factors.append((i, ex))
    if n!=1:
        prime_factors.append((n,1))
    return prime_factors

fac = [1, 1]
inv = [0, 1]
finv = [1, 1]

for i in range(2, N+36):
    fac.append(fac[-1] * i % MOD)
    inv.append(MOD - inv[MOD%i] * (MOD//i) % MOD)
    finv.append(finv[-1] * inv[-1] % MOD)

def comb_mod(n, r, m):
    if (n<0 or r<0 or n<r): return 0
    r = min(r, n-r)
    return fac[n] * finv[n-r] * finv[r] % m

primes = prime_factorization(M)
ans = 1
for p, ex in primes:
    ans = (ans * comb_mod(ex+N-1, N-1, MOD)) % MOD

print(ans)

Buggy submission (verdict: Runtime Error):
# D - Factorization

N, M = map(int, input().split())
MOD = 10**9 + 7

# M を素因数分解する 12 -> 2^2 * 3^1
# 2^2 と 3^1 の組み合わせをそれぞれ計算する。
# 2^2 は べき数を配分する組み合わせ。
# N=3の時、
# 2^2, 2^0, 2^0 -> 4, 1, 1
# 2^1, 2^1, 2^0 -> 2, 2, 1
# この組み合わせは べき数をxとした時、
# N-1個の区切り場所を追加したと仮定して、
# (x+N-1)C(N-1) 

def prime_factorization(n):
    prime_factors = []
    if n < 2:
        return 0
    for i in range(2, int(pow(n, 0.5)+1)):
        if n%i==0:
            ex = 0
            while n%i==0:
                ex += 1
                n //= i
            prime_factors.append((i, ex))
    # 割り切れなかった残りのnが1でない(素数)場合、リストに加える
    if n!=1:
        prime_factors.append((n,1))
    return prime_factors

fac = [1, 1]
inv = [0, 1]
finv = [1, 1]

for i in range(2, N+30):
    fac.append(fac[-1] * i % MOD)
    inv.append(MOD - inv[MOD%i] * (MOD//i) % MOD)
    finv.append(finv[-1] * inv[-1] % MOD)

def comb_mod(n, r, m):
    if (n<0 or r<0 or n<r): return 0
    r = min(r, n-r)
    return fac[n] * finv[n-r] * finv[r] % m

primes = prime_factorization(M)
ans = 1
for p, ex in primes:
    ans = (ans * comb_mod(ex+N-1, N-1, MOD)) % MOD

print(ans)
Problem p02571 (python)

Fixed submission:
S = input()
T = input()

ans = len(T)

for i in range(len(S) - len(T) + 1):
    diff = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            diff += 1
    ans = min(ans, diff)
    
print(ans)

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

ans = len(T)

for i in range(len(S) - len(T) + 1):
    diff = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            diff += 1
        l_diff.append(diff)
    ans = min(ans, diff)
    
print(ans)

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

ans = len(T)

for i in range(len(S) - len(T)):
    diff = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            diff += 1
print(min(ans, diff))

Buggy submission (verdict: Runtime Error):
import re

S = input()
T = input()

start = time.time()

ans_list = []

a = '.'*len(T)

for i in range(len(T)):
    if i == 0:
        b = T[i] + a[i+1:]
    elif i == len(T)-1:
        b = a[:i] + T[i]
    else:
        b = a[:i] + T[i] + a[i+1:]
    s = re.findall(b, S)
    
    if len(s) >= 1:
        for j in range(len(s)):
            c = list(s[j])
            d = list(T)
            ans = 0
            for k in range(len(c)):
                if c[k] == d[k]:
                    ans += 1
            ans_list.append(ans)
    else:
        pass

print(len(T) - max(ans_list))
Problem p02572 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
S = []
e = 0
for i in A:
    e += i
    S.append(e)
    
ans = 0
for i in range(N-1):
    ans += A[i]%(10**9+7)*((S[N-1] - S[i])%(10**9+7))
    
print(ans%(10**9+7))

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

for i in range(N-1):
    for j in range(i+1, N):
        print(i, j)
        ans += ((A[i]% (10**9 + 7))*(A[j]% (10**9 + 7))) % (10**9 + 7)
        
print(ans % (10**9 + 7))
Problem p02577 (python)

Fixed submission:
N = input()

if int(N) < 10:
    if int(N) == 9:
        print('Yes')
    elif int(N) == 0:
        print('Yes')
    else:
        print('No')
elif int(N) >= 10:
    l = [int(n) for n in list(N)]
    a = sum(l)
    if a % 9 == 0:
        print('Yes')
    else:
        print('No')

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

if len(N) < 2:
    if int(N) == 9:
        print('Yes')
    else:
        print('No')
elif len(N) >= 2:
    l = [int(n) for n in N]
    a = sum(l)
    if a % 9 == 0:
        print('Yes')
    else:
        print('No')
Problem p02578 (python)

Fixed submission:
N = int(input())
As = [int(n) for n in input().split()]

ans = 0

for i in range(N - 1):
    if As[i] >As[i+1]:
        diff = As[i] - As[i+1]
        As[i +1] = As[i]
        ans += diff
    else:
        pass
    
print(ans)

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

for i in range(N - 1):
    if As[i] >As[i+1]:
        diff = As[i] - As[i+1]
        As[i +1] = As[i]
        ans += diff
    else:
        pass
    
print(ans)
Problem p02629 (python)

Fixed submission:
x = int(input())

def converter(x):
    if x <= 26:
        y = chr(x + 96)
    elif x % 26 == 0:
        y = converter(x // 26 - 1) + chr(122)
    else:
        y = converter(x // 26) + chr(x % 26 + 96)
    return y

name = converter(x)

print(name)

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

def converter(x):
    if x <= 26:
        y = chr(x + 96)
    elif x % 26 == 0:
        y = converter(x // 26) + converter(26)
    else:
        y = converter(x // 26) + converter(x % 26)
    return y

name = converter(x)

print(name)
Problem p02682 (python)

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

result = 0
t = min(a, k)
result += t
k -= t
t = min(b, k)
k -= t
t = min(c, k)
result -= t
print(result)

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

if a.isdigit()==True and b.isdigit()==True and c.isdigit()==True and k.isdigit()==True:
    a = int(a)
    b = int(b)
    c = int(c)
    k = int(k)
    if k>=1 and k<=(a+b+c) and (a+b+c)<=2*(10**9):
        if k <= a:
            print(k)
        elif k > a and k <= (a+b):
            print(a)
        else:
            print(a - (k - b - a))

Buggy submission (verdict: Runtime Error):
if a.isdigit()==True and b.isdigit()==True and c.isdigit()==True and k.isdigit()==True:
    a = int(a)
    b = int(b)
    c = int(c)
    k = int(k)
    if a>=0 and b>=0 and c>=0:
        if k>=1 and k<=(a+b+c) and (a+b+c)<=2*(10**9):
            if k < a:
                print(k)
            elif k >= a and k <= (a+b):
                print(a)
            else:
                print(a - (k - b - a))

Buggy submission (verdict: Runtime Error):
if a.isdigit()==True and b.isdigit()==True and c.isdigit()==True and k.isdigit()==True:
    a = int(a)
    b = int(b)
    c = int(c)
    k = int(k)
    if a>=0 and b>=0 and c>=0 and k>=1 and k<=(a+b+c) and (a+b+c)<=2*(10**9):
        if k < a:
            print(k)
        elif k >= a and k <= (a+b):
            print(a)
        else:
            print(a - (k - b - a))

Buggy submission (verdict: Runtime Error):
if a.isdigit()==True and b.isdigit()==True and c.isdigit()==True and k.isdigit()==True:
    a = int(a)
    b = int(b)
    c = int(c)
    k = int(k)
    if a>=0 and b>=0 and c>=0 and k>=1 and k<=(a+b+c) and (a+b+c)<=2*(10**9):
        if k < a:
            print(k)
        elif k >= a and k <= (a+b):
            print(a)
        else:
            print(a - (k - b - a))
Problem p02570 (python)

Fixed submission:
D,T,S = input().split()
if int(D)/int(S) > int(T):
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
match=0
for i in range(len(S)-len(T)):
    count=0
    for j in range(len(T)):
        if S[i+j]==T[j]:
            count=count+1
    if match<count:
        match=count
print(len(T)-match)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
i=0
j=0
match = 0
for i in Range(len(S)-len(T)):
  count = 0
  for j in Range(Len(T)):
    if S[i+j]==T[j]:
      count=count+1
  
  if match<count:
    match=count

print(Len(T)-match)

Buggy submission (verdict: Runtime Error):
D,T,S = input().split(' ')
if D/S>T:
  print('No')
else
  print('Yes')
Problem p02571 (python)

Fixed submission:
S=input()
T=input()
match=0
for i in range(len(S)-len(T)+1):
    count=0
    for j in range(len(T)):
        if S[i+j]==T[j]:
            count=count+1
    if match<count:
        match=count
print(len(T)-match)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
i=0
j=0
match = 0
for i in range(Len(S)-Len(T)):
  count = 0
  for j in range(Len(T)):
    if S[i+j]==T[j]:
      count=count+1
  
  if match<count:
    match=count

print(Len(T)-match)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
i=0
j=0
match = 0
for i in Range(Len(S)-Len(T)):
  count = 0
  for j in Range(Len(T)):
    if S[i+j]==T[j]:
      count=count+1
  
  if match<count:
    match=count

print(Len(T)-match)
Problem p02571 (python)

Fixed submission:

S=input()
T=input()
check=[]
for i in range(len(S)-len(T)+1):
    check.append(0)
    for j,tt in enumerate(T):
        if tt==S[i+j]:
            check[i]+=1
# print(check)
check.append(0)
# print(check)
print(len(T)-max(check))

Buggy submission (verdict: Runtime Error):

S=input()
T=input()
check=[]
for i,ss in enumerate(S[:-len(T)]):
    check.append(0)
    for j,tt in enumerate(T):
        if tt==S[i+j]:
            check[i]+=1
# print(check)
print(len(T)-max(check))
Problem p02570 (python)

Fixed submission:
d,t,s = map(int,input().split())
if d/s <= t:
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
sum = 0
ans = 0
# for i in range(n):
#     a[i] = a[i] % (10**9 +7)
#
# s = 0

for i in range(n):
    sum += a[i]

for i in range(n-1):
    sum -= a[i]
    ans += a[i] * sum

print(ans % (10**9 + 7))
Problem p02571 (python)

Fixed submission:
S = list(input())
T = list(input())

i = 0
ans =[]

while i + len(T) <= len(S):
    n = 0
    for s, t in zip(S[i:i+len(T)], T):
        if s != t:
            n += 1
    ans.append(n)
    i += 1

print(min(ans))

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

i = 0
ans =[]

while i + len(T) < len(S):
    n = 0
    for s, t in zip(S[i:i+len(T)], T):
        if s != t:
            n += 1
    ans.append(n)
    i += 1

print(min(ans))
Problem p02594 (python)

Fixed submission:
x = input()

if int(x) >= 30:
    print("Yes")
else:
    print("No")

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

if x >= 30:
    print("Yes")
else:
    print("No")
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
a,b = input().split()
a = Decimal(a)
b = Decimal(b)
print(int(a*b))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
c,c = b.split(".")
print(int(a)*int(b)+int(a)*int(c)//100)
Problem p02819 (python)

Fixed submission:
def check(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
                break
        else:
            return True
    else:
        return False


a = int(input())

for i in range(a, 100500):
    if check(i):
        print(i)
        break

Buggy submission (verdict: Runtime Error):
X = int(input())
t = X//2 + X
a=set(range(2,t))
l=map(lambda c:range(2*c,t,c),a)
result=a.difference(*l)
result=list(sorted(result))
matchingVals = filter(lambda x : x>X, result)
res = list(matchingVals)
print(res[0])
Problem p02835 (python)

Fixed submission:
a = input()
a = a.split()
result = map(lambda x: int(x), a)
res = 0
for num in result:
    res = res + num
if res>=22 :
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(a+b+c)
print(d)
if d>=22 :
    print("bust")
else:
    print("win")
Problem p02897 (python)

Fixed submission:
n = int(input())
if n%2==0:
    print(str((n/2)/n))
else:
    print(str(((n+1)/2)/n))

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

Buggy submission (verdict: Runtime Error):
n = int(input())
	if n%2 == 0;
  		y = n/2
	if round(n/2)<(n/2):
    	y=round((n+1)/2)
	print(str(y/n))

Buggy submission (verdict: Runtime Error):
x= int(input())
y = round(x/2)
return y/x

Buggy submission (verdict: Runtime Error):
x = round(n /2)
return x
Problem p02594 (python)

Fixed submission:
if int(input()) >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if input() > 30:
  print("Yes")
else:
  print("No")
Problem p02627 (python)

Fixed submission:
c = input()
if c>='A' and c<='Z':
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
c = input()
if c>=A and c<=Z:
    print('A')
else:
    print('a')
Problem p02570 (python)

Fixed submission:
D,T,S = map(int, input().split())
if D/S <= T:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
D,T,S = map(int,input.split())
if D/S <= T:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
D,T,S = map(int,input(),slpit())
if D/S <= T:
  print("Yes")
else:
  print("No")

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

D = int(D)
T = int(T)
S = int(S)

if D/S <= T:
  print(Yes)
else:
  print(No)
Problem p02571 (python)

Fixed submission:
s=input()
t=input()

count_min = 1000

for i in range(len(s)-len(t)+1):
  count = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      count+=1 
  if count < count_min:
    count_min = count

print(count_min)

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

count_min = 1000

for i in range(len(s)-len(t)+1):
  count = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      count++
  if count < count_min:
    count_min = count

print(count_min)
Problem p02577 (python)

Fixed submission:
N = input()
len_N = len(N)
count = 0

for i in range(len_N):
  count += int(N[i])
if count%9 == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = input()
len_N = len(N)
N = int(N)
count = 0

for i in range(len_N):
  count += N[i]
if count%9 == 0:
  print("Yes")
else:
  print("No")
Problem p02578 (python)

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

count = 0
temp = a[0]

for i in range(n):
  if a[i] >= temp:
    temp = a[i]
  else:
    count += temp - a[i]
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
count = 0
for i in n-1:
  if a[i+1] < a[i]:
    count += a[i] - a[i+1]
print(count)
Problem p02570 (python)

Fixed submission:
d,t,s=map(int,input().split())
if(s>=(d/t)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
d,t,s=input().split()
if(s>=(d/t)):
    print("Yes")
else:
    print("No")
Problem p02571 (python)

Fixed submission:
a = input()
b = input()

T=1000

for i in range(len(a)-len(b)+1):
  ans = 0
  for j in range(len(b)):
    if a[i+j]!=b[j]:
      ans +=1
  T = min(T, ans)
print(T)

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

T=1000
ans = 0
for i in range(len(a)-len(b)+1):
  for j in range(len(b)):
    if a[i+j]=!b[j]:
      ans +=1
      ans = min(T, ans)
print(ans)
Problem p02701 (python)

Fixed submission:
n = int(input())
a=[input() for i in range(n)]
print(len(set(a)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a=[input() for i in range(n)]
print(len(set(a))
Problem p02951 (python)

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

print(c-a+b if c > a-b else 0)

Buggy submission (verdict: Runtime Error):
if C >= A -B:
  print(C - A + B)
else:
  Print(0)
Problem p03041 (python)

Fixed submission:
N,K = map(int,input().split())
s = list(input())
s[K-1] = s[K-1].lower()
     
print("".join(s))

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

print(s.replace('s[k-1]', ''s[k-1]'.lower()')
Problem p03250 (python)

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

print(a + b + 10*c)

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

s = sorted.[a, b, c]

print(s)
Problem p03631 (python)

Fixed submission:
a,b,c = input()
  
print('Yes' if a==c else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c = input()
  
print('Yes' if a==c else ;'No')
Problem p03803 (python)

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

if a == 1:
    a = 14
if b == 1:
    b = 14


print('Draw' if a==b else 'Alice' if a>b else 'Bob')

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

if a == 1:
    a = 14
if b == 1:
    b = 14

print('Draw' if a=b elif 'Alice' a>b else 'Bob')
Problem p02623 (python)

Fixed submission:
N,M,K=map(int,input().split())
costA=list(map(int,input().split()))
costB=list(map(int,input().split()))
costA=[0]+costA
costB=[0]+costB

for i in range(N):
    costA[i+1]+=costA[i]
    
for i in range(M):
    costB[i+1]+=costB[i]

"""print(costA)
print(costB)"""

""

def upper_bound(list1,K):
    low=0
    high=len(list1) #index
    while high-low!=1:
        mid=(high+low)//2
        if list1[mid]>K:
            high=mid
        else:
            low=mid
    return low  #条件を満たす左側の要素数

number=[]
#print(costA)
#print(costB)
for i in range(N+1): #A側の机の本を固定 残りの時間でBを二分探索
    time=K-costA[i]
    if time<0:
        break
    #print(i,upper_bound(costB,time))
    number.append(i+upper_bound(costB,time))

"""print(i)
    print(upper_bound(costB,time))
    print(number)"""
    
print(max(number))



"""
print(cumcost)
#以下二分探索 必要なのはソート済みリストと検索したい値
#upper bound 基準値よりも大きい最初の値を返す
#lower bound 基準値以上の最初の値を返す
#欲しい値はl基準値以下の最大値=upper bound値−１の位置の値
    #冊数は+1なので、求める値はupper_bound
# 検索したい値＝K分を超えない最大の値
low=0
high=len(cumcost)-1
while high-low!=1: #差が１になったら終了
    print(high)
    print(low)
    mid=(high+low)//2 #pythonの//は切り捨て徐算
    if cumcost[mid]>K:  #推測した値が大きすぎた ### 値のダブり注意
        high=mid
    else: # 推測した値小さすぎた#cumcost<=K
        low=mid 
#条件を満たす値の個数 (upper_bound)
    #条件を満たすのが左・・・high
    #条件を満たすのが右・・・len(cumcost)--1-low
upper_bound=high #最終的な値はupper_bound
print(upper_bound)
"""
"""境界線が端っこにあると上手に探索できない
→例外処理で乗り切るか　探索のやり方自体を変更するか　どちらが良いか？"""

Buggy submission (verdict: Runtime Error):
N,M,K=map(int,input("入力してください").split())
costA=list(map(int,input().split()))
costB=list(map(int,input().split()))
costA=[0]+costA
costB=[0]+costB

for i in range(N):
    costA[i+1]+=costA[i]
    
for i in range(M):
    costB[i+1]+=costB[i]

print(costA)
print(costB)

costB.append(float("inf"))

def upper_bound(list1,K):
    low=0
    high=len(list1)-1 #index
    while high-low!=1:
        mid=(high+low)//2
        if list1[mid]>K:
            high=mid
        else:
            low=mid
    return high  #条件を満たす左側の要素数

number=[]
for i in range(N+1): #A側の机の本を固定 残りの時間でBを二分探索
    time=K-costA[i]
    if upper_bound(costB,time)!=1:
        number.append(i+upper_bound(costB,time)-1)
    else:
        number.append(0)
    print(i)
    print(upper_bound(costB,time))
    print(number)
    
print(max(number))

Buggy submission (verdict: Runtime Error):
N,M,K=map(int,input("入力してください").split())
costA=list(map(int,input().split()))
costB=list(map(int,input().split()))
costA=[0]+costA
costB=[0]+costB

for i in range(N):
    costA[i+1]+=costA[i]
    
for i in range(M):
    costB[i+1]+=costB[i]

print(costA)
print(costB)

costB.append(float("inf"))

def upper_bound(list1,K):
    low=0
    high=len(list1)-1 #index
    while high-low!=1:
        mid=(high+low)//2
        if list1[mid]>K:
            high=mid
        else:
            low=mid
    return high  #条件を満たす左側の要素数

number=[]
for i in range(N+1): #A側の机の本を固定 残りの時間でBを二分探索
    time=K-costA[i]
    number.append(i+upper_bound(costB,time)-1)
    print(i)
    print(upper_bound(costB,time))
    print(number)
    
print(max(number))
Problem p02693 (python)

Fixed submission:
K=int(input())
A,B=map(int,input().split())
ans="NG"
for i in range(A,B+1):
    if  i%K==0:
        ans="OK"
print(ans)

Buggy submission (verdict: Runtime Error):
K=int(input())
A,B=int(input().split())
check=False
for i in range(0,B-A):
  if (B-A-i)%K==0:
    check=True
if check==True:
  print("OK")
else:
  print("NG")
Problem p02759 (python)

Fixed submission:
N=int(input())
print(N//2+N%2)

Buggy submission (verdict: Runtime Error):
N=input()
print(N//2+N%2)
Problem p02771 (python)

Fixed submission:
A,B,C=input().split()
if A==B and B==C:
  print("No")
elif A==B or B==C or C==A:
    print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C=input().split()
if A==B and B==C:
  print("No")
elif:A==B or B==C or C==A:
    print("Yes")
else:
  print("No")
Problem p02777 (python)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
  print(str(A-1)+" "+str(B))
else:
  print(str(A)+" "+str(B-1))

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
  print(A-1 B)
else:
  print(A B-1)
Problem p02831 (python)

Fixed submission:
import sys
import fractions as fr
a,b=map(int, sys.stdin.readline().split())
ans = (a*b)//fr.gcd(a,b)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import math
a,b=map(int, sys.stdin.readline().split())
print((a*b)//math.gcd(a,b))
Problem p02633 (python)

Fixed submission:
def do():
    x=int(input())
    k=360%x
    j=360//x
    v=k
    if k==0:
        return j
    while 360%k!=0:
        k=360%k
        v+=k
    v1=360//v
    return j*v1
print(do())

Buggy submission (verdict: Runtime Error):
x=int(input())
k=360%x
j=360//x
v=k
while 360%k!=0:
    k=360%k
    v+=k
v1=360//v
print(j*v1)

Buggy submission (verdict: Runtime Error):
x=int(input())
k=360%x
j=360//x
v=k
while 360%k!=0:
    k=360%k
    v+=k
print(j*(360//v))
Problem p02688 (python)

Fixed submission:
def do():
    n,m=map(int,input().split())
    num=[]
    k=0
    for i in range(m):
        d=int(input())
        l=list(map(int,input().split()))
        num.extend(l)
    for i in range(1,n+1):
        if i not in num:
            k+=1
    return k


print(do())

Buggy submission (verdict: Runtime Error):
def do():
    n,m=map(int,input().split())
    d=int(input())
    l=[]
    for i in range(n):
        a=list(map(int,input().split()))
        l.extend(a)
    for j in range(1,n+1):
        if j not in l:
            return j
print(do())
Problem p02707 (python)

Fixed submission:
from collections import Counter
a=int(input())
l=list(map(int,input().split()))
d=Counter(l)
# print(d)
for i in range(1,a+1):
    if i in d:
        print(d[i])
    else:
        print("0")

Buggy submission (verdict: Runtime Error):
a=int(input())
l=list(map(int,input().split()))
l1=[0]
l1.extend(l)
l2=[]
l1=sorted(l1)
for i in range(a-1):
    if l1[i]<l1[i+1]:
        print(l.count(l[i+1]))
    else:
        print("0")
Problem p02729 (python)

Fixed submission:
a=input().split()
(n,m)=map(int,a)
d=0
d1=0
for i in range(n):
    n-=1
    d=d+n
for j in range(m):
    m-=1
    d1=d1+m
print(d1+d)

Buggy submission (verdict: Runtime Error):
l = int(input())
print((l / 3) ** 3)
Problem p02754 (python)

Fixed submission:
a = input().split()
a = list(map(int,a))
(n,m,k)=a
answer = n // (m + k) * m + min(n % (m + k), m)
print(answer)

Buggy submission (verdict: Runtime Error):
    n,a,b=map(int,input().split())
    answer=n//(a+b)*a+min(n%(a+b),a)
    print(answer)