Harryxun/GPT-100-sft-dataset huggingface dataset:
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(input().split())
 
if s>w:
  print("safe")
else:
  print("unsafe")

Buggy submission (verdict: Runtime Error):
s,w =map(input().stlip())

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

Fixed submission:
n=int(input())
lst={}
for i in range(n):
  lst[input()]=1
print(len(lst))

Buggy submission (verdict: Runtime Error):
n=int(input())
lst={}
 for i in range(n):
    lst[str(input())]+=1
print(len(lst))

Buggy submission (verdict: Runtime Error):
n=int(input())
lst={}
for i in range(n):
 lst.extend(input().split())
list_uniq={}
ans=0
for j in lst:
 if list_uniq.count(j)==0:
    list_uniq.append(j)
    ans+=1
 else:
    pass
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
lst=[]
for i in range(n)
 lst.extend(str(input()))
 
 
list_uniq=[]
for j in lst
 if list_uniq.count(j)==0:
    list_uniq.extend(j)
 else:
    pass
 print(len(list_uniq))

Buggy submission (verdict: Runtime Error):
n=int(input())
lst=[]
for i in range(n)
 lst.extend(str(input()))


list_uniq=[]
for j in lst
 if list_uniq.count(j)==0:
    list_uniq.extend(j)
 else:
    pass
 print(len(list_uniq))
Problem p02707 (python)

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

ans=[0]*n

for i in l:
    ans[i-1]+=1

for j in ans:
    print(j)

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

m_list=[]
for i in range(1,s+1):
  m_list[i]=e_list.count(i)

for i in m_list:
  print(m_list[i])

Buggy submission (verdict: Runtime Error):
s=int(input())
e_list=dic(map(int,input().split()))
e_dic
for i in range(1,s+1):
  e_dic[i]=e_list.count(i)
 
for i in e_dic.keys():
  print(e_dic[i])

Buggy submission (verdict: Runtime Error):
s=int(input())
e_list=list(map(int,input().split())
e_dic={}
for i in range(s):
  e_dic[i]+=1
for j in e_dic.items
 print(e_dic[j].item)
Problem p02712 (python)

Fixed submission:
n=int(input())
sum=0
for i in range(1,n+1):
 if i%3!=0 and i%5!=0:
    sum+=i
print(sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
sum=0
for i in range(1,n+1)
 if i%3!=0 and i%5!=0:
    sum+=i
print(sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
sum=0
for i in range(1,n)
 if i%3!=0 and i%5!=0:
    sum+=i
print(sum)
Problem p02729 (python)

Fixed submission:
n,m=map(int, input().split())
 
a=n*(n-1)/2+m*(m-1)/2
 
print(str(int(a)))

Buggy submission (verdict: Runtime Error):
l=int(input())
ans=0
sum=0
 
for i in range(l):
 for j in range(l-i):
   sum=i*j*(l-i-j)
   if ans<sum:
      ans=sum
print(ans)

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

a=n*(n-1)/2+m*(m-1)/2

print(str(a))
Problem p02753 (python)

Fixed submission:
s=input()
if s=="AAA" or s=="BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
lis=""
ans=0
for i in range(n):
 for b in range(a):
  ans+=1
print(ans)
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
ans=int(n/(a+b))*a
if n%(a+b)>=a:
    ans+=a
else:
    ans+=n%(a+b)
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
ans=n/(a+b)
 if n%(a+b)>=a:
    ans+=a
 else:
    ans+=n%(a+b)
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
lis=""
ans=0
for i in range(n):
 for b in range(a):
  ans+=1
 for r in range(b+1):
print(ans)
Problem p02594 (python)

Fixed submission:
from math import *
from collections import *
from random import *
from bisect import *
import sys
input=sys.stdin.readline
def lis():
    return list(map(int,input().split()))
def ma():
    return map(int,input().split())
def inp():
    return int(input())
x=inp()
s='No'
if(x>=30):
    s='Yes'
print(s)

Buggy submission (verdict: Runtime Error):
from math import *
from collections import *
from random import *
from bisect import *
import sys
input=sys.stdin.readline
def lis():
    return list(map(int,input().split()))
def ma():
    return map(int,input().split())
def inp():
    return int(input())
x=inp()
s='No'
if(s>=30):
    s='Yes'
print(s)
Problem p02595 (python)

Fixed submission:
#from math import *
from collections import *
from random import *
from bisect import *
import sys
input=sys.stdin.readline
def lis():
    return list(map(int,input().split()))
def ma():
    return map(int,input().split())
def inp():
    return int(input())
n,d=ma()
r=0
for i in range(n):
    x,y=ma()
    f=(x*x)+(y*y)
    f=pow(f,0.5)
    if(f<=d):
        r+=1
print(r)

Buggy submission (verdict: Runtime Error):
from math import *
from collections import *
from random import *
from bisect import *
import sys
input=sys.stdin.readline
def lis():
    return list(map(int,input().split()))
def ma():
    return map(int,input().split())
def inp():
    return int(input())
n,d=ma()
r=0
for i in range(n):
    x,y=ma()
    f=(x*x)+(y*y)
    f=pow(x,0.5)
    if(f<=d):
        r+=1
print(r)
Problem p02623 (python)

Fixed submission:
from collections import *
import sys
from bisect import *
input=sys.stdin.readline
from math import *
t=1
while(t):
    t-=1
    n,m,k=map(int,input().split())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    prea=[a[0]]
    preb=[b[0]]
    for i in range(1,n):
        prea.append(prea[-1]+a[i])
    for j in range(1,m):
        preb.append(preb[-1]+b[j])
    r=0
    for i in range(n):
        if(k-prea[i]<0):
            break
        re=k-prea[i]
        rr=bisect_right(preb,re)
        r=max(r,i+1+rr)
    for i in range(m):
        if(k-preb[i]<0):
            break
        re=k-preb[i]
        rr=bisect_right(prea,re)
        r=max(r,i+1+rr)
    print(r)

Buggy submission (verdict: Runtime Error):
from collections import *
import sys
from bisect import *
input=sys.stdin.readline
from math import *
t=1
while(t):
    t-=1
    n,m,k=map(int,input().split())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    prea=[a[0]]
    preb=[b[0]]
    for i in range(1,n):
        prea.append(prea[-1]+a[i])
    for j in range(1,m):
        preb.append(preb[-1]+b[i])
    r=0
    for i in range(n):
        if(k-prea[i]<0):
            break
        re=k-prea[i]
        rr=bisect_right(preb,re)
        r=max(r,i+1+rr)
    for i in range(m):
        if(k-preb[i]<0):
            break
        re=k-preb[i]
        rr=bisect_right(prea,re)
        r=max(r,i+1+rr)
    print(r)
Problem p02682 (python)

Fixed submission:
a,b,c,k=map(int,input().split())
if(k<=a+b):
  print(min(a,k))
else:
  print(a-(k-(a+b)))

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
if(k<=a+b):
  print(k)
else:
  print(a-(k-(a+b))
Problem p02689 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
c=0
deg=[[] for i in range(n)]
for i in range(m):
  u,v=map(int,input().split())
  deg[u-1].append(v-1)
  deg[v-1].append(u-1)
for i in range(n):
  ff=0
  for j in deg[i]:
    if(a[i]>a[j]):
      continue
    ff=1
  if(ff==0):
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
c=0
deg=[[] for i in range(n)]
for i in range(m):
  u,v=map(int,input().split())
  deg[u-1].append(v-1)
  deg[v-1].append(u-1)
for i in range(n):
  ff=0
  for j in deg[i]:
    if(a[i]>a[deg[i][j]]):
      continue
    ff=1
  if(ff==0):
    c+=1
print(c)
Problem p02881 (python)

Fixed submission:
n=int(input())
r=100000000000000000000000000000
for i in range(1,int(pow(n,0.5))+1):
  if(n%i==0):
    r=min(r,abs(i-1)+abs(n//i-1))
print(r)

Buggy submission (verdict: Runtime Error):
n=int(input())
r=100000000000000000000000000000
for i in range(1,int(pow(n,0.5))+1):
  if(n%i==0):
    r=min(r,abs(i-1)+abs(n//i-1))
print(r(
Problem p02753 (python)

Fixed submission:
S=input()
if S=="AAA" or S=="BBB":
    print("No")
else:
    print("Yes")

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

for i in range(1100):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        exit()
print(-1)
Problem p02754 (python)

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

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

for i in range(1,1100):
    if int(i*0.8)==A and int(i*0.1)==B:
        print(i)
        break
else:
    print(-1)
Problem p02754 (python)

Fixed submission:
N,A,B = input().split()
N = int (N)
A = int(A)
B = int(B)
rep = (int)(N/(A+B))

numb = min(N%(A+B),A) + rep*A

print(numb)

Buggy submission (verdict: Runtime Error):
N,A,B = input().split()
N = long long (N)
A = int(A)
B = int(B)
rep = (int)(N/(A+B))

numb = min(N%(A+B),A) + rep*A

print(numb)
Problem p02829 (python)

Fixed submission:
a=int(input())
b=int(input())
c=6-a-b
print(c)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(6-a-b)
Problem p02831 (python)

Fixed submission:
a,b=map(int,input().split())
if a>=b:
    c=a
    d=b
else:
    c=b
    d=a
for i in range(1,d+1):
    e=c*i
    if e%d==0:
        print(e)
        break
    else:
        continue

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>=b:
    c=a
    d=b
else:
    c=b
    d=a
for i in range(1,d+1):
    e=c*i
    if e%d==0:
        print(e)
        break
    else:
        continue

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>=b:
	c=a
    d=b
else:
    c=b
    d=a
for i in range(1,d+1):
    e=c*i
    if e%d==0:
        print(e)
        break
    else:
        continue
Problem p02832 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
#print(A)
f=0
g=1
for i in range(0,n):
    if A[i]!=g:
        f+=1
    else:
        g+=1
#printf("%d %d\n",f,g)
if g!=1:
    print(f)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
f=0
g=1
for i in range(0,n):
    if A[i]!=g:
      f++
    else:
      g++
    #printf("%d %d\n",f,g)
if g!=1:
    print(f)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(0,n):
    a[i]=int(input())
f=0
g=1
for i in range(0,n):
    if a[i]!=g:
      f++
    else:
      g++
    #printf("%d %d\n",f,g)
if g!=1:
    print(f)
else:
    print(-1)
Problem p02879 (python)

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

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

Fixed submission:
N = int(input())
d = sorted(map(int, input().split()))
K = d[int(N/2)]-d[int(N/2)-1]
print(K)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = sorted(map(int, input().split()))
print(d[N/2]-d[N/2-1])
Problem p03053 (python)

Fixed submission:
H, W = map(int, input().rstrip().split())
checked = [[True]*(W+2)]
checked += [[True] + [ch == "#" for ch in input().rstrip()] + [True]
            for i in range(H)]
checked.append([True]*(W+2))

black_list = []
# 初期化
# 0 => 黒、 -1 => 白
for i in range(1, H+1):
    for j in range(1, W+1):
        if checked[i][j]:
            black_list.append((i, j))

# 黒の周辺4方向のうち、白だったら黒にする
ans = -1
while black_list:
    ans += 1
    tmp = []
    for x, y in black_list:
        # 上
        if not checked[x-1][y]:
            checked[x-1][y] = True
            tmp.append((x-1, y))
        # 下
        if not checked[x+1][y]:
            checked[x+1][y] = True
            tmp.append((x+1, y))
        # 左
        if not checked[x][y-1]:
            checked[x][y-1] = True
            tmp.append((x, y-1))

        # 右
        if not checked[x][y+1]:
            checked[x][y+1] = True
            tmp.append((x, y+1))

    black_list = tmp

print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().rstrip().split())
checked = [[-1]*W for i in range(H)]
black_list = []
# 初期化
# 0 => 黒、 -1 => 白
for i in range(H):
    row = input().rstrip()
    for j in range(W):
        if row[j] == "#":
            checked[i][j] = 0
            black_list.append((i, j))


queue = deque([])
# 黒の周辺4方向のうち、白だったら黒にする
while black_list:
    tmp = []
    for x, y in black_list:
        # 上
        if x-1 > -1 and checked[x-1][y] == -1:
            checked[x-1][y] = checked[x][y] + 1
            tmp.append((x-1, y))
        # 下
        if x+1 < H and checked[x+1][y] == -1:
            checked[x+1][y] = checked[x][y] + 1
            tmp.append((x+1, y))
        # 左
        if y-1 > -1 and checked[x][y-1] == -1:
            checked[x][y-1] = checked[x][y-1] + 1
            tmp.append((x, y-1))

        # 右
        if y+1 < W and checked[x][y+1] == -1:
            checked[x][y+1] = checked[x][y+1] + 1
            tmp.append((x, y+1))

    black_list = tmp


ans = 0
for i in range(H):
    for j in range(W):
        if ans < checked[i][j]:
            ans = checked[i][j]
print(ans)
Problem p02779 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
def test(A):
    return len(A)!= len(set(A))
if test(A)==False:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
A = [int(i) for i in input().split()]
for i,a in enumerate(A):
    if a in A[i+1:]
        print("NO")
        sys.exit(0)
print("YES")
Problem p02831 (python)

Fixed submission:
import fractions
A, B = [int(i) for i in input().split()]
print(int(A*B/fractions.gcd(A,B)))

Buggy submission (verdict: Runtime Error):
import math
A, B = [int(i) for i in input().split()]
print(int(A*B/math.gcd(A,B)))
Problem p02627 (python)

Fixed submission:
x = input()

if x in ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]:
  print('a')
else:
  print('A')

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

if s.is_super:
  print("A")
else:
  print("a")

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

if x in [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]:
  print('a')
else:
  print('A')
Problem p02693 (python)

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

c=0
for i in range(a, b+1):
  if i%k == 0:
    c += 1
  else:
    pass    
if c == 0:
  print("NG")
else:
  print("OK")

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

c=0
for i in range(a, b+1):
	if i%k == 0:
        c += 1
if c == 0:
	print("NG")
else:
    print("OK")
Problem p03775 (python)

Fixed submission:
N = int(input())
l = []
for a in range(1, 10**5+1):
  if N % a == 0:
    b = N // a
    s = max(len(str(a)), len(str(b)))
    l.append(int(s))
print(min(l))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
I = int(math.sqrt(N) // 1)
print(I)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    k = len(str(i))
    l = len(str(j))
    m = max(k, l)
    a.append(int(m))
print(min(a))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
I = int(math.sqrt(N) // 1)
print(I)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    k = len(list(str(i)))
    l = len(list(str(j)))
    m = max(k, l)
    a.append(m)
print(min(a))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
I = int(math.sqrt(N) // 1)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    i = len(list(str(i)))
    j = len(list(str(j)))
    k = max(i, j)
    a.append(k)
print(min(a))
Problem p02622 (python)

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

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

if i in range(s):
  if s[i] != t[i]:
    res += 1
    
print(res)
Problem p02725 (python)

Fixed submission:
K, N = map(int, input().split())
A =  list(map(int, input().split()))

mini = K
right = left = K
for i in range(N):
	l_begin = i-1
	r_begin = i+1
	if i == 0:
		l_begin = N-1
		right = A[l_begin] - A[i]
		left = K - (A[r_begin]-A[i])
	elif i == N-1:
		r_begin = 0
		right = K - (A[i]-A[l_begin])
		left = A[i] - A[r_begin]
	else:
		right = K - (A[i]-A[l_begin])
		left = K - (A[r_begin]-A[i])
	local = min(right, left)
	if local < mini:
		mini = local
		

print(mini)

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

if A % C ==0:ca = A//C-1
else: ca = A//C
cb = B//C


if A % D ==0: ad = A//D-1
else:da = A//D 
db = B//D

lcm = C * D //gcd(C,D)
if A % lcm==0: cda = A//lcm-1
else:cda = A//lcm
cdb = B//lcm

print(B-A+1-((cb-ca)+(db-da)-(cdb-cda)))
Problem p03775 (python)

Fixed submission:
from math import sqrt
N = int(input())

ans = 100
sq_n = int(sqrt(N))
for i in range(1, sq_n+1):
  if N % i == 0:
    ans = min(ans, max(len(str(i)),len(str(N//i))))
print(ans)

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

ans = 100
for i in range(N+1//2):
  if N % i == 0:
    ans = min(ans, len(str(i))+len(str(N//i)))
print(ans)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = str(input())

s1 = s[:(n//2)]
s2 = s[(n//2):]

print( 'Yes' if s1 == s2 else 'No')

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

s1 = s[:(n/2)]
s2 = s[(n/2):]

print( s1 == s2 ? 'Yes' : 'No')
Problem p02773 (python)

Fixed submission:
import collections

def main():
    n = int(input())
    p = [input() for i in range(n)]

    c = collections.Counter(p)
    m = c.most_common()
    most = m[0][1]

    answer = []

    answer.append(m[0][0])

    for i in range(len(m)-1):
        if m[i+1][1] == most:
            answer.append(m[i+1][0])
        else:
            break

    for output in sorted(answer):
        print(output)
    return


main()

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [input() for i in range(n)]

c = collections.Counter(p)
m = c.most_common()
most = m[0][1]

answer = []

answer.append(m[0][0])

for i in range(len(m)-1):
    if m[i+1][1] == most:
        answer.append(m[i+1][0])
    else:
        break

for output in sorted(answer):
    print(output)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
p = [input() for i in range(n)]

c = collections.Counter(p)
m = c.most_common()
most = m[0][1]

answer = []

answer.append(m[0][0])

for i in range(len(m)-1):
    if m[i+1][1] == most:
        answer.append(m[i+1][0])
    else:
        break

for output in sorted(answer):
    print(output)
return
Problem p02777 (python)

Fixed submission:
S, T = map(str,input().split())
A, B = map(int,input().split())
U = str(input())

if U == S:
    A = A - 1
else:
    B = B - 1

print(A, B)

Buggy submission (verdict: Runtime Error):
def main():
    x,y = map(int,input().split())
    p = list(map(int,input().split()))

    bigNumber = 0

    for i in range(x-y+1):

        number = sum(p[i:i+y])

        if number > bigNumber:
            bigNumber = number

    print((bigNumber + y) / 2)

main()
Problem p02820 (python)

Fixed submission:


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


st = [0 for _ in range(n)]
for i in range(n):
    if i < k: 
        if t[i] == 'r' :
            st[i] = 'p'
        elif t[i] == 's' :
            st[i] = 'r'
        elif t[i] == 'p':
            st[i] = 's'
    else:
        if t[i] == 'r' and st[i-k] != 'p':
            st[i] = 'p'
        elif t[i] == 's' and st[i-k] != 'r':
            st[i] = 'r'
        elif t[i] == 'p'and st[i-k] != 's':
            st[i] = 's'
        
score = 0
for i in st:
    if i == 'r' :
        score += r
    elif i == 's' :
        score += s
    elif i == 'p' :
        score += p

print(score)

Buggy submission (verdict: Runtime Error):


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

# t_sub = #sub string
ban = []
st = []
score1 = 0
score2 = 0

for i in t:
    if i == 'r' :
        st.append('p')
    elif i == 's' :
        st.append('r')
    else:
        st.append('s')
            
def score(l, m):
    c = 0       
    for i in range(len(l)):
        if l[i] != m[i]:
            if l[i] == 'r' :
                c += r
            elif l[i] == 's' :
                c += s
            elif l[i] == 'p' :
                c += p
    return c
           
                
st1 = st
for i in range(k):
    st1_sub = st1[i::k]
    st2_sub = st2[i::k]
    t_sub = t[i::k]
    
    for j in range(len(st1_sub)-1):
        if st1_sub[j+1] == st1_sub[j]:
            st1_sub[j+1] = t_sub[j+1]
            st2_sub[j] = t_sub[j]
    if score(st1_sub, t_sub) > score(st2_sub, t_sub):
        st[i::k] = st1_sub
    else:
        st[i::k] = st2_sub

print(score(st,t))
Problem p02659 (python)

Fixed submission:
inp = input().split()

A = int(inp[0])
_B = float(inp[1])
B = round(_B * 100)

res = int(A*B // 100)

print(str(res))

Buggy submission (verdict: Runtime Error):
A, B = [x for x in input().split()]

A = int(A)
B = int(round(float(B) * 100))

print(A*B // 100
Problem p02688 (python)

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

d = []
A = []
for i in range(K):
    _d = int(input())
    d.append(_d)
    _a = [int(x) for x in input().split()]
    A.append(_a)

res = []
for i in range(1, N+1):
    res.append(i)

for a in A:
    for _a in a:
        if _a in res:
            res.remove(_a)
print(len(res))

Buggy submission (verdict: Runtime Error):

d = []
A = []
for i in range(K):
    _d = int(input())
    d.append(_d)
    _a = [int(x) for x in input().split()]
    A.append(_a)

res = []
for i in range(1, N+1):
    res.append(i)

for a in A:
    for _a in a:
        if _a in res:
            res.remove(_a)
print(len(res))
Problem p02912 (python)

Fixed submission:
import heapq

N, M = list(map(int, input().split()))
A = list(map(lambda x: -int(x), input().split()))

heapq.heapify(A)

for i in range(M):
    _ = -heapq.heappop(A)
    _ = int(_ / 2)
    heapq.heappush(A, -_)

print(-sum(A))

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


def discount(x, y):
    return int(x / (2 ** y))

A.sort()

for i in range(M):
    if i == 0:
        res = sum(A) - A[N-1] + discount(A[N-1], M)
    else:
        _res = sum(A)
        for j in range(i+1):
            _res -= A[N-1-j]
            _res += discount(A[N-1-j], M-1-j)
        res = min(res, _res)

print(res)
Problem p02597 (python)

Fixed submission:
import numpy as np

n = int(input())
c = np.array(list(input()))

count = 0

n_white = np.count_nonzero(c=='W')
n_red = np.count_nonzero(c=='R')

if n_red:
    if n_white:
        p_white = np.where(c == 'W')[0].tolist()
        p_red = np.where(c == 'R')[0].tolist()
        num = min(len(p_white), len(p_red))
        i = 0
        while (i < num):
            if p_white[i] < p_red[-1-i]:
                count += 1
            i += 1

print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np

def swip(a, b):
    tmp = c[a]
    c[a] = c[b]
    c[b] = tmp

def c_change(a):
    if c[a] == 'W':
        c[a] = 'R'
    else:
        c[a] = 'W'

n = int(input())
c = np.array(list(input()))

# done = 0
count = 0
i = 0

n_white = np.count_nonzero(c=='W')
n_red = np.count_nonzero(c=='R')

while True:
    i += 1
    if n_white:
        min_white = np.where(c == 'W')[0].tolist()[0]
        max_red = np.where(c == 'R')[0].tolist()[-1]
        if min_white < max_red:
            swip(min_white, max_red)
            count += 1
        else:
            break
    else:       # no white stones
        break

print(count)
Problem p02831 (python)

Fixed submission:
def calc_gcd(a, b):
    r = a % b
    while (r != 0):
        a = b
        b = r
        r = a % b

    return b

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

if a < b:
    tmp = a
    a = b
    b = tmp

gcd = calc_gcd(a, b)
ans = int(a * b / gcd)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

ans = int(a * b / math.gcd(a, b))

print(ans)