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

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

N, M = map(int, input().split())
a=[]
for _ in range(M):
    a.append(int(input()))

lst=[None]*(N+1)
def func(n):
    #if n in a:
    #    return 0
    if n<=1:
        return 1
    else:
        if lst[n]:
            return lst[n]
        else:
            temp=(func(n-1)+func(n-2))%(10**9+7)
            lst[n]=temp
            return temp



a=[-1]+a+[N+1]
answer=1
for i in range(M+1):
    if a[i+1]-a[i]==1:
        print(0)
        break
    answer=( func(a[i+1]-a[i]-2)*answer )%(10**9+7)
else:
    print(answer)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a=[]
for _ in range(M):
    a.append(int(input()))

lst=[0]*(N+1)
def func(n):
    if n in a:
        return 0
    if n<=1:
        return 1
    else:
        if lst[n]:
            return lst[n]
        else:
            temp=(func(n-1)+func(n-2))%(10**9+7)
            lst[n]=temp
            return temp

print(func(N))

Buggy submission (verdict: Runtime Error):
def func(n):
    if n>=3:
        return (func(n-1)+func(n-2))%(10**9+7)
    elif n==2:
        return 2
    else:
        return 1

N, M = map(int, input().split())
if M:
    a=[]
    for _ in range(M):
        a.append(int(input()))

    a=[-1]+a+[N+1]
    answer=1
    for i in range(M+1):
        if a[i+1]-a[i]==1:
            print(0)
            break
        answer=( func(a[i+1]-a[i]-2)*answer )%(10**9+7)
    else:
        print(answer)

else:
    print(func(N))

Buggy submission (verdict: Runtime Error):
def func(n):
    if n>=3:
        return (func(n-1)%(10**9+7)+func(n-2)%(10**9+7))%(10**9+7)
    elif n==2:
        return 2
    else:
        return 1

N, M = map(int, input().split())
if M:
    a=[]
    for _ in range(M):
        a.append(int(input()))



    a=[-1]+a+[N+1]
    answer=1
    for i in range(M+1):
        if a[i+1]-a[i]==1:
            print(0)
            break
        answer=( func(a[i+1]-a[i]-2)*answer )%(10**9+7)
    else:
        print(answer)

else:
    print(func(N))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a=[]
for _ in range(M):
    a.append(int(input()))

def func(n):
    if n>=3:
        return (func(n-1)%(10**9+7)+func(n-2)%(10**9+7))%(10**9+7)
    elif n==2:
        return 2
    else:
        return 1

a=[-1]+a+[N+1]
answer=1
for i in range(M+1):
    if a[i+1]-a[i]==1:
        print(0)
        break
    answer=( func(a[i+1]-a[i]-2)*answer )%(10**9+7)
else:
    print(answer)
Problem p03038 (python)

Fixed submission:
import copy

N, M=map(int, input().split())
A=list(map(int, input().split()))
BC=[]
for _ in range(M):
    BC.append(tuple(map(int, input().split())))
A=sorted(A)
BC=sorted(BC, key=lambda val:val[1], reverse=True)
#print(N,M,A,BC)


change=[]
for bc in BC:
    for _ in range(bc[0]):
        change.append(bc[1])
    if len(change)>=N:
        break
#print(change)

if A[0]>=change[0]:
    print(sum(A))
else:
    for i in range(min(N,len(change))):
        if A[i]>change[i]:
            answer = sum(change[:i]) + sum(A[i:])
            print(answer)
            break
    else:
        answer=sum(change[:i+1])+sum(A[i+1:])
        print(answer)

Buggy submission (verdict: Runtime Error):
import copy

N, M=map(int, input().split())
A=list(map(int, input().split()))
BC=[]
for _ in range(M):
    BC.append(tuple(map(int, input().split())))
A=sorted(A)
BC=sorted(BC, key=lambda val:val[1], reverse=True)
#print(N,M,A,BC)


change=[]
for bc in BC:
    for _ in range(bc[0]):
        change.append(bc[1])
    if len(change)>=N:
        break
#print(change)

if A[0]>=change[0]:
    print(sum(A))
else:
    for i in range(len(change)):
        if A[i]>change[i]:
            answer = sum(change[:i]) + sum(A[i:])
            print(answer)
            break
    else:
        answer=sum(change[:i+1])+sum(A[i+1:])
        print(answer)

Buggy submission (verdict: Runtime Error):
import copy

N, M=map(int, input().split())
A=list(map(int, input().split()))
BC=[]
for _ in range(M):
    BC.append(tuple(map(int, input().split())))
A=sorted(A)
BC=sorted(BC, key=lambda val:val[1], reverse=True)
#print(N,M,A,BC)


change=[]
for bc in BC:
    for _ in range(bc[0]):
        change.append(bc[1])
    if len(change)>=N:
        break
#print(change)


for i in range(len(change)):
    if A[i]>change[i]:
        answer = sum(change[:i]) + sum(A[i:])
        print(answer)
        break
else:
    answer=sum(change[:i+1])+sum(A[i+1:])
    print(answer)

Buggy submission (verdict: Runtime Error):
N, M=map(int, input().split())
A=list(map(int, input().split()))
BC=[]
for _ in range(M):
    BC.append(tuple(map(int, input().split())))
A=sorted(A)
BC=sorted(BC, key=lambda val:val[1], reverse=True)
#print(N,M,A,BC)


change=[]
for bc in BC:
    for _ in range(bc[0]):
        change.append(bc[1])
#print(change)

for i in range(len(change)):
    if A[i]>change[i]:
        answer = sum(change[:i]) + sum(A[i:])
        print(answer)
        break
else:
    answer=sum(change[:i+1])+sum(A[i+1:])
    print(answer)

Buggy submission (verdict: Runtime Error):
N, M=map(int, input().split())
A=list(map(int, input().split()))
BC=[]
for _ in range(M):
    BC.append(tuple(map(int, input().split())))
A=sorted(A)
BC=sorted(BC, key=lambda val:val[1], reverse=True)
print(N,M,A,BC)


change=[]
for bc in BC:
    for _ in range(bc[0]):
        change.append(bc[1])
print(change)

for i in range(len(change)):
    if A[i]>change[i]:
        answer = sum(change[:i]) + sum(A[i:])
        print(answer)
        break
else:
    answer=sum(change[:i+1])+sum(A[i+1:])
    print(answer)
Problem p03634 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)


N = int(input())
abc=[]
for _ in range(N-1):
    abc.append(tuple(map(int, input().split())))
Q, K = map(int, input().split())
xy=[]
for _ in range(Q):
    xy.append(tuple(map(int, input().split())))
#print(abc)
#print(xy)

G = [[] for _ in range(N+1)]
for el in abc:
    a,b,c = el
    G[a].append((b,c))
    G[b].append((a,c))
#print(G)

seen=[False]*(N+1)
distance=[0]*(N+1)
def dfs(n):
    seen[n]=True
    for el in G[n]:
        if seen[el[0]] == False:
            distance[el[0]] = distance[n] + el[1]
            dfs(el[0])
dfs(K)
#print(distance)

for q in xy:
    print(distance[q[0]]+distance[q[1]])

Buggy submission (verdict: Runtime Error):
N = int(input())
abc=[]
for _ in range(N-1):
    abc.append(tuple(map(int, input().split())))
Q, K = map(int, input().split())
xy=[]
for _ in range(Q):
    xy.append(tuple(map(int, input().split())))
#print(abc)
#print(xy)

G = [[] for _ in range(N+1)]
for el in abc:
    a,b,c = el
    G[a].append((b,c))
    G[b].append((a,c))
#print(G)

seen=[False]*(N+1)
distance=[0]*(N+1)
def dfs(n):
    seen[n]=True
    for el in G[n]:
        if seen[el[0]] == False:
            distance[el[0]] = distance[n] + el[1]
            dfs(el[0])
dfs(K)
#print(distance)

for q in xy:
    print(distance[q[0]]+distance[q[1]])
Problem p03745 (python)

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

if N == 1:
    print(1)
elif N == 2:
    print(1)
else:
    A = [B[0]]
    cnt = 0
    for i in range(N - 1):
        if B[i] == B[i + 1]:
            pass
        else:
            A.append(B[i+1])

    i = 1
    ans = 1
    n = len(A)
    while i < n - 1:
        if A[i-1] < A[i] < A[i+1] or A[i-1] > A[i] > A[i+1]:
            pass
        else:
            i += 1
            ans += 1
        i += 1
    print(ans)

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


cnt = 0
for i in range(N - 1):
    if A[i] == A[i + 1]:
        A[i] = '#'
        cnt += 1

for _ in range(cnt):
    A.remove('#')
#print(A)

if A[0] < A[1]:
    plus = 1
else:
    plus = -1

i = 1
ans = 1
while i < len(A) - 1:
    if A[i-1] < A[i] < A[i+1] or A[i-1] > A[i] > A[i+1]:
        pass
    else:
        i += 1
        ans += 1
    i += 1
print(ans)

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


cnt = 0
for i in range(N - 1):
    if A[i] == A[i + 1]:
        A[i] = '#'
        cnt += 1

for _ in range(cnt):
    A.remove('#')
print(A)

if A[0] < A[1]:
    plus = 1
else:
    plus = -1

i = 1
ans = 1
while i < len(A) - 1:
    if A[i-1] < A[i] < A[i+1] or A[i-1] > A[i] > A[i+1]:
        pass
    else:
        i += 1
        ans += 1
    i += 1
print(ans)
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
if S <= W:
  print('unsafe')
else:
  print('safe')

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

count = 0

for i in len(S):
    for j in range(i, len(S)):
        if int(S[i:j]) % 2019 == 0:
            count += 1
      
      
print(count)
Problem p02707 (python)

Fixed submission:
import collections
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))
c = collections.Counter(A)
buka_num = []

for i in range(1,N):
    buka_num.append(c[i])
    
buka_num.append(0)
for ele in buka_num:
    print(ele)

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

buka_num = []

for i in range(1,N):
    #tmp_A = A[i:]
    buka_num.append(tmp_A.count(i))
    
buka_num.append(0)
for ele in buka_num:
    print(ele)

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

buka_num = []

for i in range(1, N):　＃tmp_A = A[i:]
 buka_num.append(tmp_A.count(i))

buka_num.append(0)

print(buka_num, sep='¥n')

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

buka_num = []

for i in range(1, N):
  tmp_A = A[i:]
	buka_num.append(tmp_A.count(i))

buka_num.append(0)

print(buka_num, sep='¥n')

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

buka_num = [0]

for i in range(1, N):
  tmp_A = A[i:]
	buka_num.append(tmp_A.count(i))

buka_num.append(0)

print(buka_num, sep='¥n')

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

buka_num = [0]

for i in range(1, N+1):
  tmp_A = A[i:]
	buka_num.append(tmp_A.count(i))

print(buka_num, sep='¥n')
Problem p03013 (python)

Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for __ in range(M)])
ans=[0]*(N+1)
ans[0] = 1

if 1 in A:
    ans[1]=0
else:
    ans[1]=1

for n in range(N+1):
    if n>1:
        if n-1 in A and n in A:
            print(0)
            break
        elif n in A:
            ans[n]=0
        else:
            ans[n]=(ans[n-1]+ans[n-2]) % 1000000007
else:
    print(ans[N])

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[int(input()) for __ in range(M)]
ans=[0]*N

if 0 in A:
    ans[1]=1
elif 1 in A:
    ans[0]=1
else:
    ans[0]=1
    ans[1]=2

for n in range(N):
    if n>1:
        if n+1 in A and n in A:
            print(0)
            break
        elif n+1 in A:
            ans[n]=0
        else:
            ans[n]=ans[n-1]+ans[n-2]
            ans[n] %= 1000000007
else:
    print(ans[N-1])

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[int(input()) for __ in range(M)]
ans=[0]*N

if 1 in A:
    ans[0]=0
    ans[1]=1
else:
    ans[0]=1
    ans[1]=2

for n in range(N):
    if n>1:
        if n+1 in A and n in A:
            print(0)
            break
        elif n+1 in A:
            ans[n]=0
        else:
            ans[n]=ans[n-1]+ans[n-2]
            ans[n] %= 1000000007
else:
    print(ans[N-1])

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[int(input()) for __ in range(M)]
ans=[0]*N

if 1 in A:
    ans[0]=0
    ans[1]=1
else:
    ans[0]=1
    ans[1]=2

for n in range(N):
    if n>1:
        if n+1 in A and n in A:
            print(0)
            break
        elif n+1 in A:
            ans[n]=0
        else:
            ans[n]=ans[n-1]+ans[n-2]
            ans[n] %= 10**9+7
else:
    print(ans[N-1])
Problem p02682 (python)

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

Buggy submission (verdict: Runtime Error):
Copy
a,b,c,k = map(int,input().split())
 
ans = 0
 
if k <= a:
  ans = a
  print(ans)
elif a< k <= a+b:
  ans = a
  print(ans)
else:
  ans = a-(K-a-b)
  if ans < 0:
    ans = 0
  print(ans)
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):
  #頂点1が始点
  if i[0] == 0:
    #生成した順列の中をさらにループ
    for j in range(n):
      # n-1まで続いたら条件を満たすパスが存在する
      if j == n-1:
        ans += 1
        break
      #i[j]からi[j+1]に行くパスがなければ終了
      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 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):
  #頂点1が始点
  if i[0] == 0:
    #生成した順列の中をさらにループ
    for j in range(n):
      # n-1まで続いたら条件を満たすパスが存在する
      if j == n-1:
        ans += 1
        break
      #i[j]からi[j+1]に行くパスがなければ終了
      if not path[i[j][j+1]]:
        break
        
print(ans)
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
 
pre = 0
ans = 0
 
for h in H:
  if h >= pre:
    pre = h
    ans += 1
print(ans)

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

pre = 0
ans = 0

for h in H:
  if h >= pre:
    pre = h
    ans += 1
print(ans)
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):
import collections
import numpy as np
import sys
sys.setrecursionlimit(10**8)
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)))


#N=int(input())

# h=np.array(list(map(int,input().split())))
# ans=0
# def sol(l,m,k):
#     global ans
#     if m==0:
#         return ans
#     elif m>0:
#         for i in range(N-m+1):
#             if not 0 in l[i:i+m]:
#                 ans+=np.amin(l[i:i+m])
#                 l[i:i+m]=l[i:i+m]-min(l[i:i+m])
#                 print(l)
#         sol(l,m-1,ans)
#     # else:
#     #     ans+=np.count_nonzero(h)
#     #     sol(l, m - 1, ans)
# n=0
# sol(h,N,ans)
# print(ans)
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(2*A + B - K)

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

if K <= A:
    print(K)

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

else:
  print(A+B-c)
Problem p02725 (python)

Fixed submission:
import numpy as np
K, N = map(int, input().split())
x_list = list(map(int, input().split()))

sub_x_list = x_list.copy()[1:]
sub_x_list.append(K + x_list[0])

for i in range(N):
    sub_x_list[i] -= x_list[i]
    
max_i = max(sub_x_list)
print(K - max_i)

Buggy submission (verdict: Runtime Error):
K, N = map(int, input().split())
x1 = list(map(int,input().split()))
x2 = np.array(x1, dtype=np.int64)

x2 = np.sort(x2)
sum = 0

for i in range(N-1):
    sum += x2[1] - x2[0]
    
print(sum)
Problem p02831 (python)

Fixed submission:

def gcd(a,b):
    ma = max(a,b)
    mi = min(a,b)
    while(True):
        los = ma % mi
        ma = mi
        mi = los
        if los == 0:
            result = ma
            break
    return result

a,b = map(int,input().split())
print(a*b//gcd(a,b))

Buggy submission (verdict: Runtime Error):
import numpy
a,b = map(int,input().split())
ab = numpy.gcd(a,b)
print(int(a*b//ab))

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

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

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

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

Fixed submission:
import math
def inv(a,mod=10**9+7):
    return(pow(a,mod-2,mod))

x,y = map(int,input().split())
mod = 10**9+7
reuslt = 0
if (x+y) %3 == 0:

    n = (2*x-y)//3
    m = (2*y-x)//3
    r = min(n,m)
    result = 1
    if n < 0 or m < 0:
        print(0)
        exit()
    for i in range(r):
        result = result*(n+m-i)*inv(i+1,mod)%mod
    
else :
    result = 0

print(result)

Buggy submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
mod = 10**9+7
reuslt = 0
if (x+y) %3 == 0:

    n = (2*x-y)//3
    m = (2*y-x)//3
    result  =math.factorial(n+m)//math.factorial(n)
    result = result%mod
else :
    result = 0

print(result)

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

dp = [[0]*(x*2+1) for _ in range(x+1)]
dp[2][2] = 0
start = 0
end = 0

for i in range(1,x+1):
    if i%2 == 0:
        start = i//2
        dp[i][start] = 1
    else :
        start = int(math.ceil(i/2+1))
        
    end = i*2
    dp[i][end] = 1
    
    for j in range(start,end+1,3):
        if dp[i][j] == 0:
            dp[i][j] += dp[i-1][j-2] + dp[i-2][j-1]


print(dp[x][y])
Problem p02699 (python)

Fixed submission:
def main():
    sw = list(map(int, input().split()))
    print('unsafe' if sw[0] <= sw[1] else 'safe')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    c = 0
    for i in range(len(s)-3):
        for j in range(i+3, len(s)):
            if int(s[i:j+1]) % 2019 == 0:
                c += 1

    print(c)

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

Fixed submission:
from sys import stdin
import numpy as np

def main(args):
    r = int(args[0])
    d = int(args[1])
    x = int(args[2])
    ar = np.zeros([10], dtype=int)

    ar[0] = r*x-d
    for i in range(1,len(ar)):
        ar[i] = r*ar[i-1]-d

    for i in ar:
        print(i)

if __name__ == "__main__":
    main(stdin.readline().rstrip().split())

Buggy submission (verdict: Runtime Error):
from sys import stdin
import numpt as np

def main(args):
    r = args[0]
    d = args[1]
    x = args[2]
    ar = np.zeros([10])

    ar[0] = r*x-d
    for i in range(1,len(ar)):
        ar[i] = r*ar[i-1]-d

    for i in ar:
        print(i)

if __name__ == "__main__":
    main([int(x) for x in stdin.readline().rstrip().split()])
Problem p02897 (python)

Fixed submission:
import numpy as np
import math

N = float(input())

p = math.ceil(N/2)/N

print(p)

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

# input

r, D, x = [int(_) for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = round(Linear_Recursive(x, r, D, i+1))
    
    print(xans[i])
Problem p03036 (python)

Fixed submission:
import numpy as np
import math

# input

r, D, x = [int(_) for _ in input().split()]

xans = x


for i in range(10):
    xans = r*xans - D
    
    print(xans)

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

# input

r, D, x = [int(_) for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = Linear_Recursive(x, r, D, i+1)
    
    pritnt(x[i])

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

# input

r, D, x = [float(_) for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = Linear_Recursive(x, r, D, 10)
    
    pritnt(x[i])

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

# input

r, D, x = [float() for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = Linear_Recursive(x, r, D, 10)
    
    pritnt(x[i])
Problem p03803 (python)

Fixed submission:
import numpy as np
    
strong_order = np.array([14,2,3,4,5,6,7,8,9,10,11,12,13])

A,B = [int(i)-1 for i in input().split()]

if strong_order[A] > strong_order[B]:
    print("Alice")
elif strong_order[A] < strong_order[B]:
    print("Bob")
else:
    print("Draw")

Buggy submission (verdict: Runtime Error):
import numpy as np
    
strong_order = np.array([14,2,3,4,5,6,7,8,9,10.11,12,13])

A,B = [int(i)-1 for i in input().split()]

if strong_order[A] > strong_order[B]:
    print("Alice")
elif strong_order[A] < strong_order[B]:
    print("Bob")
else:
    print("Draw")
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
S = input()
Q = int(input())
querys = [list(map(str, input().split())) for i in range(Q)]
for i in range(Q):
    query = querys[i]
    if query[0] == "1":
        qi = int(query[1])
        S = S[:qi-1] + query[2] + S[qi:]
    else:
        c = collections.Counter(S[int(query[1]) - 1:int(query[2])])
        print(len(c))

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

if N%2 == 1:
  print(int(N/2)+1)
else:
  print(N/2)

Buggy submission (verdict: Runtime Error):
N = input()
x = int(N/2)
print(x)
Problem p02779 (python)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
A.sort()
for i in range(1, len(A)):
    if A[i - 1] != A[i]:
        k = True
    else:
        k = False
        break

if k:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
A.sort()
for i in range(1, len(A)):
    if A[i - 1] != A[i]:
        continue
        k = True
    else:
        k = False
        break

if k:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
A.sort()
for i in range(1,len(A)):
    if A[i - 1] != A[i]:
        continue
        k = True
    else:
        k = False
        break

if k:
    print("Yes")
else:
    print("No")
Problem p02831 (python)

Fixed submission:
import fractions
x, y = (int(x) for x in input().split())

print(int((x * y) / fractions.gcd(x, y)))

Buggy submission (verdict: Runtime Error):
import math
x, y = (int(x) for x in input().split())

print((x * y) / math.gcd(x, y))

Buggy submission (verdict: Runtime Error):
import math
x, y = (int(x) for x in input().split())

print((x * y) // math.gcd(x, y))

Buggy submission (verdict: Runtime Error):
import math
x, y = (int(x) for x in input().split())

print((x * y) // math.gcd(x, y))

Buggy submission (verdict: Runtime Error):
import math
A, B = (int(x) for x in input().split())


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


print(lcm(A, B))