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

Fixed submission:
S=input()
N=len(S)
ren=[]
a=1
if N==1:
  print(1)
  exit()
for i in range(N-1):
  if S[i]==S[i+1]:
    a+=1
  else:
    ren.append(a)
    a=1
  if i==N-2:
    ren.append(a)
      
M=len(ren)
ma=max(ren)
su=0
if S[0]=="<":
  if M%2==0:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+ren[2*k]*(ren[2*k]-1)//2+ren[2*k+1]*(ren[2*k+1]+1)//2
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
  else:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+((ren[2*k]*(ren[2*k]-1))//2)+(ren[2*k+1]*(ren[2*k+1]+1)//2)
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
if S[0]==">":
  su+=ren[0]*(ren[0]+1)//2  
  if (M-1)%2==0:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
  else:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
print(su)

Buggy submission (verdict: Runtime Error):
S=input()
N=len(S)
ren=[]
a=1
for i in range(N-1):
  if S[i]==S[i+1]:
    a+=1
  else:
    ren.append(a)
    a=1
  if i==N-2:
    ren.append(a)
      
M=len(ren)
ma=max(ren)
su=0
if S[0]=="<":
  if M%2==0:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+ren[2*k]*(ren[2*k]-1)//2+ren[2*k+1]*(ren[2*k+1]+1)//2
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
  else:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+((ren[2*k]*(ren[2*k]-1))//2)+(ren[2*k+1]*(ren[2*k+1]+1)//2)
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
if S[0]==">":
  su+=ren[0]*(ren[0]+1)//2  
  if (M-1)%2==0:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
  else:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
print(su)
Problem p02912 (python)

Fixed submission:
from collections import deque
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
q1=deque(A)
q2=deque([])
for i in range(M):
  if len(q1)!=0 and (len(q2)==0 or q1[0]>=q2[0]):
    x=q1.popleft()
  else:
    x=q2.popleft()
  q2.append(x//2)
print(int(sum(q1)+sum(q2)))

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
ls = list(map(int, input().split()))
for i in range(M)
  a=ls.index(max(ls))
  l[a]=l[a]//2
print(sum(ls))
Problem p02771 (python)

Fixed submission:
import sys
input_array = [str(e) for e in input().split()]
for i in set(input_array):
    if input_array.count(i) == 2:
        print('Yes')
        sys.exit()
    else:
        pass
print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
count_dict = {}
for _ in range(n):
    e = input()
    if e in count_dict.keys():
        count_dict[e] += 1
    else:
        count_dict[e] = 0

max_list = [e[0] for e in count_dict.items() if e[1] == max(count_dict.values())]
max_list.sort()
for i in max_list:
    print(i)
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())

ans = 'unsafe'

if s > w:
  ans = 'safe'

print(ans)

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

s = input()

# print(s)

ans = np.zeros((len(s)+1, len(s)+1), dtype = np.int)

# print(ans)

if len(s) >= 4:
  for i in range (0, len(s) - 3):
    for j in range (i + 4, len(s)+1):
      num = int(s[i:j])
      # print(num)
      if num % 2019 == 0:
        ans[i, j] += 1

# print(ans)

print(np.sum(ans))
Problem p02711 (python)

Fixed submission:
n = list(input())

# print(n)
ans = "No"

for i in range(3):
  if n[i] == '7':
    ans = 'Yes'

print(ans)

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

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

a_array = np.array(a)

ans_array = np.zeros((n//2, n), dtype = np.int)

if n >=4:

  ans_array[0, 0] = a_array[0]
  ans_array[0, 1] = a_array[1]
  ans_array[0, 2] = a_array[2]

  for i in range(1, n//2):
    j = 2*(i+1)
    # print(i, j)
    ans_array[i, j-2] = ans_array[i-1, j-4] + a_array[j-2]
    ans_array[i, j-1] = max(ans_array[i-1, j-4], ans_array[i-1, j-3]) + a_array[j-1]
    if j < n:
      ans_array[i, j]  = max(ans_array[i-1, j-3], ans_array[i-1, j-2]) + a_array[j]
  # print(ans_array)

  print(np.max(ans_array[-1, -3:]))

else:
  print(max(a_array))

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

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

a_array = np.array(a)

if n % 2 == 3:
  sum_1 = np.sum(a_array[0:-1:2])
  sum_2 = np.sum(a_array[1::2])
  ans = max(sum_1, sum_2)

else:
  max_value = np.zeros((2, n), dtype = np.int)
  max_value[0, 0] = a_array[0]
  max_value[1, 0] = 1
  max_value[0, 1] = a_array[1]
  max_value[1, 1] = 1
  max_value[0, 2] = max((max_value[0,0] + a_array[2]), a_array[2])
  if (max_value[0, 0] + a_array[2]) > a_array[2]:
    max_value[1, 2] = 2
  else:
    max_value[1, 2] = 1 

  for i in range (3, n):
    if (a_array[i] + max_value[0, i-2]) >= (a_array[i] + max_value[0, i-3]):
      if ((i-1) // 2) <= (max_value[1, i-2] + 1) == (i+1) // 2:
        max_value[0, i] = a_array[i] + max_value[0, i-2]
        max_value[1, i] = max_value[1, i-2] + 1
      else:
        max_value[0, i] = a_array[i] + max_value[0, i-3]
        max_value[1, i] = max_value[1, i-3] + 1
    else:
      if ((i-1) //2) <= (max_value[1, i-3] + 1) == (i+1) // 2:        
        max_value[0, i] = a_array[i] + max_value[0, i-3]
        max_value[1, i] = max_value[1, i-3] + 1
      else:
        max_value[0, i] = a_array[i] + max_value[0, i-2]
        max_value[1, i] = max_value[1, i-2] + 1
  # print(max_value)
  # print(max_value[1, -1], max_value[1, -2], max_value[1, -3])
  # print(max_value[0, -1], max_value[0, -2], max_value[0, -3])
  if max_value[1, -1] == n // 2:
    ans_1 = max_value[0, -1]
  else: 
    ans_1 = -9999999999999999
  if max_value[1, -2] == n // 2:
    ans_2 = max_value[0, -2]
  else: 
    ans_1 = -9999999999999999
  if max_value[1, -3] == n // 2:
    ans_3 = max_value[0, -3]
  else: 
    ans_3 = -9999999999999999
  ans = max(max(ans_1, ans_2), ans_3)

print(ans)
Problem p02835 (python)

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

Buggy submission (verdict: Runtime Error):
li = list(map(int,input().split()))
if sum(li) <22:
  print('win')
  else:
    print('bust')
Problem p02836 (python)

Fixed submission:
s=input()
n=len(s)
res = 0
for i in range(n):
  if s[i] != s[n - i - 1]:
    res += 1
print(int(res / 2))

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
les = 0
for i in range(n):
  if s[i] != s[n - i - 1]:
    les++;
print(les / 2)
Problem p02860 (python)

Fixed submission:
import sys

n = int(input())
s = input()
if n == 1:
  print("No")
  sys.exit()
n = n // 2
if s[:n]  == s[n:]:
    print("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
import sys

n = int(input())
s = input()
if n == 1:
  print("No")
  sys.exit()
n = n / 2
if s[:n]  == s[n:]:
    print("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
input(s)
if s == s[n - 1:]:
    print("Yes")
    else
    print ("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
input(s)
if s == s[n - 1:]:
  print("Yes")
else
  print ("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
input(s)
if (s == s[n - 1:])
  print("Yes")
else
  print ("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
input(s)
s1 = [s[i : i + n / 2] for i in range(0, len(s), n / 2)]
if (s == s1)
  print("Yes")
else
  print ("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
input(s)
s1 = [s[i : i + n / 2] for i in range(0, len(s), n / 2)]
if (s1 == s2)
  print("Yes")
else
  print ("No")
Problem p02595 (python)

Fixed submission:
import math

N, D = map(int, input().split())
count = 0
for _ in range(N):
    x, y = map(int, input().split())
    xx = x ** 2
    yy = y ** 2

    ans = math.sqrt(xx + yy)
    if ans <= D:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math

N, D = map(int, input().split())
count = 0
for _ in range(M):
    x, y = map(int, input().split())
    xx = x ** 2
    yy = y ** 2

    ans = math.sqrt(xx + yy)
    if ans >= D:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math

inp = str(input())

N, M = map(int, input().split())
count = 0
for _ in range(M):
    
    for i in inp:
        x, y = map(int, input().split())

        xx = int(x) ** 2
        yy = int(y) ** 2

        ans = math.sqrt(xx + yy)

        if ans >= M:
            count += 1
        j += 1
    print(count)

Buggy submission (verdict: Runtime Error):
import math

inp = str(input())

N, M = map(int, input().split())
count = 0
for _ in range(M):
    
    for i in inp:
        x, y = map(int, input().split())

        xx = int(x) ** 2
        yy = int(y) ** 2

        ans = math.sqrt(xx + yy)
        print(ans)

        if ans >= M:
            count += 1
        j += 1
    print(count)

Buggy submission (verdict: Runtime Error):
import math

inp = str(input())
m = [x.split() for x in inp]

count = 0
j = 0
for i in inp:
    x, y = i.split()
    if j == 0:
        D = int(y)
        print(D)
    else:
        xx = int(x) ** 2
        yy = int(y) ** 2

        ans = math.sqrt(xx + yy)
        print(ans)

        if ans >= int(D):
            count += 1
    j += 1
print(count)

Buggy submission (verdict: Runtime Error):
import math

inp = input()

m = [x.split() for x in inp]

count = 0

for i in inp:
    x, y = i.split()

    xx = x ** 2
    yy = y ** 2

    ans = math.sqrt(xx + yy)

    if ans >= y:
        count += 1

print(count)
Problem p03055 (python)

Fixed submission:
# カンニングして修正
N = int(input())
#各頂点が繋がってる辺リスト
E = [ [] for _ in range(N)]
for i in range(N-1):
    a,b = map(int, input().split())
    E[a-1].append(b-1)
    E[b-1].append(a-1)

# #入力1
# N= 3
# E= [[1], [0, 2], [1]]

# #　入力2
# N= 6
# E= [[1], [0, 2, 3], [1], [1, 5], [5], [3, 4]]

# #　入力3
# N= 7
# E= [[6, 1], [0], [3, 5], [6, 2], [6], [2], [0, 3, 4]]


    
def farthest(s):
    visited = [False]*N
    stack = [[s,0]]
    best = [s,0]
    while len(stack)>0:
#         print("visited:",visited)
#         print("stack:",stack)
        current = stack.pop()#pop(-1)と同じ
        currentPosition = current[0] 
        currentLength = current[1]
        visited[currentPosition] = True
        # bestの更新
        if currentLength > best[1]:
            best = [currentPosition, currentLength]
        visited.append(currentPosition)
        # 繋がっているノードのうち未探索の場所を追加
        for position in E[currentPosition]:
            if not visited[position]:
                stack.append([position, currentLength+1])
    return best

# print("u,length:",farthest(0))
u = farthest(0)[0]
best = farthest(u)
# print(best)
# v = best[0]
diameter = best[1]
# print(diameter)
ans = "First"
if diameter % 3 == 1:
    ans = "Second"
print(ans)

Buggy submission (verdict: Runtime Error):
# カンニングして修正
N = int(input())
各頂点が繋がってる辺リスト
E = [ [] for _ in range(N)]
for i in range(N-1):
    a,b = map(int, input().split())
    E[a-1].append(b-1)
    E[b-1].append(a-1)

# #入力1
# N= 3
# E= [[1], [0, 2], [1]]

# #　入力2
# N= 6
# E= [[1], [0, 2, 3], [1], [1, 5], [5], [3, 4]]

# #　入力3
# N= 7
# E= [[6, 1], [0], [3, 5], [6, 2], [6], [2], [0, 3, 4]]


    
def farthest(s):
    visited = [False]*N
    stack = [[s,0]]
    best = [s,0]
    while len(stack)>0:
#         print("visited:",visited)
#         print("stack:",stack)
        current = stack.pop()#pop(-1)と同じ
        currentPosition = current[0] 
        currentLength = current[1]
        visited[currentPosition] = True
        # bestの更新
        if currentLength > best[1]:
            best = [currentPosition, currentLength]
        visited.append(currentPosition)
        # 繋がっているノードのうち未探索の場所を追加
        for position in E[currentPosition]:
            if not visited[position]:
                stack.append([position, currentLength+1])
    return best

# print("u,length:",farthest(0))
u = farthest(0)[0]
best = farthest(u)
# print(best)
# v = best[0]
diameter = best[1]
# print(diameter)
ans = "First"
if diameter % 3 == 1:
    ans = "Second"
print(ans)
Problem p03127 (python)

Fixed submission:
import numpy as np
 
N=int(input())    
listA = list(map(int,input().split()))
 
minA = min(listA)
 
while True:
   minA = min(listA)
   minApos = np.argmin(listA)
   listA = [x % minA for x in listA]
   listA[minApos] = minA
   listA= [x for x in listA if x >0]
   if len(set(listA))==1:
       print(minA)
       break

Buggy submission (verdict: Runtime Error):
Keita [9:48 PM]
import numpy as np

N=int(input())    
listA = list(map(int,input().split()))

minA = min(listA)

while True:
   minA = min(listA)
   minApos = np.argmin(listA)
   listA = [x % minA for x in listA]
   listA[minApos] = minA
   listA= [x for x in listA if x >0]
   if len(set(listA))==1:
       print(minA)
       break
Problem p02759 (python)

Fixed submission:
N=int(input())

print(N//2+N%2)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
x=[[0 for i in range(3)] for j in range(3)]
N=int(input())
if N>=3:
  for i in range(N):
    b=int(input())
    for j in range(3):
      if A[j]==b:
        x[0][j]=1
      elif B[j]==b:
        x[1][j]=1
      elif C[j]==b:
        x[2][j]=1
  flag=0
  if x[0][0]==1:
    if x[0][1]==1 and x[0][2]==1:
      flag=1
    elif x[1][0]==1 and x[2][0]==1:
      flag=1
    elif x[1][1]==1 and x[2][2]==1:
      flag=1
  if x[1][1]==1:
    if x[0][1]==1 and x[2][1]==1:
      flag=1
    elif x[1][0]==1 and x[2][0]==1:
      flag=1
    elif x[0][2]==1 and x[2][0]==1:
      flag=1
  if x[2][2]==1:
    if x[2][0]==1 and x[2][1]==1:
      flag=1
    elif x[0][2]==1 and x[1][2]==1:
      flag=1
  if flag==1:
    print("Yes")
  else:
    print("No")
  #print(x)
else:
  print("No")
Problem p02863 (python)

Fixed submission:
# -*- coding: utf-8 -*-

N,T=map(int, input().split())
val=[list(map(int, input().split())) for i in range(N)]

#import sys
#input = sys.stdin.readline
#val = list(input()) #abc
#val=np.array(val)
#index=np.argsort(val[:,0])
#A=val[index,0].tolist()
#B=val[index,1].tolist()
val.sort()
A=[v[0] for v in val]
B=[v[1] for v in val]

#temp=np.zeros((T+1,N))
#Ts=T*np.ones(N-1)
#jun=np.arange(1,N)
#for itemp in range(T):
#    i=itemp
#    if i>=A[0]:
#        temp[i,0]=B[0]
#    if i>0:
#        temp[i,:]=np.amax([temp[i,:],temp[i-1,:]],0)
#    for jtemp in range(N-1):
#        j=jtemp+1
#        temp[i,j]=max(temp[i,j],temp[i,j-1])
#    jnext=np.amin([Ts,i+A[1:]],0)
#    jnext=[int(s) for s in jnext]
#    temp[jnext,jun]=np.amax([temp[i,:-1]+B[1:],temp[jnext,jun]],0)

temp=[[0]*N for i in range(T+1)]

for itemp in range(T):
    i=itemp
    if i>=A[0]:
        temp[i][0]=B[0]
    for jtemp in range(N-1):
        j=jtemp+1
        jbfo=temp[i][j-1]
        ijnow=temp[i][j]
        
        if i>0:
            temp[i][j]=max(ijnow,temp[i-1][j])
            
        temp[i][j]=max(ijnow,jbfo)
        if A[j]<T-i:
            temp[i+A[j]][j]=max(jbfo+B[j],temp[i+A[j]][j])
        else:
            temp[T][j]=max(jbfo+B[j],temp[T][j])
print(int(max(temp[-1][:])))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import numpy as np

N,T=map(int, input().split())
val=[list(map(int, input().split())) for i in range(N)]

#import sys
#input = sys.stdin.readline
#val = list(input()) #abc
#val=np.array(val)
#index=np.argsort(val[:,0])
#A=val[index,0].tolist()
#B=val[index,1].tolist()
val.sort()
A=[v[0] for v in val]
B=[v[1] for v in val]

#temp=np.zeros((T+1,N))
#Ts=T*np.ones(N-1)
#jun=np.arange(1,N)
#for itemp in range(T):
#    i=itemp
#    if i>=A[0]:
#        temp[i,0]=B[0]
#    if i>0:
#        temp[i,:]=np.amax([temp[i,:],temp[i-1,:]],0)
#    for jtemp in range(N-1):
#        j=jtemp+1
#        temp[i,j]=max(temp[i,j],temp[i,j-1])
#    jnext=np.amin([Ts,i+A[1:]],0)
#    jnext=[int(s) for s in jnext]
#    temp[jnext,jun]=np.amax([temp[i,:-1]+B[1:],temp[jnext,jun]],0)

temp=[[0]*N for i in range(T+1)]

for itemp in range(T):
    i=itemp
    if i>=A[0]:
        temp[i][0]=B[0]
    for jtemp in range(N-1):
        j=jtemp+1
        jbfo=temp[i][j-1]
        ijnow=temp[i][j]
        
        if i>0:
            temp[i][j]=max(ijnow,temp[i-1][j])
            
        temp[i][j]=max(ijnow,jbfo)
        if A[j]<T-i:
            temp[i+A[j]][j]=max(jbfo+B[j],temp[i+A[j]][j])
        else:
            temp[T][j]=max(jbfo+B[j],temp[T][j])
print(int(max(temp[-1][:])))
Problem p02773 (python)

Fixed submission:
N = int(input())
S = {}

for i in range(N):
    arg = input()
    if (arg in S):
        S[arg] = S[arg] + 1
    else:
        S[arg] = 1
valSorted = sorted(S.items(), key=lambda x:(-x[1], x[0]))
breakKey = -1
for key, value in valSorted:
    if breakKey == -1:
        breakKey = value
    if breakKey != value:
        break
    print(str(key))

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

for i in range(N):
    arg = input()
    if (arg in S):
        S[arg] = S[arg] + 1
    else:
        S[arg] = 1
# valSorted = sorted(S.items(), key=lambda x:(-x[1], x[0]))
breakKey = None
for key, value in valSorted:
    if breakKey is None:
        breakKey = value
    if breakKey != value:
        break
    print(str(key))

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

for i in range(N):
    arg = input()
    if (arg in S):
        S[arg] = S[arg] + 1
    else:
        S[arg] = 1
valSorted = sorted(S.items(), key=lambda x:(-x[1], x[0]))
breakKey = None
for key, value in valSorted:
    if breakKey is None:
        breakKey = value
    if breakKey != value:
        break
    print(str(key)
Problem p02597 (python)

Fixed submission:
def main():
  n = int(input())
  li = list(input())
  i = 0
  j = n-1
  ans = 0
  while(i < j):
    while(li[i] == "R" and i < j):
      i += 1
    while(li[j] == "W" and i < j):
      j -= 1
    if li[i] == "W" and li[j] == "R":
      li[i] = "R"
      li[j] = "W"
      ans += 1
  print(ans)    

if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  n = int(input())
  li = list(input())
  i = 0
  j = n-1
  ans = 0
  while(i < j):
    while(li[i] == "R" and i < j):
      i += 1
    while(li[j] == "W" and i < j):
      j -= 1
    if li[i] = "W" and li[j] = "R":
      li[i] = "R"
      li[j] = "W"
      ans += 1
  print(ans)    

if __name__ == '__main__':
  main()
Problem p02659 (python)

Fixed submission:
import math

def main():
  a, b = input().split()
  a = int(a)
  b = b[0] + b[2]+ b[3]
  c = int(b)
  ans = a * c // 100
  ans = math.floor(ans)
  print(ans)
 
 
if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
import math
import decimal

def main():
  a, b = input().split()
  a = int(a)
  b = decimal(b)
  c = int(b)
  d = (b - c) * 100
  ans_a = a * c
  ans_b = (a * d) // 100
  ans = math.floor(ans_b) + ans_a
  print(ans)
 
 
if __name__ == '__main__':
  main()
Problem p02879 (python)

Fixed submission:
x, y  = map(int,input().split())

if x < 10 and y < 10:
  print(x * y)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
x = int(input())
count = 0
 
for i in range(2,10):
  if x % i == 0 and (x // i) <= 9:
    print("Yes")
    exit()
  else:
    count += 1
 
if count == 8:
  print("No")
Problem p02594 (python)

Fixed submission:
temp = int(input())

if temp >= 30:
    print('Yes')
else:
    print('No')

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

if temp >= 30:
    print('Yes')
else:3
    print('No')
Problem p02595 (python)

Fixed submission:
import math 

nd = input().split()
nd = [int(x) for x in nd]
n=nd[0]
d=nd[1]

x_list =[]
y_list =[]

# n = 4
# d = 5

# x_list =[0,-2,3,4]
# y_list =[5,4,4,-4]



def count(x_list,y_list,d,n):
    cnt =0
    for i in range(n):
        # print(math.sqrt(x_list[i]**2 +y_list[i]**2),d)
        if math.sqrt(x_list[i]**2 +y_list[i]**2) <=d:
            cnt +=1
        
    return cnt


for i in range(n):
    xy = input().split()
    xy = [int(k) for k in xy]
    x_list.append(xy[0])
    y_list.append(xy[1])

print(count(x_list,y_list,d,n))

Buggy submission (verdict: Runtime Error):
import math 

nd = input().split()
nd = [int(x) for x in nd]
n=nd[0]
d=nd[1]

x_list =[]
y_list =[]

n = 4
d = 5

x_list =[0,-2,3,4]
y_list =[5,4,4,-4]



def count(x_list,y_list,d,n):
    cnt =0
    for i in range(n):
        # print(math.sqrt(x_list[i]**2 +y_list[i]**2),d)
        if math.sqrt(x_list[i]**2 +y_list[i]**2) <=d:
            cnt +=1
        
    return cnt


for i in range(n):
    xy = input().split()
    xy = [int(k) for k in xy]
    x_list.append(xy[0])
    y_list.append(xy[1])

print(count(x_list,y_list,d,n))
Problem p02707 (python)

Fixed submission:
n  = int(input())
a = input().split()
a = [int(x) for x in a]
ar = [0]*n

for i in range(n-1):
    ar[a[i]] += 1

tmp = ar.pop(0)
ar.append(tmp)
for i in range(n):
    print(ar[i])

Buggy submission (verdict: Runtime Error):
ar = [0]*n

for i in range(n-1):
    ar[a[i]] += 1

tmp = ar.pop(0)
ar.append(tmp)
for i in range(n):
    print(ar[i])
Problem p02773 (python)

Fixed submission:
import sys
input_first = input()
N= int(input_first)

worddic={}

for i in range(N):
    S = input()
    if S in worddic:
        worddic[S] +=1
    else:
        worddic[S] =1

# result=[keyval[0] for keyval in worddic.items() if keyval[1]==max(worddic.values())]

maxval = 0
for i in worddic.items():
    if i[1] > maxval :
        maxval = i[1]
        result=[]
        result.append(i[0])
    elif i[1] == maxval:
        result.append(i[0])
    else:
        pass

result.sort()
for i in result:
    print(i)

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

wordl = []
timesl = []

for i in range(N):
    S = input()
    wordl.append(S)

maxnum = 1
tmp=1
resultl  =[]
for i in  range(N-1):
    if wordl[i] == wordl[i+1]:
        tmp +=1
    else:
        if maxval == tmp:
            resultl.append(wordl[i])
        elif maxval<tmp:
            resultl = []
            resultl.append(wordl[i])
            maxval = tmp
        else:
            pass
        tmp = 1


resultl.sort()

print(resultl)
Problem p02723 (python)

Fixed submission:
a = input()
 
if a[2] == a[3] and a[4] == a[5]:
  print('Yes')
else:
  print('No')

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

if a[2] == a[3] and a[4] == a[5]:
  print('Yes')
else:
  print((No')
Problem p02773 (python)

Fixed submission:
import collections

n = int(input())

res = []

for _ in range(n):
  res.append(input())

c = collections.Counter(res)
aa = c.most_common()

ss = aa[0][1]
res2 = []

aa.sort()
for i in aa:
  if i[1] == ss:
    res2.append(i[0])

for i in res2:
  print(i)

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
c.sort()
values, counts = zip(*c.most_common())
if len(values) == 1:
    print(values[0])
else:
    for i in range(N):
        if counts[i] == counts[0]:
            print(values[i])
        else:
            exit()

Buggy submission (verdict: Runtime Error):
import collections
import sys

N = int(input())
S = [input() for _ in range(N)]
S.sort()
c = collections.Counter(S)
values, counts = zip(c.most_common())
if len(values) == 1:
    print(values[0])
else:
    for i in range(N):
        if counts[i] == counts[0]:
            print(values[i])
        else:
            sys.exit()