Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    f = [0]*2000000
    inv = [0]*2000000
    def fast_exponentiation(base, exp):
        res = 1
        while exp:
            if exp & 1:
                res = (res * base) % mod
            base = (base * base) % mod
            exp >>=1
        return res % mod 
    
    def ncr(n,r):
        if n<r or n<0 or r<0:
            return 0
        cur = f[n]
        p = inv[r]
        p = (p*(inv[n-r]))%mod
        return (cur*p)%mod

    n,m,k=MI()
    f[0]=1
    inv[0]=1
    for i in range(1,200007):
        f[i]=(f[i-1]*i)%mod
        inv[i]= fast_exponentiation(f[i],-1)
    ans =0
    for i in range(1,k+2):
        p1 = fast_exponentiation(m,i)
        q1 = fast_exponentiation(m-1,n-i)
        cur = (p1*q1)%mod
        ans+=cur%mod
        ans%=mod
    print(ans)
    

if __name__ == "__main__":
    main()

Fixed submission:
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    s = S()
    t = S()
    if s == t[:len(t)-1]:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    a,b,c,d=MI()
    f=0
    while True:
        if f==0:
            c=c-b
            f=1
            if c==0:
                print("Yes")
                break
        if f==1:
            a=a-d
            f=0
            if a==0:
                print("No")
                break

if __name__ == "__main__":
    main()

Fixed submission:
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    a,b,c,d=MI()
    f=0
    while True:
        if f==0:
            c=c-b
            f=1
            if c<=0:
                print("Yes")
                break
        if f==1:
            a=a-d
            f=0
            if a<=0:
                print("No")
                break

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]
ans = 1
for i in a:
    ans *= i
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            a = math.gcd(i,j)
            b = math.gcd(a,l)
            ans += b
print(ans)

Fixed submission:
import math

k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        a = math.gcd(i,j)
        for l in range(1,k+1):
            b = math.gcd(a,l)
            ans += b
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
n = int(input())
s = input()
c_dic = defaultdict(list)
for idx,i in enumerate(s):
    c_dic[i].append(idx)
ans = 0
for i in c_dic['R']:
    for j in c_dic['G']:
        ma = max(i,j)
        mi = min(i,j)
        for l in c_dic['B']:
            ma1 = max(ma,l)
            middle = max(min(ma,l),mi)
            mi1 = min(l,mi)
            if ma1 - middle !=  middle - mi1:
                ans += 1
print(ans)

Fixed submission:
from collections import defaultdict
n = int(input())
s = input()
c_dic = defaultdict(list)
for idx,i in   enumerate(s):
    c_dic[i].append(idx)
ans = len(c_dic['R'])*len(c_dic['G'])*len(c_dic['B'])
for i in range(0,n-1):
    for j in range(i+1,n):
        k = 2*j - i
        if k < n and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
import math
n = int(input())
a = [int(x) for x in input().split()]
ans = []
m_dic = defaultdict(int)
for i in a:
    m_dic[i] += 1

for i in range(n):
    count = 0
    for key,value in m_dic.items():
        v = value
        if key == a[i]:
            v = value -1
        if v > 1:
            count += math.factorial(v) // (math.factorial(v - 2) * math.factorial(2))
    ans.append(count)
for i in ans:
    print(i)

Fixed submission:
from collections import defaultdict
import math
n = int(input())
a = [int(x) for x in input().split()]
ans = []
tmp_sum = 0
m_dic,c_dic = defaultdict(int),defaultdict(int)
for x in a:
    m_dic[x] += 1

for value in m_dic.values():
    if value > 1:
        tmp_sum += math.factorial(value) // (math.factorial(value - 2) * math.factorial(2))

for x in a:
    print(tmp_sum-m_dic[x]+1)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())

for _ in range(m):
    a += str(n)
for _ in range(n):
    b += str(m)

print(a if n <= m else b)

Fixed submission:
n,m = map(int,input().split())
a = b = ''
for _ in range(m):
    a += str(n)
for _ in range(n):
    b += str(m)

print(a if n <= m else b)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
if n>1:
    for idx in range(1,len(a)):
        g = a[idx]*g//gcd(a[idx],g)
ans = []
for i in range(n):
    ans.append(int(g/a[i]))
print(sum(ans)%(10**9+7))

Fixed submission:
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
for i in a:
    g = i*g//gcd(i,g)
ans = 0
for i in range(n):
    ans+=int(g//a[i])
print(ans%(10**9+7))

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
if n>1:
    for idx in range(1,len(a)):
        g = a[idx]*g//math.gcd(a[idx],g)
ans = []
for i in range(n):
    ans.append(int(g/a[i]))
print(sum(ans)%(10**9+7))

Fixed submission:
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
for i in a:
    g = i*g//gcd(i,g)
ans = 0
for i in range(n):
    ans+=int(g//a[i])
print(ans%(10**9+7))

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
if n>1:
    for idx in range(1,len(a)):
        g = a[idx]*g//math.gcd(a[idx],g)
ans = []
for i in range(n):
    ans.append(int(g/a[i]))
print(sum(ans)%(10**9+7))

Fixed submission:
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
for i in a:
    g = i*g//gcd(i,g)
ans = 0
for i in range(n):
    ans+=int(g//a[i])
print(ans%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
n = int(input())
rob = defaultdict(list)
for i in range(n):
    x,l  = map(int,input().split())
    rob[x] = [l,x-l,x+l]
rob = sorted(rob.items(), key=lambda x:x[1])
tmp = []
for idx in range(0,len(rob)-1):
    i,[l,left,right] = rob[idx]
    for idx2 in range(idx+1,len(rob)):
        j,[_,_,_] = rob[idx2]
        if left < j < right:
            tmp.append(idx2)

print(len(rob)-len(set(tmp)))

Fixed submission:
n = int(input())
rob = []
for i in range(n):
    x,l = map(int,input().split())
    rob.append([x-l,x+l])
rob.sort()
ans  = n
right = rob[0][1]
for i,[l,r] in enumerate(rob):
    if i == 0:
        continue
    if l < right:
        ans -= 1
        right = min(right,r)
    else:
        right = r
print(ans)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

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

print(int(a*b/gcd(a,b)))

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

print(6-a-b)
Buggy python submission (verdict: Runtime Error):
import math

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

print(int(a*b/math.gcd(a,b)))

Fixed submission:
from fractions import gcd

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

print(int(a*b/gcd(a,b)))
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
ans = [k]*n
for i in range(q):
    idx = int(input()) - 1
    for i in range(n):
        if idx != i:
            ans[i] -= 1
for i in ans:
    print('Yes' if i >0 else 'No')

Fixed submission:
n,k,q = map(int,input().split())
ans = [0]*n
for i in range(q):
    idx = int(input()) -1
    ans[idx] += 1
for i in ans:
    print('Yes' if q-k<i else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
print(sum(range(int(input()))))

Fixed submission:
n = int(input())
print(n*(n-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [sorted(input()) for _ in range(n)]

count = 0
for i in range(len(s)-1):
    for j in range(i+1,len(s)):
        if s[i] == s[j]:
            count += 1
print(count)

Fixed submission:
n = int(input())
s = ["".join(sorted(input())) for _ in range(n)]

dic = {}
ans = 0
for i in s:
    if i in dic:
        ans += dic[i]
        dic[i] += 1
    else:
        dic[i] = 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
money = sorted([list(map(int,input().split())) for _ in range(n)], key = lambda x: x[1], reverse = True)

dic = {}
ans = 0
for s in money:
    if s[0] <= m:
        if s[0] not in dic:
            dic[s[0]] = s[1]
            ans += s[1]
        else:
            for i in range(1,m-s[0]+1):
                if s[0]+i not in dic:
                    dic[s[0]+i] = s[1]
                    ans += s[1]
                    break
    if len(dic) == m:
        break
print(ans)

Fixed submission:
import heapq
from collections import defaultdict
n,m = map(int,input().split())
dct = defaultdict(list)

for i in range(n):
    a,b = map(int,input().split())
    dct[a].append(-b)

h = []
ans = 0

for i in range(1,m+1):
    if dct[i]:
        for item in dct[i]:
            heapq.heappush(h, item)
    if h:
        ans += heapq.heappop(h)
print(-ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
money = sorted([list(map(int,input().split())) for _ in range(n)], key = lambda x: x[1], reverse = True)

dic = {}
ans = 0
for s in money:
    if s[0] <= m:
        if s[0] not in dic:
            dic[s[0]] = s[1]
            ans += s[1]
        else:
            for i in range(1,m-s[0]+1):
                if s[0]+i not in dic:
                    dic[s[0]+i] = s[1]
                    ans += s[1]
                    break
print(ans)

Fixed submission:
import heapq
from collections import defaultdict
n,m = map(int,input().split())
dct = defaultdict(list)

for i in range(n):
    a,b = map(int,input().split())
    dct[a].append(-b)

h = []
ans = 0

for i in range(1,m+1):
    if dct[i]:
        for item in dct[i]:
            heapq.heappush(h, item)
    if h:
        ans += heapq.heappop(h)
print(-ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]

m = max(a)
b = a[:]
for idx,i in enumerate(a):
    if m != i:
        print(m)
    else:
        del b[idx]
        print(max(b))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)
m = b[-1]
m1 = b[-2]

for i in a:
    if m != i:
        print(m)
    else:
        print(m1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]

for idx,i in enumerate(a):
    b = a[:]
    del b[idx]
    print(max(b))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)
m = b[-1]
m1 = b[-2]

for i in a:
    if m != i:
        print(m)
    else:
        print(m1)
Buggy python submission (verdict: Runtime Error):
mod = 10**9+7
a = n-k
if a > k: r = a
else: r = k

c = [[0]*(r+1)]
for i in range(1,r+2):
    c1 = [1]
    for j in range(1,r+2):
        if i == 1:
            if i == j:
                c1.append(1)
            else:
                c1.append(0)
        else:
            if j <= i:
                c1.append(c[i-1][j-1] + c[i-1][j])
            else:
                c1.append(0)
    c.append(c1)
for i in range(k):
    if a != 0:
        print(c[a+1][i+1]*c[k-1][i]%mod)
    else:
        print("0")

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

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

for i in range(k):
    print(dp[n-k+1][i+1]*dp[k-1][i]%mod)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
a,b,c,d = map(int,input().split())
l = (c*d) // fractions.gcd(c,d)
 
x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l
s = int(x+y-z)
 
print(b-a+1-s)

Fixed submission:
s = ''
for i in input():
    if s == i:
        print("Bad")
        exit()
    s = i
print("Good")

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
a,b,c,d = map(int,input().split())
l = (c*d) // gcd(c,d)
 
x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l
s = int(x+y-z)
 
print(b-a+1-s)

Fixed submission:
s = ''
for i in input():
    if s == i:
        print("Bad")
        exit()
    s = i
print("Good")

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
l = (c*d) // math.gcd(c,d)

x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l

s = (x+y-z)
print(b-a+1-s)

Fixed submission:
s = ''
for i in input():
    if s == i:
        print("Bad")
        exit()
    s = i
print("Good")

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
a,b,c,d = map(int,input().split())
l = (c*d) // gcd(c,d)

x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l

s = (x+y-z)
print(b-a+1-s)

Fixed submission:
s = ''
for i in input():
    if s == i:
        print("Bad")
        exit()
    s = i
print("Good")
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
ans = {}
for _ in range(m):
    l,r = map(int,input().split())
    gate = []
    if ans:
        for i in range(max(l,min(ans)),min(r+1,max(ans))+1):
            gate.append(i)
        ans &= set(gate)
    else:
        for i in range(l,r+1):
            gate.append(i)
        ans = set(gate)
print(len(ans))

Fixed submission:
n,m = map(int,input().split())
ans = []
for _ in range(m):
    l,r = map(int,input().split())
    if ans:
        ans = [max(ans[0],l),min(ans[1],r)]
    else:
        ans = [l,r]
print(ans[1]-ans[0]+1 if ans[1]-ans[0]+1>0 else 0)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [int(x) for x in input().split()]
cc = sorted([list(map(int,input().split())) for _ in range(m)], key=lambda x:x[1], reverse=True)

for card in cc:
    for i in range(card[0]):
        if min(a) < card[1]:
            a[a.index(min(a))] = card[1]
        else:
            print(sum(a))
            exit()
print(sum(a))

Fixed submission:
n,m = map(int,input().split())
a = [int(x) for x in input().split()]
cc = sorted([list(map(int,input().split())) for _ in range(m)], key=lambda x:x[1], reverse=True)
t = 0
for b, c in cc:
    a.extend([c] * b)
    t += b
    if t > n:
        break
a.sort(reverse=True)
print(sum(a[:n]))
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int, input().split())
s = input()
ans = []
for i in range(q):
    l,r = map(int,input().split())
    ans.append(s[l-1:r].count('AC'))
print(*ans,sep='\n')

Fixed submission:
n,q = map(int,input().split())
s = input()
a = [0]*2
for i in range(2,n+1):
    a += [a[i-1]+s[i-2:i].count('AC')]
ans = []
for _ in range(q):
    l,r = map(int,input().split())
    ans.append(a[r]-a[l])
print(*ans, sep='\n')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split( )))
c = 1
for i in range(1,N):
    v = min(set(P[:i]))
    if v >= P[i]:
        c += 1
print(c)

Fixed submission:
N = int(input())
P = list(map(int, input().split( )))
c = 1
v = P[0]
for i in range(1,N):
    if v >= P[i]:
        c += 1
        v = P[i]
print(c)
Buggy python submission (verdict: Runtime Error):
A,B,C = input().split(' ')
d = int(A/B)
if d > C:
    print(C)
else:
    print(d)

Fixed submission:
A,B,C = input().split(' ')
d = int(int(B)/int(A))
if d > int(C):
    print(int(C))
else:
    print(d)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
count = 0
S1 = S
S2 = ''
while S1 != S2:
    S2 = S1
    S1 = S1.replace('01','',-1).replace('10','',-1)
print(len(S)-len(S2))

Fixed submission:
S = input()
a = S.count('0')
b = S.count('1')
print(min(a,b)*2)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
count = 0
S1 = S
S2 = ''
while S1 != S2:
    S2 = S1
    S1 = S1.replace('01','',-1)
    S1 = S1.replace('10','',-1)
    count += len(S2) - len(S1)
print(count)

Fixed submission:
S = input()
a = S.count('0')
b = S.count('1')
print(min(a,b)*2)
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
a = float(a)
b = float(b*100)
print(a*b//100)

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

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

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

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

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

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

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

Buggy python submission (verdict: Runtime Error):
import decimal
a, b = map(decimal, input().split())
b = b*100
c = a*b
print(int(c/100))

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

Buggy python submission (verdict: Runtime Error):
import decimal
a, b = map(decimal, input().split())
b = b*1000
c = a*b
print(int(c/1000))

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

Buggy python submission (verdict: Runtime Error):
import math
a, b = map(decimal, input().split())
b = b*1000
c = a*b
print(math.floor(c/1000))

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

Buggy python submission (verdict: Runtime Error):
a, b = map(decimal, input().split())
b = b*1000
c = a*b
print(math.floor(c/1000))

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)

Buggy python submission (verdict: Runtime Error):
a, b = map(float, input().split())
b = b*1000
c = a*b
print(math.floor(c/1000))

Fixed submission:
a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(a*b//100)
Buggy python submission (verdict: Runtime Error):
n,m = input().split()
n = int(n)
m = int(m)

A = list(map(int, input().split()))

import itertools
l = A
p = itertools.permutations(A,2)

permlist = []
for perm in p:
    permlist.append(perm)

permsumlist = []

for perm in permlist:
    permsumlist.append(sum(perm))

new_list_reverse = sorted(permsumlist, reverse=True)

answer = max(A) + max(A)

for i in range(m-1):
    answer += new_list_reverse[i]

print(answer)

Fixed submission:
import os
import sys

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


N, M = list(map(int, sys.stdin.buffer.readline().split()))
A = list(map(int, sys.stdin.buffer.readline().split()))

A.sort()
A = np.array(A, dtype=int)
cs = A[::-1].cumsum()[::-1]


def test(k):
    # 幸福度が k 以上になる握手を採用する
    counts = N - np.searchsorted(A, k - A)
    return counts.sum() >= M


def count(k):
    counts = N - np.searchsorted(A, k - A)
    cnt = counts.sum()

    pos = np.searchsorted(A, k - A)
    ret = ((A * counts)[pos < N] + cs[pos[pos < N]]).sum()
    ret -= abs(M - cnt) * k
    return ret


ok = 0
ng = max(A) * 2 + 1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if test(mid):
        ok = mid
    else:
        ng = mid

ans = count(ok)
print(ans)
Buggy python submission (verdict: Runtime Error):
color = input().split()
num = input().split()
choice = input()
for i in 2:
  if choice == color[i]:
    num[i] = int(num[i]) - int(color[i])
    
print(num)

Fixed submission:
color = input().split()
num = input().split()
choice = input()

for i in range(2):
  num[i] = int(num[i])
  if color[i] == choice:
    num[i] = num[i] - 1
print(num[0], num[1])
Buggy python submission (verdict: Runtime Error):
color = input().split()
num = input().split()
choice = input()

for i in range(2):
  if choice == color[i]:
    num[i] = int(num[i]) - 1 
    
print(num)

Fixed submission:
s = input()
c = ''
for i in range(len(s)):
  c += 'x'
  

print(c)