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

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    t = S()
    if N % 2 > 0:
        print('No')
        return
    if t[:N//2] == t[N//2:]:
        print('Yes')
    else:
        print('No')

main()

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
l = len(N)
if l % 2 == 1:
  ans = 0
else:
  ans = (S[:l//2] == S[l//2:])
if ans:
  print('Yes')
else:
  print('No')
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = map(int, input().split())
A = sorted(A) # ascending

B_C = []
for _ in range(M):
    b, c = map(int, input().split())
    B_C.append((b, c))
B_C = sorted(B_C, key=lambda x: x[1], reverse=True)

cur_a_ix = 0
ans = 0

for b, c in B_C:
    while b and cur_a_ix < len(A):
        if A[cur_a_ix] < c:
            ans += c
        else:
            break
        b -= 1
        cur_a_ix += 1
ans += sum(A[cur_a_ix:])
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = map(int, input().split())
A = sorted(A) # ascending

B_C = []
for _ in range(M):
    b, c = map(int, input().split())
    B_C.append((b, c))
B_C = sorted(B_C, key=lambda x: x[1], reverse=True)

cur_a_ix = 0
ans = 0

for b, c in B_C:
    while b:
        if A[cur_a_ix] < c:
            ans += c
        else:
            break
        b -= 1
        cur_a_ix += 1
ans += sum(A[cur_a_ix:])
print(ans)
Problem p03805 (python)

Fixed submission:
import pdb

N, M = map(int, input().split())
a, b = [], []
mat = [[0 for _ in range(N)] for _ in range(N)]

for _ in range(M):
    _a, _b = map(int, input().split())
    a.append(_a)
    b.append(_b)
    mat[_a-1][_b-1] = 1
    mat[_b-1][_a-1] = 1

visited = set()
ans = 0

def dfs(num):
    global ans
    #pdb.set_trace()
    visited.add(num)
    if len(visited) == N:
        ans += 1
        return 
    
    for next_num, connected in enumerate(mat[num]):
        if not connected:
            continue
        if next_num in visited:
            continue
        visited.add(next_num)
        dfs(next_num)
        visited.remove(next_num)
    return

def main():
    dfs(0)
    print(ans)

main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
   
N, M = LI()
mat = [[0] * N for _ in range(M)]
for _ in range(M):
    a, b = LI_()
    mat[a][b] = 1
    mat[b][a] = 1 
seen = [0 for _ in range(N)]
ans = 0

def dfs(i, count):
    global ans
    import pdb
    # pdb.set_trace()
    if count == N:
        return True

    for j, reachable in enumerate(mat[i]):
        if reachable and not seen[j]:
            seen[j] = 1
            if dfs(j, count + 1):
                ans += 1
            seen[j] = 0

    return False

def main():
    seen[0] = 1
    dfs(0, 1)
    print(ans)
main()
Problem p02597 (python)

Fixed submission:
def main():
    N=int(input())
    c=list(input())
    
    #x...WR
    #o...RR, RW, WW
    #Wが来たらそれ以降はW
    #R(0個以上)+W(0個以上)
    
    res=0
    cR=c.count('R')
    cW=c.count('W')
    
    l,r=0,N-1
    while l!=r:
        if c[l]=='W':
            if c[r]=='R':
                c[l],c[r]='R','W'
                res+=1
            else:
                r-=1
        else:
            l+=1
        
    print(min(cR,cW,res))
    
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N=int(input())
    c=list(input())[::-1]
    
    #x...WR
    #o...RR, RW, WW
    #Wが来たらそれ以降はW
    #R(0個以上)+W(0個以上)
    
    res=0
    cR=c.count('R')
    cW=c.count('W')
    
    l,r=0,N-1
    while True:
        if c[l]=='W':
            if c[r]=='R':
                c[l],c[r]='R','W'
                res+=1
            else:
                r-=1
        else:
            l+=1
        
    print(min(cR,cW,res))
    
 
if __name__ == '__main__':
    main()
Problem p02629 (python)

Fixed submission:
import bisect
import string
N=int(input())

s=string.ascii_lowercase

k=1
lis=[0]
for i in range(11):
    k*=26
    lis.append(k+lis[-1])
#print(lis)

keta=bisect.bisect(lis, N-1)
#print(keta,N-lis[keta-1])

ans=''
n=N-lis[keta-1]-1
for i in range(keta):
    q,m=divmod(n,26)
    #print(q,m)
    n=q
    ans+=s[m]
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
import string
n=int(input())
alp=string.ascii_lowercase
k=1
s=0
lis=[0]
ans=''

for i in range(1,12):
    k*=26
    s += k
    lis.append(s)
    if s >= n:
        break
#print(i,lis)
x=n-lis[-2]

for i in reversed(range(1,i)):
    q,m=divmod(x,26**i)
    #print(x,q,m)
    #print(alp[q])
    ans+=alp[q]
    x=m
#print(x)
#print(alp[x-1])
ans+=alp[x-1]
print(ans)
Problem p02595 (python)

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

count = 0
for i in range(n):
    x,y = list(map(int, input().split()))
    if (x**2 + y**2)**0.5 <= d:
        count += 1

print(count)

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

count = 0
for i in range(n):
    x,y = list(map(int, input.split()))
    if (x**2 + y**2)**0.5 <= d:
        count += 1

print(count)

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

count = 0
for i in range(n):
    x,y = list(map(int, input.split()))
    if (x**2 + y**2)**0.5 <=d:
        count += 1

print(count)
Problem p02659 (python)

Fixed submission:
import math
a,b = input().split()
B = int(str(b).replace(".",""))
A = int(a)
print(A*B//100)

Buggy submission (verdict: Runtime Error):
import math
a,b = list(map(float, input().split()))
B = int(str(b).replace(".",""))
A = int(A)
print(A*B//100)

Buggy submission (verdict: Runtime Error):
import math
a,b = list(map(float, input().split()))
B = int(str(b.replace(".","")))
print(int(a*B//100))

Buggy submission (verdict: Runtime Error):
a,b = list(map(int, input().split()))
print(int(a*b))
Problem p02793 (python)

Fixed submission:
from fractions import gcd

n=int(input())
a=list(map(int, input().split()))
mod=10**9+7
l=1
ans=0

for i in a:
    l=l*i//gcd(l,i)

for i in a:
    ans+=l//i

print(ans%mod)

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

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

n=int(input())
a=list(map(int, input().split()))
A=lcm(a)
ans=0

for i in a:
    ans+=A/i

print(ans%(10**9+7))

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

n=int(input())
a=list(map(int, input().split()))
mod=10**9+7
l=1
ans=0

for i in a:
    l=l*i//gcd(l,i)

for i in a:
    ans+=l/i

print(int(ans%mod))

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

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

n=int(input())
a=list(map(int, input().split()))
A=lcm(a)
ans=0

for i in a:
    ans+=A/i

print(int(ans)%(10**9+7))

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

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

n=int(input())
a=list(map(int, input().split()))
A=lcm(a)
ans=0

for i in a:
    ans+=A/i

print(int(ans)%(10**9+7))

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

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

n=int(input())
a=list(map(int, input().split()))
A=lcm(a)
ans=0

for i in a:
    ans+=A/i

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

Fixed submission:
import fractions

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

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

Buggy submission (verdict: Runtime Error):
import math

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

a,b = map(int, input().split())
print(lcm(a,b))
Problem p02833 (python)

Fixed submission:
n=int(input())
ans=0
keta=10

def count_2(num):
    return format(num, 'b')[::-1].find('1')

if n%2==1:
    print(0)
else:
    while n//keta!=0:
        ans+=n//keta
        keta*=5
    print(ans)

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

def f(n):
    if n<2:
        return 1
    else:
        return n*f(n-2)

a=f(n)
while a%10==0:
    a=a/10
    ans+=1
print(ans)
Problem p02862 (python)

Fixed submission:
# import math
# from operator import mul
# from functools import reduce
x,y = map(int, input().split())
n = (x+y)//3
r = (2*x-y)//3
mod = 10**9+7
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

if (x+y)%3!=0:
    print(0)
elif 2*x-y<0:
    print(0)
elif -x+2*y<0:
    print(0)
else:
    # print((math.factorial((x+y)//3)//(math.factorial((2*x-y)//3)*math.factorial((2*y-x)//3)))%mod)
    # print(combinations_count(n,r)%mod)
    print(cmb(n,r,mod))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(30000)
x,y = map(int, input().split())

dp = [[-1]*(x+1) for i in range(y+1)]
# dp[1][2]=1
# dp[2][1]=1
# dp[1][1]=0
# dp[1][0]=0
# dp[0][1]=0

def f(x,y):
    if (x,y)==(1,2):
        dp[y][x]=1
        return 1
    elif (x,y)==(2,1):
        dp[y][x]=1
        return 1
    elif (x,y)==(1,1):
        dp[y][x]=0
        return 0
    elif (x,y)==(0,1):
        dp[y][x]=0
        return 0
    elif (x,y)==(1,0):
        dp[y][x]=0
        return 0
    else:
        if dp[y][x]==-1:
            dp[y][x]=f(x-1,y-2)+f(x-2,y-1)
        return dp[y][x]

print(dp[y][x]%(10**9+7))

Buggy submission (verdict: Runtime Error):
# import sys
sys.setrecursionlimit(30000)
x,y = map(int, input().split())

dp = [[-1]*(x+1) for i in range(y+1)]
# dp[1][2]=1
# dp[2][1]=1
# dp[1][1]=0
# dp[1][0]=0
# dp[0][1]=0

def f(x,y):
    if (x,y)==(1,2):
        dp[y][x]=1
        return 1
    elif (x,y)==(2,1):
        dp[y][x]=1
        return 1
    elif (x,y)==(1,1):
        dp[y][x]=0
        return 0
    elif (x,y)==(0,1):
        dp[y][x]=0
        return 0
    elif (x,y)==(1,0):
        dp[y][x]=0
        return 0
    else:
        if dp[y][x]==-1:
            dp[y][x]=f(x-1,y-2)+f(x-2,y-1)
        return dp[y][x]

print(dp[y][x]%(10**9+7))

Buggy submission (verdict: Runtime Error):
# import sys
# sys.setrecursionlimit(35000)
x,y = map(int, input().split())

dp = [[-1]*(x+1) for i in range(y+1)]
# dp[1][2]=1
# dp[2][1]=1
# dp[1][1]=0
# dp[1][0]=0
# dp[0][1]=0

def f(x,y):
    if (x,y)==(1,2):
        dp[y][x]=1
        return 1
    elif (x,y)==(2,1):
        dp[y][x]=1
        return 1
    elif (x,y)==(1,1):
        dp[y][x]=0
        return 0
    elif (x,y)==(0,1):
        dp[y][x]=0
        return 0
    elif (x,y)==(1,0):
        dp[y][x]=0
        return 0
    else:
        if dp[y][x]==-1:
            dp[y][x]=f(x-1,y-2)+f(x-2,y-1)
        return dp[y][x]

print(dp[y][x]%(10**9+7))
Problem p02881 (python)

Fixed submission:
from math import sqrt

n=int(input())
count=[]

for i in range(1,int(sqrt(n))+1):
    if n%i==0:
        count.append(i+n/i)

print(int(min(count)-2))

Buggy submission (verdict: Runtime Error):
from math import sqrt 

n=int(input())
count=[]

for i in range(1,int(sqrt(n))):
    if n%i==0:
        count.append(i+n/i)

print(int(min(count)-2))
Problem p03013 (python)

Fixed submission:
n,m = map(int, input().split())
mod = 10**9+7

#フィボナッチ数列
dp = [0 for i in range(n+2)]
dp[0] = 1
dp[1] = 1
for i in range(2,n+2):
    dp[i] = dp[i-1] + dp[i-2]

#穴が無い場合
if m==0:
    print(dp[n]%mod)
    exit()

lst = []
for i in range(m):
    lst.append(int(input()))
lst.sort()

#2連続穴がある場合
for i in range(len(lst)-1):
    if lst[i]+1 == lst[i+1]:
        print(0)
        exit()

lst2 = []
for i in range(len(lst)):
    if i==0:
        lst2.append(lst[0]-1)
    else:
        lst2.append(lst[i]-lst[i-1]-2)
lst2.append(n-lst[-1]-1)

ans = 1
for i in lst2:
    ans *= dp[i]
    ans %= mod

# print(lst)
# print(lst2)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
mod = 10**9+7

lst = []
for i in range(m):
    lst.append(int(input()))
lst.sort()

#2連続穴がある場合
for i in range(len(lst)-1):
    if lst[i]+1 == lst[i+1]:
        print(0)
        exit()

lst2 = []
for i in range(len(lst)):
    if i==0:
        lst2.append(lst[0]-1)
    else:
        lst2.append(lst[i]-lst[i-1]-2)
lst2.append(n-lst[-1]-1)



dp = [0 for i in range(n)]
dp[0] = 1
dp[1] = 1
for i in range(2,n):
    dp[i] = dp[i-1] + dp[i-2]

ans = 1
for i in lst2:
    ans *= dp[i]
    ans %= mod

print(ans)
Problem p03775 (python)

Fixed submission:
n = int(input())
for i in reversed(range(int(n**0.5)+1)):
    if n%i==0:
        print(max(len(str(i)), len(str(n//i))))
        exit()

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in reversed(range(int(n**0.5))):
    if n%i==0:
        print(max(len(str(i)), len(str(n//i))))
        exit()

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
for i in reversed(range(math.ceil(n**0.5))):
    if n%i==0:
        print(max(len(str(i)), len(str(n//i))))
        exit()
Problem p03805 (python)

Fixed submission:
import itertools

n, m = map(int, input().split())
path = [[False] * n for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    path[a][b] = True
    path[b][a] = True
ans = 0

for i in itertools.permutations(range(n), n):
    if i[0] == 0:
        for j in range(n):
            if j == n - 1:
                ans += 1
                break
            if not path[i[j]][i[j + 1]]:
                break

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

n,m = map(int, input().split())
path = [[False]*n for _ in range(n)]
for i in range(n):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    path[a][b]=True
    path[b][a]=True

ans = 0

for i in itertools.permutations(range(n),n):
    if i[0]==0:
        for j in range(n):
            if j==n-1:
                ans += 1
                break
            if not path[i[j]][i[j+1]]:
                break

print(ans)
Problem p02699 (python)

Fixed submission:

s,w=map(int,input().split())


if s>w:
    print("safe")
else:
    print("unsafe")

Buggy submission (verdict: Runtime Error):

s,w=map(int,input().split())


if s>w:
    print(safe)
else:
    print(unsafe)

Buggy submission (verdict: Runtime Error):

s,w=map(int,input.split())


if s>w:
    print(safe)
else:
    print(unsafe)

Buggy submission (verdict: Runtime Error):

A=list(map(int,input.split()))
s=A[0]
w=A[1]

if s>w:
    print(safe)
else:
    print(unsafe)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input.split()))
s=A[0]
w=A[1]

if s>w:
    return safe
else:
    return unsafe
Problem p02707 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
a=[]
for i in range(n):
  a.append(0)
for i in range(n-1):
  a[l[i]-1]+=1
for i in range(n):
  print(a[i])

Buggy submission (verdict: Runtime Error):
A=input().split()
N=int(A[0])
del A[0]
B=[]
for i in range(N):
    B.append(0)
for i in range(N-1):
    B[int(A[i])-1]+=1
for i in range(N):
    print(B[i])

Buggy submission (verdict: Runtime Error):
A=input().split()
N=int(A[0])
del A[0]
B=[]
for i in range(N):
    B.append(0)
for i in range(N-1):
    B[int(A[i])-1]+=1
print(B)
Problem p02831 (python)

Fixed submission:
from fractions import gcd
a, b = list(map(int, input().split(' ')))
print((a * b)//gcd(a, b))

Buggy submission (verdict: Runtime Error):
from math import gcd
a, b = list(map(int, input().split(' ')))
print((a * b)//gcd(a, b))
Problem p02835 (python)

Fixed submission:
x = sum(list(map(int, input().split(' '))))
if x >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()
n = int(lines[0])
arr = list(map(int, lines[1].split(' ')))

maxi = 62
mod = int(1e9) + 7
ones = [0 for _ in range(maxi)]
for num in arr:
    for idx, val in enumerate(range(maxi)):
        ones[idx] += (num >> idx ) & 1

ans = 0
for idx, val in enumerate(ones):
    ans += ((pow(2, idx) % mod) * (((n - val)%mod) * (val%mod))) % mod

    ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()
n = int(lines[0])
arr = list(map(int, lines[1].split(' ')))

maxi = 62
mod = int(1e9) + 7
ones = [0 for _ in range(maxi)]
for num in arr:
    x = bin(num)[2:]
    # print(x)
    for idx, val in enumerate(reversed(x)):
        ones[idx] += int(val)

ans = 0
for idx, val in enumerate(ones):
    ans += ((pow(2, idx) % mod) * (((n - val)%mod) * (val%mod))) % mod

    ans %= mod

print(ans)
Problem p03127 (python)

Fixed submission:
def gcd(a, b):
    return gcd(b % a, a) if a and b else max(a, b)
    
n = int(input())
arr = sorted(list(map(int, input().split(' '))))
maxi = arr[-1]
gc = maxi
for num in arr[:-1]:
    if gcd(num, maxi) < gc:
        gc = gcd(num, maxi)

print(gc)

Buggy submission (verdict: Runtime Error):
from math import gcd
n = int(input())
arr = sorted(list(map(int, input().split(' '))))
maxi = arr[-1]
gc = maxi
for num in arr[:-1]:
    if gcd(num, maxi) < gc:
        gc = gcd(num, maxi)

print(gc)
Problem p03135 (python)

Fixed submission:
t, x = map(int, input().split(' '))
print(t / x)

Buggy submission (verdict: Runtime Error):
a, b = map(int. input().split(' '))
print(a * b)
Problem p03307 (python)

Fixed submission:
n = int(input())

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

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

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

Fixed submission:
def solve():
    n,m,k = list(map(int,input().split()))
    arr = list(map(int, input().split()))
    arr1 = list(map(int, input().split()))
    aTrack = 0
    bTrack = sum(arr1)
    Bn = len(arr1)
    ans = 0
    for An in range(len(arr)+1):
      if An>0:
        aTrack += arr[An-1]
      if aTrack>k:
        break
      while aTrack+bTrack>k:
        Bn -= 1
        bTrack -= arr1[Bn]
      ans = max(ans, An+Bn)
    print(ans)
    
            
solve()

Buggy submission (verdict: Runtime Error):
def solve():
    n,m,k = list(map(int,input().split()))
    arr = list(map(int,input().split()))
    arr1 = list(map(int,input().split()))
    count = 0
    trackLoop = 1
    trackCount = 0
    while trackCount<k:
        if trackCount==k:
            return count+1
        if len(arr)>0 and arr[0]<arr1[0]:
            trackCount+=arr.pop(0)
        else:
            if len(arr1)>0:
                trackCount+=arr1.pop(0)
            else:
                trackCount+=arr.pop(0)
        if trackCount==k:
            return count+1
        trackLoop+=1
        count+=1
        
    return count-1
    
print(solve())

Buggy submission (verdict: Runtime Error):
def solve():
    n,m,k = list(map(int,input().split()))
    arr = list(map(int,input().split()))
    arr1 = list(map(int,input().split()))
    count = 0
    trackLoop = 1
    trackCount = 0
    while trackCount<k:
        if trackCount==k:
            return count+1
        if len(arr)>0 and arr[0]<arr1[0]:
            trackCount+=arr.pop(0)
        else:
            if len(arr1)>0:
                trackCount+=arr1.pop(0)
            else:
                trackCount+=arr.pop(0)
        if trackCount==k:
            return count+1
        trackLoop+=1
        count+=1
        
    return count-1
    
print(solve())
Problem p02659 (python)

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

Buggy submission (verdict: Runtime Error):
from decimal import *
A, B = input().split()
A = Decimal(A)
B = Decimal(B * 100)
print(A * B // 100)
Problem p02682 (python)

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

if K < A:
    print(K)

elif A <=  K <= A + B:
    print(A)

else:
    print(A - (K - A - B))

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
point = [1] * A + [0] * B + [-1] * C

print(sum(point[:K]))
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
if N % (A + B) <= A:
    ans = (N // (A + B)) * A + N % (A + B)
    print(ans)
else:
    ans = (N // (A + B)) * A + A
    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N, A, B = map(int, input().split())
ans = ''
while len(ans) < N:
    ans += 'b' * A + 'r' * B
ans = list(ans)
ans = ans[:N]
ans = dict(Counter(ans))
ans = list(ans.values())
print(ans[0])
Problem p02759 (python)

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

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

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

Fixed submission:
from collections import deque
from math import sqrt

N = int(input())
step = deque()

for i in range(1, int(sqrt(N)) + 1):
    if N % i == 0:
        step.append(i - 1 + N // i - 1)

print(min(step))

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

N = int(input())
step = deque()

for i in range(1, int(sqrt(N))):
    if N % i == 0:
        step.append(i - 1 + N // i - 1)

print(min(step))
Problem p02891 (python)

Fixed submission:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

def l_s(L):
    return "".join(map(str, L))

import sys
from itertools import groupby as gb

S = input()
K = INT()
g1 = []

if len(set(S)) == 1:
    print(len(S) * K // 2)
    sys.exit()

for _, s in gb(S):
    g1.append(list(s))

tmp = l_s(g1[0]) + l_s(g1[len(g1) - 1])
g2 = []

for _, s in gb(tmp):
    g2.append(list(s))
    
ans = len(g1[0]) // 2 + len(g1[len(g1) - 1]) // 2

for i in range(1, len(g1) - 1):
    ans += (len(g1[i]) // 2) * K

for i in range(len(g2)):
    ans += (len(g2[i]) // 2) * (K - 1)
    
print(ans)

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

ans = 0

if S[0] == S[-1]:
    if S[-2] == S[-1]:
        ans = K
        S[-1] = -1
    else:
        ans = K - 1
        S[-1] = -1

j = 0
like = []

for i in range(len(S) - 1):
    if S[i] == S[i + 1]:
        if len(like) == j:
            like.append(2)
        else:
            like[j] += 1
    else:
        like.append(1)
        j += 1

for l in like:
    ans += l // 2 * K

print(ans)
Problem p02933 (python)

Fixed submission:
def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

a = int(input())
s = input()

print(s if a >= 3200 else "red")

Buggy submission (verdict: Runtime Error):
def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

a = int(input())
s = int(input())

print("s" if a >= 3200 else "red")