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

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

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if a-k >= 0 or a+b-k>=0: print(a)
else :print((k-a-b)*(-1)+a)a, b, c, k = map(int, input().split())
SUM = 0
if k <= a:
    print(k)
else :
    SUM+=a
    k-=a
    k-=b
    if k <= 0:
        print(SUM)
    else :
        SUM-=k
        print(SUM)
Problem p02859 (python)

Fixed submission:
n=int(input())
print(n**2)

Buggy submission (verdict: Runtime Error):
n=input()
print(n**2)
Problem p02879 (python)

Fixed submission:
A,B = map(int,input().split())
if 1<=A<=9 and 1<=B<=9:
  print(A*B)
else:print(-1)

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(float,input().split())

c = a/(2*b-2*x/a**2)
d = (2*x)/(a*b**2)
if x/a >= a*b/2:
  result = math.atan(c)
else:result = math.degrees(math.atan(d))
print(result)

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(float,input().split())

c = a/(2*b-(2*x)/(a*a))
d = (2*x)/(a*b*b)
if x/a >= a*b/2:
  result = math.atan(c)
else:
  result = math.degrees(math.atan(d))
print(result)
Problem p02682 (python)

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

if A>=K:print(K)
elif A+B>=K:print(A)
else: print(A-(K-(B+A)))

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
A=[1]*A
B=[0]*B
C=[-1]*C
D=A+B+C
print(sum(D[:K]))
Problem p02693 (python)

Fixed submission:
def Sol(n,a,b):
    
    m = b%n
    if b-m >= a:
        print("OK")
    else:
        print("NG")
    
    return

    
n = int(input())

#for t in range(int(input())):
a,b = map(int,input().split())
#    arr = []
#    for i in range(c):
#        arr.append(list(map(int,input().split())))
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,a,b)

Buggy submission (verdict: Runtime Error):
def Sol(n,a,b):
    
    if n == 1:
        print("OK")
        return
    if n == 0:
    	print("NG")
        return
    m = a%n
    if b-m >= a:
        print("OK")
    else:
        print("NG")
    
    return

    
n = int(input())

#for t in range(int(input())):
a,b = map(int,input().split())
#    arr = []
#    for i in range(c):
#        arr.append(list(map(int,input().split())))
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,a,b)
Problem p02699 (python)

Fixed submission:

def Sol(s,w):
    
    if s>w:
        print("safe")
    else:
        print("unsafe")
    
    return

    

#for t in range(int(input())):
n,k = map(int,input().split())
#n = int(input())
#arr = []
#for i in range(n):
#    time = list(map(int,input().split()))
#    time = time[0] + (time[1]/60)
#    arr.append(time)
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,k)

Buggy submission (verdict: Runtime Error):
def Sol(taka_health,taka_stregnth,aoki_health,aoki_stregnth):
    
    if taka_health%aoki_stregnth != 0:
        moves_taka = int(taka_health/aoki_stregnth) + 1
    else:
        moves_taka = int(taka_health/aoki_stregnth)
    
    if aoki_health%taka_stregnth != 0:
        moves_aoki =int(aoki_health/taka_stregnth) + 1
    else:
        moves_aoki = int(aoki_health/taka_stregnth)
    
    print(moves_aoki,moves_taka)
    if moves_taka > moves_aoki:
        print("Yes")
    else:
        print("No")
    return

    

#for t in range(int(input())):
n,k,d,c = map(int,input().split())
#n = int(input())
#arr = []
#for i in range(n):
#    time = list(map(int,input().split()))
#    time = time[0] + (time[1]/60)
#    arr.append(time)
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,k,d,c)

Buggy submission (verdict: Runtime Error):
def Sol(taka_health,taka_stregnth,aoki_health,aoki_stregnth):
    
    if taka_health%aoki_stregnth != 0:
        moves_taka = int(taka_health/aoki_stregnth) + 1
    else:
        moves_taka = int(taka_health/aoki_stregnth)
    
    if aoki_health%taka_stregnth != 0:
        moves_aoki =int(aoki_health/taka_stregnth) + 1
    else:
        moves_aoki = int(taka_health/aoki_stregnth)
    
    print(moves_aoki,moves_taka)
    if moves_taka > moves_aoki:
        print("Yes")
    else:
        print("No")
    return

    

#for t in range(int(input())):
n,k,d,c = map(int,input().split())
#n = int(input())
#arr = []
#for i in range(n):
#    time = list(map(int,input().split()))
#    time = time[0] + (time[1]/60)
#    arr.append(time)
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,k,d,c)

Buggy submission (verdict: Runtime Error):
def Sol(a,b,c,d):
    
    if a%d != 0:
        m_aoki = int(a/d) + 1
    else:
        m_aoki = int(a/d)

    if c%b != 0:
        m_taka = int(c/b) + 1
    else:
        m_taka = int(c/b)
        
    if m_taka >= m_aoki:
        print("YES")
    else:
        print("NO")

    return

    

#for t in range(int(input())):
n,k,c,d = map(int,input().split())
#n = int(input())
#arr = []
#for i in range(n):
#    arr.append(input())
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,k,c,d)
Problem p02831 (python)

Fixed submission:
def q3():
    def lcm(x, y):
        """ xとyの最小公倍数を求める """
        # import math
        import fractions
        return (x * y) // fractions.gcd(x, y)

    A, B = (int(i) for i in input().split())
    print(lcm(A, B))


if __name__ == '__main__':
    q3()

Buggy submission (verdict: Runtime Error):
def q3():
    def lcm(x, y):
        """ xとyの最小公倍数を求める """
        import math
        return (x * y) // math.gcd(x, y)

    A, B = (int(i) for i in input().split())
    print(lcm(A, B))


if __name__ == '__main__':
    q3()
Problem p02987 (python)

Fixed submission:
s = list(raw_input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
	print "Yes"
else:
	print "No"

Buggy submission (verdict: Runtime Error):
facts = [1]
mod =  10**9 + 7
for i in range(1, 2010):
	facts.append((i*facts[-1])%mod)
modinv = []
for i in facts:
	modinv.append(pow(i, mod - 2, mod))

def choose(p, r):
	return (((facts[p]*modinv[r])%mod)*modinv[p-r])%mod

n, k = map(int, raw_input().split())
blue = k
red = n - k
for i in range(1, k+1):
	if i <= n - k + 1:
		print (choose(red + 1, i)*choose(k - 1, i - 1))%mod
	else:
		print 0
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 and b<10:
  print(a*b)
else:
  print(-1)
Problem p02912 (python)

Fixed submission:
import heapq
n,m = map(int,input().split())
a = list(map(lambda x: int(x)*(-1),input().split()))
heapq.heapify(a)
for i in range(m):
  a_min = heapq.heappop(a)
  heapq.heappush(a,(-1)*(-a_min // 2))
print(-sum(a))

Buggy submission (verdict: Runtime Error):
import heapq
n,m = map(int,input().split())
a = list(map(lambda x: int(x)*(-1),input().split()))
heapq.heapify(a)
for i in range(m):
  a_min = heapq.heappop(a)
  heap.heappush(a,(-1)*(-a_min // 2))
print(-sum(a))
Problem p03013 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
a = set(a)
dp = [0]*(n+1)
dp[0] = 1
mod = 10**9 + 7
if 1 in a:
  dp[1] = 0
else:
  dp[1] = 1
for i in range(2,n+1):
  if i in a:
    continue
  else:
    dp[i] = (dp[i-1]+dp[i-2]) % mod
print(dp[-1] % mod)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
dp = [0]*(n+1)
dp[0] = 1
if 1 in a:
  dp[1] = 0
else:
  dp[1] = 1
for i in range(2,n+1):
  if i in a:
  else:
    dp[i] = dp[i-1]+dp[i-2]
print(dp[-1] % (10**9+7))
Problem p03127 (python)

Fixed submission:
import fractions
n = int(input())
a = list(map(int,input().split()))
gcd_a = fractions.gcd(a[0],a[1])
for i in range(2,n):
  gcd_a = fractions.gcd(gcd_a,a[i])
  if gcd_a == 1:
    break
print(gcd_a)

Buggy submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int,input().split()))
gcd_a = fractions.gcd(a[0],[1])
for i in range(2,n):
  gcd_a = fractions.gcd(gcd_a,gcd[i])
  if gcd_a == 1:
    break
print(gcd_a)
Problem p03137 (python)

Fixed submission:
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
x_diff = [x[i]-x[i-1] for i in range(1,m)]
x_diff.sort(reverse = True)
if n >= m:
  print(0)
else:
  del x_diff[:n-1]
  print(sum(x_diff))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
x_diff = [x[i]-x[i-1] for i in range(1,m)]
x_diff.sort(reverse == True)
if n >= m:
  print(0)
else:
  del x_diff[:n-1]
  print(sum(x_diff))
Problem p02781 (python)

Fixed submission:
def nCk(n, k):
  return factorial(n)/factorial(n-k)/factorial(k)

from math import factorial
N = input()
K = int(input())
order = len(N)
diff = order - K 
if order < K:
  print(0)
else:
  s = int(N[0])
  #lower  = factorial(order-1)/factorial(diff-1)/ factorial(K) * (9**K)
  if order - 1 >= K:
    lower = nCk(order - 1, K) * (9**K)
  else:
    lower = 0
  total = lower
  for i in range(1, s):
  #  total += factorial(order-1)/factorial(diff)/ factorial(K-1) * (9**(K-1))
    total += nCk(order - 1, K - 1) * (9**(K-1))

  if K == 1:
    total += 1
  elif K == 2:
    under = int(N[1:])
    num = "0"*(order -1)
    for k in range(order - 1):
      for kk in range(1, 10):
        tmp = num[:k] + str(kk) + num[k+1:]
        if int(tmp) <= under:
          total += 1
  elif K == 3:
    under = int(N[1:])
    num = "0"*(order -1)
    for k in range(1, order - 1):
      for j in range(k):
        for kk in range(1, 10):
          for jj in range(1, 10):
            tmp = num[:j] + str(jj) + num[j+1:k] +str(kk) +  num[k+1:]
            if int(tmp) <= under:
              total += 1


  print(int(total))
  #pattern = factorial(order)/factorial(diff)/ factorial(K) * (9**K)

Buggy submission (verdict: Runtime Error):
def nCk(n, k):
  return factorial(n)/factorial(n-k)/factorial(k)

from math import factorial
N = input()
K = int(input())
order = len(N)
diff = order - K 
if order < K:
  print(0)

s = int(N[0])
#lower  = factorial(order-1)/factorial(diff-1)/ factorial(K) * (9**K)
if order - 1 >= K:
  lower = nCk(order - 1, K) * (9**K)
else:
  lower = 0
total = lower
for i in range(1, s):
#  total += factorial(order-1)/factorial(diff)/ factorial(K-1) * (9**(K-1))
  total += nCk(order - 1, K - 1) * (9**(K-1))

if K == 1:
  total += 1
elif K == 2:
  under = int(N[1:])
  num = "0"*(order -1)
  for k in range(order - 1):
    for kk in range(1, 10):
      tmp = num[:k] + str(kk) + num[k+1:]
      if int(tmp) <= under:
        total += 1
elif K == 3:
  under = int(N[1:])
  num = "0"*(order -1)
  for k in range(1, order - 1):
    for j in range(k):
      for kk in range(1, 10):
        for jj in range(1, 10):
          tmp = num[:j] + str(jj) + num[j+1:k] +str(kk) +  num[k+1:]
          if int(tmp) <= under:
            total += 1
            

print(int(total))
#pattern = factorial(order)/factorial(diff)/ factorial(K) * (9**K)
Problem p02793 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd (a, b)

n=int(input())
a=list(map(int,input().split()))
l=1
for i in range(0,n):
    l=lcm(l,a[i])
ans=0
for i in range(0,n):
    ans=ans+l//a[i]
print (ans%(10**9+7))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd (a, b)

n=int(input())
a=list(map(int,input().split()))
l=1
for i in range(0,n):
    l=lcm(l,a[i])
ans=0
for i in range(0,n):
    ans=ans+l/a[i]
print (int(ans%(10**9+7)))
Problem p02897 (python)

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

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

Fixed submission:
b=input()
a=input().split()
for i in range(0,len(a)):
    a[i]=int(a[i])
b=0
c=0
answer=sum(a)
for i in range(0,len(a)):
    b=b+a[i]
    c=sum(a)-b
    if (b-c>=0 and answer>b-c):
        answer=b-c
    elif (c-b>0 and answer>c-b):
        answer=c-b
print(answer)

Buggy submission (verdict: Runtime Error):
a=input().split()
num=a[0]
del a[0]
for i in range(0,num//2+1):
    a[i]=int(a[i])
b=0
c=0
answer=sum(a)
for i in range(0,len(a)):
    b=b+a[i]
    c=sum(a)-b
    if (b-c>=0 and answer>b-c):
        answer=b-c
    elif (c-b>0 and answer>c-b):
        answer=c-b
print(answer)

Buggy submission (verdict: Runtime Error):
a=input().split()
num=a[0]
del a[0]
for i in range(0,a[0]//2+1):
    a[i]=int(a[i])
b=0
c=0
answer=sum(a)
for i in range(0,len(a)):
    b=b+a[i]
    c=sum(a)-b
    if (b-c>=0 and answer>b-c):
        answer=b-c
    elif (c-b>0 and answer>c-b):
        answer=c-b
print(answer)

Buggy submission (verdict: Runtime Error):
a=input().split()
del a[0]
for i in range(0,len(a)):
    a[i]=int(a[i])
c=sum(a)/2
d=0
e=0
for i in range(0,len(a)):
    if d<c:
        d=d+a[i]
        e=e+1
g=d*2-sum(a)
h=sum(a)-2*(d-a[e-1])
min(g,h)

Buggy submission (verdict: Runtime Error):
a=input().split()
del a[0]
for i in range(0,len(a)):
    a[i]=int(a[i])
c=sum(a)/2
d=0
e=0
for i in range(0,len(a)):
    if d<c:
        d=d+a[i]
        e=e+1
g=d*2-sum(a)
h=sum(a)-2*(d-a[e-1])
print(min(g,h))

Buggy submission (verdict: Runtime Error):
a=input().split()
del a[0]
for i in range(0,len(a)):
    a[i]=int(a[i])
c=sum(a)/2
d=0
e=0
for i in range(0,len(a)):
    while d<c:
        d=d+a[i]
        e=e+1
g=sum(a)-d*2
h=2*(d-a[e-1])-sum(a)
print(max(g,h))
Problem p02682 (python)

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

if a >= k:
    print(k)
    exit()

if k-a-b <= 0:
    print(a)
    exit()

print(a-(k-a-b))

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

result = 0

for i in k:
    if a != 0:
        result = result + 1
        a = a - 1
    elif a == 0 and b != 0:
        #result変わらず
        b = b - 1
    elif a == 0 and b == 0 and c != 0:
        result = result - 1
        c = c  - 1
    else:
        break

print(result)

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
K = input()

result = 0

for i in K:
    if A != 0:
        result = result - 1;
        A = A - 1;
    elif A == 0 and B != 0:
        #result変わらず
        B = B - 1;
    elif A == 0 and B == 0:
        result = result - 1;
        C = C - 1;
    else:
        break

print(result)
Problem p02693 (python)

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

i = B - A
c = 0

for i in range(A, B + 1):
    if i % K == 0:
        c = 1

if c == 1:
    print('OK')
else:
    print('NG')

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

i = B - A

for i in range(A, B + 1):
    if i % K == 0:
        c = 1

if c == 1:
    print('OK')
else:
    print('NG')

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

i = B - A

for i in range(A, B + 1):
    if i % K == 0:
        c = 1

if c == 1:
    orint('OK')
else:
    print('NG')
Problem p03127 (python)

Fixed submission:
# -*- coding: utf-8 -*-
from functools import reduce

def gcd(a, b):
    x = max(a, b)
    y = min(a, b)
    z = y
    while x%y != 0:
        z = x%y
        x = y
        y = z
    else:
        return z
            

def gcd_list(numbers):
    return reduce(gcd, numbers)


N = int(input())

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

print(gcd_list(A))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from functools import reduce

def gcd(a, b):
    x = max(a, b)
    y = min(a, b)
    z = y
    while x%y != 0:
        z = x%y
        x = y
        y = z
    else:
        return z

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


N = int(input())

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

print(gcd_list(A))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N = int(input())

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

print(gcd_list(A))
Problem p02699 (python)

Fixed submission:
inputs = str(input())
S = int(inputs.split()[0])
W = int(inputs.split()[1])
if S <= W:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
S = str(input())
N = len(S)

counter = 0
for i in range(N-3):
    for j in  range(i+3,N):
        s = int(S[i:j+1])
        m = s % 2019
        if m == 0:
            counter += 1

print(counter)
Problem p02711 (python)

Fixed submission:
a = str(input())

if "7" in a:
  print("Yes")
else:
  print("No")

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

d = 0
for k in range(2,N):
    sk = S[k]
    for j in range(k):
        sj = S[j]
        if sk != sj:
            for i in range(j):
                si = S[i]
                if (si != sj) & (si != sk):
                    if j-i != k-j:
                   
                        d += 1

print(d)

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

fizz = []
buzz = []
fizzbuzz = []
other = []
for i in range(n):
    if (i % 3 != 0) & (i % 5 != 0):
        other.append(i)

b = 0
for i in range(len(other)):
    b += other[i]

print(b)

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

if "&7" in a:
  print("Yes")
 else:
  print("No")
Problem p02933 (python)

Fixed submission:
# coding:utf-8
 
num = int(input())
chr = input()
 
if num>=3200:
  print(chr)
else:
  print("red")

Buggy submission (verdict: Runtime Error):
# coding:utf8

N = int(input())
A = list(map(int, input().strip().split()))
s = 0
for i in range(N):
    s += 1.0/(A[i])
s = 1.0/s

print(s)

Buggy submission (verdict: Runtime Error):
# coding:utf8

N = input()
A = list(map(int, input().strip().split()))
s = 0
for i in range(N):
    s += 1.0/(A[i])
s = 1.0/s

print(s)

Buggy submission (verdict: Runtime Error):
# coding:utf8

N = input()
A = input().split()

s = 0
for i in range(N):
    s += 1.0/int(A[i])
s = 1.0/s

print(s)

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

num = int(input())
chr = input()

if num=<3200:
  print(chr)
else:
  print("red")
Problem p02688 (python)

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

sunuke = []

for i in range(0,k):
    d = int(input())
    a = list(map(int,input().split()))
    sunuke +=a

print(n-len(set(sunuke)))

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

sunuke_list = []

count=0


for a in range(0,d):
    point = input()
    if not point in sunuke_list:
        sunuke_list.append(int(point))

for j in range(0,d):

    if j in sunuke_list:
        count +=1



if count<d:
    print(n-d)

else:
    print(n-count)

Buggy submission (verdict: Runtime Error):

import sys
sys.setrecursionlimit(12)
n, k =map(int, input().split())
d = int(input())

n_meajor = [0 for i in range(0,n)]

sunuke=[]
count=0

# for i in sys.stdin:
#     sunuke.append(int(input()))

for a in range(0,100):
    sunuke.append(int(input()))

for j in range(0,n):
    if j in sunuke:
        n_meajor[j]=1


sunuke_people = sum(n_meajor)

if sunuke_people<d:
    print(n-d)

else:
    print(n-sunuke_people)

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

n_meajor = [0 for i in range(0,n)]

sunuke=[]
count=0

for i in sys.stdin:
    sunuke.append(int(input()))

for j in range(0,n):
    if j in sunuke:
        n_meajor[j]=1


sunuke_people = sum(n_meajor)

if sunuke_people<d:
    print(n-d)

else:
    print(n-sunuke_people)
Problem p03011 (python)

Fixed submission:
a = list(map(int,input().split()))
a.sort()
print(a[0]+a[1])

Buggy submission (verdict: Runtime Error):
def fib(n):
    f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
    return f


# def fib(n):
#     x = sym.symbols('x',nonnegative=True,integer=True) #変数xの宣言(非負の整数)
#     Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1)) #一般項の式
#     result=Fib.subs(x,n) #xにnを代入
#     result=result.evalf() #式を浮動小数点数として評価
#     return int(result)

n,m = map(int,input().split())
a =  [int(input()) for i in range(m)]
a.append(n+1)

time_f=[]

for i,v in enumerate(a):
    if i == 0:
        # print (fib(a[i]))
        time_f = fib(a[i])
    else:
        # print((a[i]-a[i-1]-1))
        # print (fib(a[i]-a[i-1]-1))
        time_f *=fib(a[i]-a[i-1]-1)


print(time_f%1000000007)

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

def fib(n):
    x = sym.symbols('x',nonnegative=True,integer=True) #変数xの宣言(非負の整数)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1)) #一般項の式
    result=Fib.subs(x,n) #xにnを代入
    result=result.evalf() #式を浮動小数点数として評価
    return int(result)

n,m = map(int,input().split())
a =  [int(input()) for i in range(m)]
a.append(n+1)

time_f=[]

for i,v in enumerate(a):
    if i == 0:
        # print (fib(a[i]))
        time_f = fib(a[i])
    else:
        # print((a[i]-a[i-1]-1))
        # print (fib(a[i]-a[i-1]-1))
        time_f *=fib(a[i]-a[i-1]-1)


print(time_f%1000000007)
Problem p02723 (python)

Fixed submission:
s = str(input())

if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")
        quit()

print("No")

Buggy submission (verdict: Runtime Error):
s = str(input())

if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")

else:
    print("No")
Problem p02711 (python)

Fixed submission:
N = input()
if '7' in N:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
cnt = 0
for k in range(N):
    for j in range(k):
        for i in range(j) :
            if j - i != k - j:
                if S[k] != S[j] and S[j] != S[i] and S[k] != S[i]:
                    cnt = cnt + 1
                else:
                    cnt = cnt + 0

print(cnt)
Problem p02759 (python)

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

print(int(answer))

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

print(int(answer)

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

print(answer)
Problem p02693 (python)

Fixed submission:
K=int(input())
A,B=(int(x) for x in input().split())
if K-(A%K)<=B-A or A%K==0:print('OK')
else:print('NG')

Buggy submission (verdict: Runtime Error):
K=int(input())
A,B=(int(x) for x in input().split())
if K-(A%K)<=B-A or k==A:print('OK')
else:print('NG')
Problem p02711 (python)

Fixed submission:
N = input()
if N[0] == "7" or N[1] == "7" or N[2] == "7" : print ("Yes")
else:print ("No")

Buggy submission (verdict: Runtime Error):
if N[0] == "7" or N[1] == "7" or N[2] == "7" : print ("yes")
else:print ("no")

Buggy submission (verdict: Runtime Error):
N
if N[0] == "7" or N[1] == "7" or N[2] == "7" : print ("yes")
else:print ("no")
Problem p02836 (python)

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

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

count = 0
for i in range(int(len(str))):
	if str[i] != str[-1-i]:
    	count += 1
print(count)
Problem p03041 (python)

Fixed submission:
n, k = map(lambda x: int(x), input().split())
s = input()
 
str = ""
for i in range(n):
  if i + 1 == k:
    str += s[i].lower()
  else:
    str += s[i]
print(str)

Buggy submission (verdict: Runtime Error):
n, k = map(lambda x: int(x), input().split())
s = input()

st = s[k].upper()
print(s[:k] + st + s[k+1:])

Buggy submission (verdict: Runtime Error):
n, k = map(lambda x: int(x), input().split())
s = input()

s[k] = s[k].upper()
print(s)