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

Fixed submission:
def result(letters, number, cant_zero):
    if letters <= 1:
        if number == 0:
            return 10 ** letters
        return 0
    diff = (10 - number%10) % 10
    variants = number % 10 - cant_zero
    if number % 10 == 0:
        variants = 10 - cant_zero
    number -= diff * (10**(letters-1) - 1)
    number = abs(number // 10)
    return variants * result(letters-2, number, 0)

d = int(input())
ans = 0
for i in range(20):
    ans += result(i, d, 1)
print(ans)

Buggy submission (verdict: Runtime Error):
def recursion(length, ll, string, cc):
    if ll * 2 < length:
        for i in range(10):
            string1 = string + str(i)
            recursion(length, ll+1, string1, cc)
    else:
        number = str(int(string) + int(cc[-ll:]))
        ds = ""
        for i in range(length // 2):
            ds += number[-i-1]
        string = ds + string
        if str(int(string) + int(cc)) == string[::-1] and string[0] != "0":
            global answer
            answer += 1
            

d = input()
plus = 0
while True:
    if d[-1] == "0":
        d = d[:-1]
        plus += 1
    else:
        break
answer = 0
recursion(len(d), 0, "", d)
recursion(len(d)+1, 0, "", d)
while plus > 0:
    if plus == 1:
        plus -= 1
        answer = answer * 9
    else:
        plus -= 1
        answer *= 10
print(answer)
Problem p03318 (python)

Fixed submission:
K = int(input())
 
res = [(0, 0)]
mm = 0
cands = []
for i in range(1, 1000):
  v = i
  for j in range(16):
    cands.append(v)
    v = 10 * v + 9

cands = list(sorted(set(cands)))

for x in cands:
  i = sum(ord(c) - ord('0') for c in str(x))
  while x / i < res[-1][0]:
    res = res[:-1]
  res.append((x / i, x))
 
for i in range(1, K + 1):
  print(res[i][1])

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

res = [(0, 0)]
mm = 0
for i in range(1, 136):
  n = []
  x = i
  while x > 0:
    n.append(str(min(x, 9)))
    x -= 9
  n.reverse()
  x = int(''.join(n))
  
  while x / i < res[-1][0]:
    res = res[:-1]
  res.append((x / i, x))

for i in range(1, K + 1):
  print(res[i][1])
Problem p03637 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
c4 = sum(1 for x in a if x % 4 == 0)
c1 = sum(1 for x in a if x % 2 == 1)
if c4 >= c1 or (c4 >= c1 - 1 and c4 + c1 == n):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
c4 = sum(1 for x in a if x % 4 == 0)
c1 = sum(1 for x in a if x % 2 == 1)
if c4 >= c1 or (c4 >= c1 - 1 and c4 + c1 == n):
  print("Yes")
else
  print("No")
Problem p03160 (python)

Fixed submission:
dp = {}

n = int(input())
h = [int(x) for x in input().split()]

dp[0] = 0
dp[1] = abs(h[1] - h[0])

for x in range(2, n):
  dp[x] = min(
    dp[x - 1] + abs(h[x] - h[x - 1]),
    dp[x - 2] + abs(h[x] - h[x - 2])
  )

print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [None] * n
 
INF = float('inf')
 
dp[0] = 0
for x in range(1, n):
  for j in range(min(k, x) + 1):
    dp[x] = min(dp[x], dp[x - j] + abs(h[x] - h[x - j]) 
 
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [None] * n
 
INF = float('inf')
 
dp[0] = 0
for x in range(1, n):
  dp[x] = min(dp.get(x - i, INF) + abs(h[x] - h[x - i]) for i in range(1, min(k,x) + 1))
 
print(dp[n-1])
Problem p02612 (python)

Fixed submission:

n=int(input())
if n%1000==0:
	print(0)
else:
	v = n//1000
	print((v+1)*1000-n)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%1000==0:
	print(0)
else:
	v = n//1000
    print((v+1)*1000-n)
Problem p02760 (python)

Fixed submission:
arr = []
for i in range(3):
	te = list(map(int,input().split()))
	arr.append(te)
n = int(input())
check = []
for i in range(n):
	x = int(input())
	for j in range(3):
		for k in range(3):
			if arr[j][k]==x:
				arr[j][k] = 0
yes = False
for j in range(3):
	c = 0
	for k in range(3):
		if arr[j][k]==0:
			c+=1
	if c==3:
		yes = True
		break
	
if yes==False:
	for j in range(3):
		c = 0
		for k in range(3):
			if arr[k][j]==0:
				c+=1
		if c==3:
			yes = True
			break
if yes==False:
	c = 0
	for j in range(3):		
		if arr[j][j]==0:
			c+=1
	if c==3:
		yes = True
if yes==False:
	c = 0
	for j in range(3):		
		if arr[j][2-j]==0:
			c+=1
	if c==3:
		yes = True
if yes:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
arr = []
for i in range(3):
	te = list(map(int,input().split()))
	arr.append(te)
n = int(input())
check = []
for i in range(n):
	x = int(input())
	for j in range(3):
		for k in range(3):
			if arr[j][k]==x:
				arr[j][k] = 0
yes = False
for j in range(3):
	c = 0
	for k in range(3):
		if arr[j][k]==0:
			c+=1
	if c==3:
		yes = True
		break
	
if yes==False:
	for j in range(3):
		c = 0
		for k in range(3):
			if arr[k][j]==0:
				c+=1
		if c==3:
			yes = True
			break
if yes==False:
	c = 0
	for j in range(3):		
		if arr[j][j]==0:
			c+=1
	if c==3:
		yes = True
if yes==False:
	c = 0
	for j in range(3):		
		if arr[j][2-j]==0:
			c+=1
	if c==3:
		yes = True
if yes:
	print("YES")
else:
	print("NO")
Problem p03076 (python)

Fixed submission:
from itertools import permutations
def solve(perm):
  t = 0
  for i in perm:
    t = ((t + 9) // 10) * 10
    t += x[i]
  return t

x = [int(input()) for _ in range(5)]
ans = min([solve(perm) for perm in permutations([i for i in range(len(x))])])
print(ans)

Buggy submission (verdict: Runtime Error):
x = [int(input()) for _ in range(5)]
t = 0
for i in range(x):
  t = ((t + 9) // 10) * 10
  t += x[i]
print(t)
Problem p02930 (python)

Fixed submission:
n = int(input())

def get_val(a, b):
    for i in range(10):
        x = (a >> i) % 2
        y = (b >> i) % 2
        if x != y:
            return (i + 1)

for i in range(1, n):
    print(*[get_val(i,j) for j in range(i + 1, n + 1)])

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

def get_val(a, b):
    for i in range(10):
        x = (a >> i) % 2
        y = (b >> i) % 2
        if x != y:
            return (i + 1)

for i in range(1, N):
    print(*[get_val(i,j) for j in range(i + 1, n + 1)])
Problem p03466 (python)

Fixed submission:
T=int(input())
for TT in range(T):
	a,b,c,d=map(int,input().split(' '))
	l,x,y,out=(a+b)//(min(a,b)+1),0,0,""
	if a*l<=b:y=a+b
	elif b*l<=a:x=a+b
	else:x,y=(a*l-b)//(l-1),(b*l-a)//(l-1) 
	for i in range(c,d+1):out+=("AB"[i%(l+1)==0]) if i<=x else "BA"[(a+b-i+1)%(l+1)==0] if a+b-i+1<=y else "AB"[a-x+x//(l+1)-y//(l+1)==0]
	print(out)

Buggy submission (verdict: Runtime Error):
for t in range(int(input())):
  a,b,c,d=map(int,input().split(' '));l,x,y,o=(a+b)//(min(a,b)+1),0,0,""
	if a*l<=b:y=a+b
	elif b*l<=a:x=a+b
	else:x,y=(a*l-b)//(l-1),(b*l-a)//(l-1)
	for i in range(c,d+1):o+="AB"[i%(l+1)==0] if i<=x else "BA"[(a+b-i+1)%(l+1)==0] if a+b-i+1<=y else "AB"[a-x+x//(l+1)-y//(l+1)==0]
	print(o)
Problem p02675 (python)

Fixed submission:
n=input()
m=int(n[-1])
 
 
 
 
 
if (m)==3:
    print("bon")
elif m==6 or m==8 or m==0 or m==1:
    print("pon")
    
else:
    print("hon")

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

m=n[-1]
if m==0,1,6,8:
  print("pon")
elif m==3:
  print("bon")
  
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N=input("what`s the number?")
N= int(N)
N=999
if (num==2,4,5,7,9):
  print("hon")
 
elif(num==0,1,6,8):
  print("pon")
  
else:
  print("bon")
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
if S==T[0:len(S)]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
    S=input()
    T=input()
    if S==T[0:len(S)]:
      print("Yes")
    else:
      print("No")

Buggy submission (verdict: Runtime Error):
    S=input()
    T=input()
    if S==T[0:len(S)]:
      print("Yes")
    else:
      print("No")
Problem p02724 (python)

Fixed submission:
x = int(input())

a = x // 500

b = (x % 500) // 5
 
ans = a * 1000 + b * 5
 
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
 
a = x // 500
b = (x % 500) // 5
 
ans = a * 1000 + b * 5
 
 print(ans)
Problem p03031 (python)

Fixed submission:
import itertools
 
N, M = map(int, input().split())
lights = []
for m in range(M):
    tmp = list(map(int, input().split()))
    lights.append(tmp[1:])
    
    
 
 
P = list(map(int, input().split()))
 
ans = 0
for product in list(itertools.product([0, 1], repeat=N)):
    for light in range(len(lights)):
        cnt = 0
        for l in lights[light]:
            cnt += product[l-1]
        if cnt % 2 != P[light]:
            break
        if light == len(lights) - 1:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
 
N, M = map(int, input().split())
lights = []
for m in range(M):
  
  interpools mpzp(input())
    tmp = list(map(int, input().split()))
    lights.append(tmp[1:])
 
 
P = list(map(int, input().split()))
 
ans = 0
for product in list(itertools.product([0, 1], repeat=N)):
    for light in range(len(lights)):
        cnt = 0
        for l in lights[light]:
            cnt += product[l-1]
        if cnt % 2 != P[light]:
            break
        if light == len(lights) - 1:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
 
N, M = map(int, input().split())
lights = []
for m in range(M):
  
  interpools mpzp(int,Input().spli
    tmp = list(map(int, input().split()))
    lights.append(tmp[1:])
 
 
P = list(map(int, input().split()))
 
ans = 0
for product in list(itertools.product([0, 1], repeat=N)):
    for light in range(len(lights)):
        cnt = 0
        for l in lights[light]:
            cnt += product[l-1]
        if cnt % 2 != P[light]:
            break
        if light == len(lights) - 1:
            ans += 1
print(ans)
Problem p03863 (python)

Fixed submission:
import sys
s = raw_input()
 
if s[0] == s[len(s)-1]:
    if len(s) % 2 == 0:
        print "First"
    else:
        print  "Second"
else:
    if len(s) % 2 == 0:
        print  "Second"
    else:
        print  "First"

Buggy submission (verdict: Runtime Error):
import sys
s = raw_input()

if s[0] == s[len(s)-1]:
    if len(s) % 2 == 0:
        return "First"
    else:
        return "Second"
else:
    if len(s) % 2 == 0:
        return "Second"
    else:
        return "First"
Problem p02658 (python)

Fixed submission:
n=int(input())
l=list(map(int, input().split()))
dap=1
nodap=0
zeroexist=0
for i in range(n):
    zeroexist+=(l[i]==0)
if zeroexist>0:
    print("0")
else:
    for i in range(n):
        dap*=l[i]
        if dap>1000000000000000000:
            nodap+=1
            break
    if nodap==1:
        print("-1")
    else:
        print(dap)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int, input().split()))
dap=1
nodap=0
for i in range(n):
    dap*=l[i]
    if dap>1000000000000000000:
        nodap++
        break
if nodap:
    print("-1")
else:
    print(dap)
Problem p02640 (python)

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

a = x[0]*2 - x[1]/2
b = -x[0] + x[1]/2

if (a>=0 and b>= 0):
	if(a.is_integer() and b.is_integer()):
		print("Yes")
	else:
		print("No")
else:
	print("No")

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

a = x[0]*2 - x[1]/2
b = -x[0]/2 + x[1]/2

if a>=0 and b>= 0:
	if(a.isinteger() and b.isinteger()):
		print("yes")
	else;
		print("no")
else:
	print("no")

Buggy submission (verdict: Runtime Error):
x = list(map(int, xin))

a = x[0]*2 - x[1]/2
b = -x[0]/2 + x[1]/2

if a>=0 and b>= 0:
	print("yes")
else:
	print("no")
Problem p02761 (python)

Fixed submission:
n,m = map(int,input().split())
ans = []
li = []

for i in range(m):
    s,c = map(int,input().split())
    li.append([s,c])

if n == 1:
    for i in range(10):
        buf = str(i)
        flag = True
        for j in range(len(li)):
            if buf[li[j][0]-1] != str(li[j][1]):
                flag = False
        if flag:
            ans.append(buf)
            flag = True
else:
    for i in range(10**(n-1),10**n):
        buf = str(i)
        flag = True
        for j in range(len(li)):
            if buf[li[j][0]-1] != str(li[j][1]):
                flag = False
        if flag:
            ans.append(buf)
            flag = True

ans.sort()
if ans:
    print(ans[0])
else:
    print(-1)

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

for i in range(m):
    s,c = map(int,input().split())
    li.append([s,c])

for i in range(10**(n-1),10**n):
    buf = str(i)
    flag = True
    for j in range(len(li)):
        if buf[li[j][0]-1] != str(li[j][1]):
            flag = False
    if flag:
        ans.append(buf)
        flag = True

ans.sort()
if ans:
    print(ans[0])
else:
    print(-1)
Problem p02784 (python)

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

a=[int(x) for x in input().split()]

flag=False

for aa in a:
    h-=aa
    if h <= 0:
        flag=True
        break
    
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
h,n = map(int,input().split())
waza = sorted([int(x) for x in input().split()],reverce=True)

ans=0

for i in range(n):
    ans+=waza[i]

if ans >= h:
    print("Yes")
else:
    print("No")
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
ac = [0] * n
wa = [0] * n

for i in range(m):
    p,s = map(str,input().split())
    p = int(p)
    if ac[p-1] != 1:
        if s == 'WA':
            wa[p-1] += 1
        elif s == 'AC':
            ac[p-1] += 1

for i in range(n):
    if ac[i] == 1:
        continue
    elif ac[i] == 0:
        wa[i] = 0
        
print(sum(ac),sum(wa))

Buggy submission (verdict: Runtime Error):
import sys

n,m=map(int,input().split())

if m==0:
    print(0,0)
    sys.exit()

p=[]
s=[]
for i in range(m):
    pp,ss=input().split()
    p.append(int(pp))
    s.append(ss)

p.append(max(p)+1)

sei=0
pena=0

print(len(p))

i=0

while(True):
    #print(i)
    #print("p[i],p[-1]:",p[i],p[-1])
    if p[i]==p[-1]: break
    if s[i]=='WA':
        pena+=1
    else:
        sei+=1
        #print("p[i]+1:",p[i]+1)
        i=p.index(p[i]+1)-1
        #print("i:",i)
    i+=1
            
print(sei,pena)
Problem p02843 (python)

Fixed submission:
x = int(input())
flag = False

for i in range(1,2000):
    if i * 100 <= x <= i * 105:
        flag = True
        break

if flag:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
x = int(input())
tmp = x%100

if x % tmp == 0:
    print(1)
else:
    print(0)
Problem p02921 (python)

Fixed submission:
s=input()
t=input()

count = 0

for s,t in zip(s,t):
    if s==t: count+=1

print(count)

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

count=0
tmp=0

for i in range(1,21):
    if (a-1)*i+1 >= b:
        print(i)
        break
Problem p02945 (python)

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

tmp1=a+b
tmp2=a-b
tmp3=a*b

list=[tmp1,tmp2,tmp3]

print(max(list))

Buggy submission (verdict: Runtime Error):
from collections import Counter


def anagrams(word1,word2):
    def counter(s):
        return Counter(s.upper().replace(' ',''))
    return counter(word1) == counter(word2)

N=int(input())

count=0

list=[]

for i in range(N):
    list.append(input())

for i in list:
    list.remove(i)
    if len(list)==2:
        if anagrams(list[0],list[1])==True:
            count+=1
        break
    for j in list:
        if anagrams(i,j)==True:
            count+=1
print(count)
Problem p02958 (python)

Fixed submission:
n=int(input())
p=[int(x) for x in input().split()]
pp=[int(x+1) for x in range(n)]

count=0

for i in range(n):
    if p[i]!=pp[i]:
        count+=1

if count <= 2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[int(x) for x in input().split()]
pp=[int(x+1) for x in range(n)]

count=0

for i in range(n):
    if p[i]!=pp[i]:
        count+=1

if count <= 2
    print("Yes")
else:
    print("No")
Problem p02983 (python)

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

mn = 4038

if (r - l) >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = (i * j) % 2019
            if tmp < mn:
                mn = tmp
    print(mn)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())

mn = 4038

if (r - l) >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = (i * j) % 2019
            if tmp < mn:
                mn = tmp
	print(mn)
Problem p02995 (python)

Fixed submission:
import fractions

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

a-=1

buf_1=a-(a//c+a//d)+a//((c*d)//fractions.gcd(c,d))
buf_2=b-(b//c+b//d)+b//((c*d)//fractions.gcd(c,d))

print(buf_2-buf_1)

Buggy submission (verdict: Runtime Error):
import math

n=[int(x) for x in input().split()]

a=(n[0]-1)//n[2]
b=(n[0]-1)//n[3]
c=(n[0]-1)//(n[2]*n[3]/math.gcd(n[2],n[3]))

d=n[1]//n[2]
e=n[1]//n[3]
f=n[1]//(n[2]*n[3]/math.gcd(n[2],n[3]))

print((n[1]-d-e+f)-((n[0]-1)-a-b+c))
Problem p02999 (python)

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

if n[0]<n[1]:
    print('0')
else:
    print('10')

Buggy submission (verdict: Runtime Error):
x,a=map(int,input())

if x < a:
    print(0)
else:
    print(10)
Problem p03076 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

for dd in dish:
    for i in range(0,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp > mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for dd in dish:
    result+=dd
    for i in range(1,10):
        if result % 10 == 0:
            break
        result+=1
        
print(result+buf)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

def dtime(a):
    for i in range(9):
        if a%10==0:
            return a
        else:
            a+=1

for dd in dish:
    for i in range(0,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp > mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for dd in dish:
    result+=dtime(dd)

print(result+buf)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

def dtime(a):
    for i in range(9):
        if a%10==0:
            return a
        else:
            a+=1

for dd in dish:
    for i in range(1,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp > mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for dd in dish:
    result+=dtime(dd)

print(result+buf)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

for dd in dish:
    for i in range(1,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp > mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for dd in dish:
    result+=dd
    for j in range(1,10):
        if result % 10 ==0:
            break
        result+=1

print(result+buf)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

for dd in dish:
    for i in range(1,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp >= mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for i in range(4):
    result+=dish[i]
    for j in range(1,10):
        if result % 10 ==0:
            break
        result+=1

print(result+buf)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

for dd in dish:
    for i in range(1,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp > mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for i in range(4):
    result+=dish[i]
    for j in range(1,10):
        if result % 10 ==0:
            break
        result+=1

print(result+buf)
Problem p03087 (python)

Fixed submission:
n,q = map(int,input().split())
s = input()
ans = []
li = [0] * (len(s))
count = 0

for i in range(1,len(s)):
    if s[i] == 'C' and s[i-1] == 'A':
        count += 1
    li[i] = count

for i in range(q):
    l,r = map(int,input().split())
    tmp = li[r-1] - li[l-1]
    ans.append(tmp)

for aa in ans:
    print(aa)

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
ans = []
for i in range(q):
    l,r = map(int,input().split())
    buf = s[l-1:r]
    print(buf)
    ans.append(buf.count('AC'))

for i in range(len(ans)):
    print(ans[i])
Problem p03219 (python)

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

print(x+y//2)

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

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

min=5000

H=[int(x) for x in input().split()]

for i in range(N):
    #print(abs(A-(T-H[i]*0.006)))
    if abs(A-(T-H[i]*0.006)) <= min:
        min=abs(A-(T-H[i]*0.006))
        buf=i+1

print(buf)
Problem p03262 (python)

Fixed submission:
import functools
import fractions

n,x=map(int,input().split())
xx=[int(t) for t in input().split()]
buf=[]

for value in xx:
    buf.append(abs(value - x))

print(functools.reduce(fractions.gcd, buf))

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

n,x=map(int,input().split())
xx=[int(t) for t in input().split()]
buf=[]

for value in xx:
    buf.append(abs(value - x))

print(functools.reduce(math.gcd, buf))
Problem p03416 (python)

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

ans=0

for i in range(a,b+1):
    buf=str(i)
    #print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])
    str1=buf[0:int(len(buf)/2)]
    str2=buf[int(len(buf)/2+1):]
    if str1[0]==str2[1] and str1[1]==str2[0]:
        ans+=1

print(ans)

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

ans=0

for i in range(a,b+1):
    buf=str(i)
    #print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])
    str=buf[::-1]
    if buf==str:
        ans+=1

print(ans)
Problem p02705 (python)

Fixed submission:
import math
R = int(input())
print(2*math.pi*R)

Buggy submission (verdict: Runtime Error):
import math

R = (input())
print(2*math.pi*R)

Buggy submission (verdict: Runtime Error):
import sympy

R = float(input())
round(2*sympy.pi.evalf(1000)*R, 100)

Buggy submission (verdict: Runtime Error):
import sympy

R = float(input())
2*sympy.pi.evalf(1000)*R

Buggy submission (verdict: Runtime Error):
import sympy

R = float(input())
round(2*sympy.pi.evalf(100)*R, 3)

Buggy submission (verdict: Runtime Error):
from mpmath import

R = float(input())
mp.dps = 30
round(2*pi*R, 30)

Buggy submission (verdict: Runtime Error):
import sympy

R = float(input())
2*sympy.pi.evalf(100)*R

Buggy submission (verdict: Runtime Error):
import sympy

R = float(input())
2*sympy.pi.evalf(30)*R
Problem p02713 (python)

Fixed submission:
from math import gcd

K = int(input()) + 1
d = 0

for i in range(1, K):
    for j in range(1, K):
        for k in range(1, K):
            d = gcd(gcd(i, j), k) + d
print(d)

Buggy submission (verdict: Runtime Error):
import math

K = int(input()) + 1
d = 0

for i in range(1, K):
    for j in range(1, K):
        for k in range(1, K):
            d = gcd(i, j, k) + d
print(d)
Problem p02747 (python)

Fixed submission:
S = input()
S2 = ['hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi']

if S in S2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
if S[0:2]=='hi':
    print('Yes')
else:
    print('No')
Problem p02741 (python)

Fixed submission:
data =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
line =int(input())

print(data[line -1])

Buggy submission (verdict: Runtime Error):
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)