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

Fixed submission:
word = input()
wordArray = list(word)
#print(wordArray)
lent = len(wordArray)

iterV=(int)(lent/2)

if(lent%2==0):
 iterV=iterV+1
#print(iterV)

num=0

for i in range(iterV):
    #print("Word at:",i,wordArray[i])
    #print("Word at:",lent-1,wordArray[lent-1])
    if(wordArray[i] != wordArray[lent-1]):       
       wordArray[i]=wordArray[lent-1]      
       #print("else Word at post swap:",i,wordArray[i])
       #print("else Word at post swap:",lent-1,wordArray[lent-1])
       num=num+1       
    lent=lent-1
#print(" else Num:",num)
#print(" else lent:",lent)

print(num)

Buggy submission (verdict: Runtime Error):
word = input()
wordArray = list(word)
#print(wordArray)
lent = len(wordArray)
iterV=(int)(lent/2)
#print(iterV)

num=0

for i in range(iterV):
    #print("Word at:",i,wordArray[i])
    #print("Word at:",lent-1,wordArray[lent-1])
    if(wordArray[i] == wordArray[lent-1]):
       #print(" if Num:",num)
    else:      
       print(" else temp:",temp)
       wordArray[i]=wordArray[lent-1]      
       print("else Word at post swap:",i,wordArray[i])
       #print("else Word at post swap:",lent-1,wordArray[lent-1])
       num=num+1       
   
lent=lent-1
#print(" else Num:",num)
#print(" else lent:",lent)

print(num)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
if s[:int(n/2)] == s[int(n/2):n] :
    print("Yes")
else:
    print("No")

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

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

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

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
if (s[:int(2/n)] == s[int(2/n):n] :
    print("Yes")
else
    print("No")
Problem p03011 (python)

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

print(s_l[0] + s_l[1])

Buggy submission (verdict: Runtime Error):
l = list(input().split())
s_l = l.sort()

print(s_l[0] + s_l[1])
Problem p03803 (python)

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

if a == b:
    print("Draw")
elif a == 1:
    print("Alice")
elif b == 1:
    print("Bob")
elif a < b:
    print("Bob")
else:
    print("Alice")

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

if a == b:
    print("Draw")
elif a == 1:
    print("Alice"):
elif b == 1:
    print("Bob")
elif a < b:
    print("Bob")
else:
    print("Alice")
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)

Buggy submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)
Problem p02880 (python)

Fixed submission:
a = int(input())
f = False
for i in range(9):
    t = a / (i + 1)
    if t == int(t) and t < 10:
        print("Yes")
        f = True
        break
if not f:
    print('No')

Buggy submission (verdict: Runtime Error):
a = int(input())
for i in range(9):
  t = a / (i+1)
  f = False
  if t == int(t) && t < 10:
    print(YES)
    f = True
if f == False:
  print(No)
Problem p02847 (python)

Fixed submission:
day = input()
week = ['SUN','MON','TUE','WED','THU','FRI','SAT']
ans = 7;

for i in range(len(week)):
    if day != week[i]:
        ans -= 1
    else:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
day = input()
week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
ans = 6;

for i in int(len(week)):
    if day != week[i]:
        ans -= 1
print(ans)
Problem p02897 (python)

Fixed submission:
n=int(input())
m=n//2
print((n-m)/n)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
    print("0.5")
else:
    print("{}".format((m+1)/n))
Problem p03041 (python)

Fixed submission:
n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print("".join(s))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print("".join())
Problem p02881 (python)

Fixed submission:
n = int(input())
 
l1 = []
for i in range(1, int(n ** 0.5) + 1):
  q, mod = divmod(n , i)
  if mod == 0:
    l1.append(q + i -2)
print(min(l1))

Buggy submission (verdict: Runtime Error):
n = int(input())
 
l1 = []
for i in range(1, int(n ** 0.5)):
  q, mod = divmod(n , i)
  if mod == 0:
    l1.append(q + i -2)
print(min(l1))
Problem p02897 (python)

Fixed submission:
N = int(input())

odd = 0
even = 0
for i in range(N):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

print(odd/(odd + even))

Buggy submission (verdict: Runtime Error):
n = int(input())
li = [int(z) for z in input().split()]

l2 = [""] * n

c = 0
for i in li:
  l2[c] = i
  c += 1
print(l2)

Buggy submission (verdict: Runtime Error):
n, h = [int(z) for z in input().split()]
li2 = [int(z) for z in input().split()]

f = 0
for i in li2:
  if i >= h:
    f += 1
print(f)

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

odd = 0
even = 0
for i in range(N-1):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

total = odd + even
print(odd/total)

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

odd = 0
even = 0
for i in range(N-1):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

print(odd/(even + odd))

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

odd = 0
even = 0
for i in range(N-1):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

print(odd/(even + odd))
Problem p03835 (python)

Fixed submission:
k, s = map(int, input().split(' '))
r = 0
for x in range(0, k + 1):
    for y in range(0, k + 1):
        if s - x - y <= k and s - x - y >= 0:
            r += 1
print(r)

Buggy submission (verdict: Runtime Error):
k, s = map(input, input().split(' '))
r = 0
for x in range(0, k + 1):
    for y in range(0, k + 1):
        for z in range(0, k + 1):
            if x + y + z == s:
                r += 1
print(r)
Problem p02847 (python)

Fixed submission:
l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
day = input()
for i in range(len(l)):
    if day == l[i]:
        print(7-i)

Buggy submission (verdict: Runtime Error):
l = [SUN, MON, TUE, WED, THU, FRI, SAT]
day = input()
for i in range(len(l)):
  if day = l[i]:
    print(7-i)
Problem p02859 (python)

Fixed submission:
import numpy as np
r = int(input())
c = int(np.pi)*(1**2)
c2 = int(np.pi)*(r**2)
print(int(c2/c))

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

r = input()
c = 1*(np.pi**2)
c2 = r*(np.pi**2)
print(int(c2/c))

Buggy submission (verdict: Runtime Error):
import numpy as np
r = raw_input()
c = 1*(np.pi**2)
c2 = r*(np.pi**2)
print(int(c2/c))
Problem p02835 (python)

Fixed submission:
a, b ,c= map(int, input().split())
if a+b+c >= 22 :
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a, b ,c= map(int, input().split())
if a+b+c => 22 :
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a, b ,c= map(int, input().split())
if a+b+c > 22 :
print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a, b ,c= map(int, input().split())
if a+b+c > 22 
print("bust")
else:
  print("win")
Problem p02835 (python)

Fixed submission:
A = (int(x) for x in input().split())
print("bust") if sum(A) >= 22 else print("win")

Buggy submission (verdict: Runtime Error):
A = [int(x) for x in input().split()]
sum=0
for i in A:
  sum=+i
  
if sum<22:
  print('win')
elif:
  print('bust')

Buggy submission (verdict: Runtime Error):
A = [int(x) for x in input().split()]
sum=0
for i in A:
  sum+=i
  
if sum<22:
  print('win')
elif:
  print('bust')

Buggy submission (verdict: Runtime Error):
A = [int(x) for x in input().split()]
sum=0
for i in A:
  sum+=i
  
if sum<22:
  print('win')
elif:
  print('bust')
Problem p02836 (python)

Fixed submission:
s = str(input())
n = int(len(s))
p = s[0 : n//2]
s = s[n//2 : n+1]
hug = 0
s = s[len(s)::-1]
for i, m in zip(s, p):
  if i!=m:
    hug+=1
      
print(hug)

Buggy submission (verdict: Runtime Error):
s = (int(x) for x in input().split())
p = [0:len(s)/2]
s = [len(s)/2:len(s)+1]
hug = 0
s.reverse()
for i in s:
  for m in p:
    if i!=m:
      hug+=1
      
print(hug)
Problem p02835 (python)

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

Buggy submission (verdict: Runtime Error):
A = map(int, input())
if sum(A)<=21:
  print('win')
else:
  print('bust')
Problem p02836 (python)

Fixed submission:
S = input()
count=0
if len(S)%2==0:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i>=len(S)//2-1:
      break
else:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i==len(S)//2:
      break
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
count=0
if len(S)%2==0:
  for i,s in inumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i>=len(S)//2:
      break
else:
  for i,s in inumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i==len(S)//2:
      break
print(count)
Problem p02835 (python)

Fixed submission:
print('bust' if sum([int(x) for x in input().split(' ')]) >= 22 else 'win')

Buggy submission (verdict: Runtime Error):
res: str = 'bust' if sum([int(x) for x in input().split(' ')]) >= 22 else 'win')
  
print(res)
Problem p02847 (python)

Fixed submission:
s={'SAT':1,'FRI':2,'THU':3,'WED':4,'TUE':5,'MON':6,'SUN':7}
print('{}'.format(s[input()]))

Buggy submission (verdict: Runtime Error):
s={'SAT':1,'FRI':2,'THU':3,'WED':4,'TUE':5,'MON':6,'SUN':7}
print({}.format(s[input()]))
Problem p02859 (python)

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

Buggy submission (verdict: Runtime Error):
input()**2
Problem p02948 (python)

Fixed submission:
import sys
import heapq 
input = sys.stdin.readline
n,m = map(int,input().split())
l=[tuple(map(int,input().split())) for i in range(n)]
l.sort(reverse=True)

w = []
hpop = heapq.heappop
hpush = heapq.heappush
ans = 0

for i in range(1,m+1):
  while l and l[-1][0]==i:
    hpush(w,-l.pop()[1])
  if w:
    ans += hpop(w)
print(-ans)

Buggy submission (verdict: Runtime Error):
import sys
import heapq 
input = sys.stdin.readline
n,m = map(int,input().split())
alwork = [() for i in range(m+1)]
w = []
hpop = heapq.heappop
hpush = heapq.heappush
ans = 0

for i in range(n):
  a,b = map(int,input().split())
  alwork[a] += (-b,)

for i in range(1,m+1):
  for j in alwork[i]:
    hpush(w,j)
  if w:
    ans += hpop(w)
print(-ans)
Problem p03013 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
num = 10**9+7
nots = [int(input()) for i in range(m)]
leng = len(nots)
cnt = 0
dp = [0]*(n+1)
dp[0] = 1
if leng > 0 and nots[0] == 1:
  dp[1] = 0
  nots.pop(0)
  leng -= 1
else:
  dp[1] = 1
if n == 1:
  print(1)
  exit()

for i in range(2,n+1):
  if leng > 0 and nots[cnt] == i:
    dp[i] = 0
    if cnt < leng - 1:
      cnt += 1
  else:
    dp[i] = (dp[i-1] + dp[i-2]) % num
print(dp[n] % num)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
num = 10**9+7
nots = [int(input()) for i in range(m)]
leng = len(nots)
cnt = 0
dp = [0]*(n+1)
dp[0] = 1
if leng > 0 and nots[0] == 1:
  dp[1] = 0
else:
  dp[1] = 1
if n < 2:
  print(1)
  exit()

for i in range(2,n+1):
  if leng > 0 and nots[cnt] == i:
    dp[i] = 0
  else:
    dp[i] = dp[i-1] + dp[i-2]
  if nots[cnt] < i and cnt < leng - 1:
    cnt += 1
print(dp[n] % num)
Problem p03038 (python)

Fixed submission:
import sys
input = sys.stdin.readline

n,m = map(int,input().split())
heap = [int(i) for i in input().split()]
heap.sort()
ans = sum(heap)
ml = []
cnt = 0

for i in range(m):
  a,b = map(int,input().split())
  ml += [[b,a]]
ml.sort(reverse=True)

for i in range(m):
  for j in range(ml[i][1]):
    if ml[i][0] > heap[cnt]:
      ans += ml[i][0] - heap[cnt]
      cnt += 1
      if cnt == n:
        print(ans)
        exit()
    else:
      print(ans)
      exit()
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n,m = map(int,input().split())
heap = [int(i) for i in input().split()]
heap.sort()
ans = sum(heap)
ml = []
cnt = 0

for i in range(m):
  a,b = map(int,input().split())
  ml += [[b,a]]
ml.sort(reverse=True)

for i in range(m):
  for j in range(ml[i][1]):
    if ml[i][0] > heap[cnt]:
      ans += ml[i][0] - heap[cnt]
      cnt += 1
    else:
      break

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n,m = map(int,input().split())
heap = [int(i) for i in input().split()]
heap.sort()
ans = sum(heap)
ml = []

for i in range(m):
  a,b = map(int,input().split())
  ml += [b]*a
ml.sort(reverse=True)

for i in range(n):
  if ml[i] > heap[i]:
    ans += ml[i] - heap[i]
  else:
    break

print(ans)
Problem p03634 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline
n = int(input())
li = [[] for i in range(n)]

for i in range(n-1):
  a,b,dist = map(int,input().split())
  li[a-1].append((b-1,dist))
  li[b-1].append((a-1,dist))

q,k = map(int,input().split())
tdp = [-1]*n
tdp[k-1] = 0

def dfs(x):
  for node in li[x]:
    if tdp[node[0]] == -1:
      tdp[node[0]] = tdp[x] + node[1]
      dfs(node[0])

dfs(k-1)
for i in range(q):
  a,b = map(int,input().split())
  print(tdp[a-1]+tdp[b-1])

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n = int(input())
li = [[] for i in range(n)]

for i in range(n-1):
  a,b,dist = map(int,input().split())
  li[a-1].append((b-1,dist))
  li[b-1].append((a-1,dist))

q,k = map(int,input().split())
tdp = [-1]*n
tdp[k-1] = 0

def dfs(x):
  for node in li[x]:
    if tdp[node[0]] == -1:
      tdp[node[0]] = tdp[x] + node[1]
      dfs(node[0])

dfs(k-1)
for i in range(q):
  a,b = map(int,input().split())
  print(tdp[a-1]+tdp[b-1])
Problem p03723 (python)

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

if a == b == c:
  if a%2 == 0:
    print(-1)
    exit()
  else:
    print(0)
    exit()
ans = 0
while(a%2 == b%2 == c%2 == 0):
  temp_a = (b+c)//2
  temp_b = (a+c)//2
  temp_c = (b+a)//2
  ans += 1
  a = temp_a
  b = temp_b
  c = temp_c
print(ans)

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

if a == b == c:
  if a%2 = 0:
    print(-1)
    exit()
  else:
    print(0)
    exit()
ans = 0
while(a%2 == b%2 == c%2 == 0):
  temp_a = (b+c)//2
  temp_b = (a+c)//2
  temp_c = (b+a)//2
  ans += 1
  a = temp_a
  b = temp_b
  c = temp_c
print(ans)
Problem p02835 (python)

Fixed submission:
a = input()
a = a.split(" ")
sum = 0
for num in a:
    sum += int(num)
if sum >= 22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
a = input()
a = a.split(" ")
for num in range(3):
    a[num] = int(a[num])
sum = sum(a)
if sum >= 22:
    print("bust")
else:
    print(win)

Buggy submission (verdict: Runtime Error):
a = input()
a = a.split(" ")
for num in range(3):
    a[num] = int(a[num])
sum = sum(a)
if sum >= 22:
    print("bust")]
else:
    print(win)
Problem p03012 (python)

Fixed submission:
import sys
input = sys.stdin.readline
import numpy as np

N =int(input())
Ws = [int(i) for i in input().split(" ")]

sub_W = np.sum(Ws)
pre_sub = sub_W
for W in Ws:
  sub_W = sub_W - W*2
  if abs(pre_sub) < abs(sub_W):
    print(abs(pre_sub))
    break
  pre_sub = sub_W

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import numpy

N =int(input())
Ws = np.array([int(i) for i in input().split(" ")])

sub = np.sum(Ws)
# print("sub絶対値：{}".format(abs(sub)))
pre_sub = sub
for W in Ws:
  sub = sub - W*2
#   print("sub絶対値：{}".format(abs(sub)))
#   print("sub={}".format(sub))
  if abs(pre_sub) < abs(sub):
#     print("{}が最小".format(pre_sub))
    print(abs(pre_sub))
    break
  pre_sub = sub
Problem p02847 (python)

Fixed submission:
D=["SUN","MON","TUE","WED","THU","FRI","SAT"]
S=input()

print(7-D.index(S))

Buggy submission (verdict: Runtime Error):
D=["SUN","MON","TUE","WED","THU","FRY","SAT"]
S=input()

print(7-D.index(S))

Buggy submission (verdict: Runtime Error):
D=["SUN","MON","TUE","WED","THU","FRY","SAT"]
S=input()

print(7-D.index(S))

Buggy submission (verdict: Runtime Error):
D=["SUN","MON","TUE","WED","THU","FRY","SAT"]
S=input(int())

print(7-D.index(S))

Buggy submission (verdict: Runtime Error):
D=["SUN","MON","TUE","WED","THU","FRY","SAT"]
S=input(int())

print(7-D.index(D))
Problem p02859 (python)

Fixed submission:
r=int(input())
print(r*r)

Buggy submission (verdict: Runtime Error):
import math

r=input(int())


print(math.pi*r*r/math.pi)
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=int(input())
B=int(input())

C=A*B

if C>81:
	print(-1)
elif C<1:
	print(-1)
else:
	print(C)

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

C=A*B

if C>81:
	print("-1")
elif C<1:
	print("-1")
else:
	print(C)
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)
Problem p02897 (python)

Fixed submission:
N = input()
N = int(N)
if N%2 == 0:
  import math
  a = N/2/N  
  print('{:.6f}'.format(a))
else :
  a = (N+1)/2/N
  print('{:.6f}'.format(a))

Buggy submission (verdict: Runtime Error):
n, k = input().split()
n = int(n) #友人の数
k = int(k) #基準の高さ
h = input().split()
result = 0
#各人の身長を基準の高さと比較
for i in range(n):
  if k <= int(h[i]):
    result += 1
  else:
    result -= 0
print(result)

Buggy submission (verdict: Runtime Error):
n, k = input().split()
n = int(n) #友人の数
k = int(k) #基準の高さ
m = []
result = 0
for i in range(n):
  m.append(int(input()))
#各人の身長を基準の高さと比較
for i in range(len(m)):
  if k <= m[i]:
    result += 1
  else:
    result += 0
print(result)

Buggy submission (verdict: Runtime Error):
n, k = input().split()
n = int(n) #友人の数
k = int(k) #基準の高さ
m = []
result = 0
for i in range(n):
  m.append(int(input().split()))
#各人の身長を基準の高さと比較
for i in range(len(m)):
  if k <= m[i]:
    result += 1
  else:
    result += 0
print(result)
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if c > (a - b):
	print(c - (a - b)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a, b, c = int(input().split())
x = c - (a - b)
print(x)

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

Fixed submission:
import numpy as np

S=input()

half_a=''
half_b=''

if len(S)%2==0:
    half_a=np.array(list(S[int(len(S)/2):]))
    half_b=np.array(list(S[:int(len(S)/2)][::-1]))
    
if len(S)%2==1:
    half_a=np.array(list(S[int(len(S)/2)+1:]))
    half_b=np.array(list(S[:int(len(S)/2)][::-1]))


print(np.sum(half_a!=half_b))

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

S=input()

print(sum(np.array(list(S[int(len(S)/2)+1:]))!=np.array(list(S[:int(len(S)/2)][::-1]))))

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

S=input()

print(sum(np.array(list(S[int(len(S)/2):]))!=np.array(list(S[:int(len(S)/2)][::-1]))))
Problem p02835 (python)

Fixed submission:
nums = [int(e) for e in input().split()]

s = sum(nums)
if s>21:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
in = list(map(int, input().split()))
s = sum(in)
if s>21:
  print('burst')
else:
  print('win')
Problem p02836 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
c = 0
n = len(s)
print(n)
if n%2 == 0:  
	for i in range(n/2):
		if s[i]!=s[-(i+1)]:
			c = c + 1
else:
    for i in range(int((n+1)/2)):
        if s[i]!=s[-(i+1)]:
            c = c + 1
print(c)

Buggy submission (verdict: Runtime Error):
s = input()
c = 0
n = len(s)
if n%2 == 0:  
	for i in range(n/2):
      if s[i]==s[-i]:
        c += 1
else:
  	for i in range((n-1)/2):
      if s[i]==s[-i]:
        c += 1
print(c)
Problem p02847 (python)

Fixed submission:
import numpy as np
s = input()
slist = np.array(['SUN','MON','TUE','WED','THU','FRI','SAT'])
i = np.where(slist==s)[0][0]

print(7-i)

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

ans=[]
for i in range(len(S)):
  s = S[i]
  sind = ord('A') + (ord(s)-ord('A')+ n)%26
  ans.append(chr(sind))

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
slist = [SUN,MON,TUE,WED,THU,FRI,SAT]
i = slist[s]
  
print(7-i)

Buggy submission (verdict: Runtime Error):
s = input()
slist = [SUN,MON,TUE,WED,THU,FRI,SAT]
i = slist[s]
if i == 6:
  i = -1
  
print(slist[i+1])
Problem p02859 (python)

Fixed submission:

r = int(input())

r2 = int(r**2)

print(r2)

Buggy submission (verdict: Runtime Error):

r = int(input())

print({0}.format(r^2))

Buggy submission (verdict: Runtime Error):

r = input()

print(r^2)

Buggy submission (verdict: Runtime Error):

r = input()

r^2
Problem p02860 (python)

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

if n%2 ==0:
    if s[:int(n/2)] == s[int(n/2):]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,s = input().sprit()
n = int(n)
 
if n%2 == 0 :
	if s[:2/n-1] == s[2/n:]:
      print('Yes')
    else:
      print('No')
else:
	print('No')

Buggy submission (verdict: Runtime Error):

n,s = input().sprit()
n = int(n)

if n%2 ==0:
	if s[:2/n-1] == s[2/n:]:
      print('Yes')
    else:
      print('No')
else:
	print('No')
Problem p02847 (python)

Fixed submission:
S=input()

if S=="SUN":
    x=7
elif S=="MON":
    x=6
elif S=="TUE":
    x=5
elif S=="WED":
    x=4
elif S=="THU":
    x=3
elif S=="FRI":
    x=2
elif S=="SAT":
    x=1
    
print(x)

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

if S=="SUN":
    x=7
elif S=="MON":
    x=6
elif S=="TUE":
    x=5
elif S=="WED":
    x=4
elif S=="THU":
    x=3
elif S=="FRI":
    x=2
elif S=="STU":
    x=1
    
print(x)
Problem p03317 (python)

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

import math

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

print(math.ceil((N-1)/(K-1)))

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

import math

N, K = map(int, input().split())
A = np.array(list(map(int, input().split())), dtype=np.int)

print(math.ceil(N-1//K-1))

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

import numpy as np
import sys

N, K = map(int, input().split())
A = np.array(list(map(int, input().split())), dtype=np.int)

arg = 0
op_l = 0
while(True):
    arg_new = arg + K - 1
    op_l += 1
    if np.any(A[arg:arg_new+1] == 1):
        last_arg = (arg, arg_new)
        break
    arg = arg_new

if arg_new == N-1:
    print(op_l)
    sys.exit()

arg = N-1
op_r = 0
while(True):
    arg_new = arg - K + 1
    op_r += 1
    if np.any(A[arg_new:arg+1] == 1):
        if (arg_new, arg) == last_arg:
            op_r -= 1
        break
    if arg_new = last_arg[1]+1:
        break
    arg = arg_new

print(op_l+op_r)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    
    print("red")

Buggy submission (verdict: Runtime Error):
if int(input) >= 3200:
    print(input())
else:
    print("red")
    exit()
Problem p02951 (python)

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

print(max(C - (A - B), 0))

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

print(max(C - (A - B)), 0)
Problem p02835 (python)

Fixed submission:
A0,A1,A2 = (int(x) for x in input().split())

if A0+A1+A2 > 21:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
A1 =int(input())
A2 =int(input())
A3 =int(input())

if A1+A2+A3 > 21:
    print("lose")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
A1=input()
A2=input()
A3=input()

if A1+A2+A3 >21:
    print("lose")
else:
    print("win")