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

Fixed submission:
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*(max([int(i) for i in lst])+1)
p2 = [0]*(max([int(i) for i in lst])+1)
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1)+sorted(p2)[-2] >= sorted(p1)[-2]+max(p2):
		pp2 = p2.index(sorted(p2)[-2])
	else:
		pp1 = p1.index(sorted(p1)[-2])

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1


pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:

	if max(p1) >= max(p2):

		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))


cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*10
p2 = [0]*10
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)
Problem p03284 (python)

Fixed submission:
def diff(n,k):
    if n%k==0:
        return 0
    else:
        return 1

n,k=[int(i) for i in input().split()]
print(diff(n,k))

Buggy submission (verdict: Runtime Error):
def canbuy(n):
    for i in range(int(100/7)):
        tmp = (n-7*i)
        if tmp==0 or (tmp>3 and tmp%4==0):
            return 'Yes'
    return 'No'

n=int(input())
print(canbuy(n))
Problem p03285 (python)

Fixed submission:
def canbuy(n):
    for i in range(int(100/7)):
        tmp = n-7*i
        if tmp==0 or (tmp>3 and tmp%4==0):
            return 'Yes'
    return 'No'

n=int(input())
print(canbuy(n))

Buggy submission (verdict: Runtime Error):
def canbuy(n):
    for i in range(int(100/7)):
        if (n-7*i)>3 and (n-7*i)%4==0:
            return 'Yes'
    return 'No'

n=input()
print(canbuy(n))

Buggy submission (verdict: Runtime Error):
def canbuy(n):
    for i in range(int(100/7)):
        if (n-7*i)%4 == 0:
            return 'Yes'
    return 'No'

n=input()
print(canbuy(n))

Buggy submission (verdict: Runtime Error):
def canbuy(n):
    if n%7==0 or n%4==0:
        return 'Yes'
    else:
        if n<4:
            return 'No'
        else:
            if canbuy(n-7)=='Yes':
                return 'Yes'
            else:
                if canbuy(n-4)=='Yes':
                    return 'Yes'
                else:
                    return 'No'

n=input()
print(canbuy(n))
Problem p02717 (python)

Fixed submission:
i = input()
list1 = i.split()
tmpA = list1[0]
list1[0] = list1[1]
list1[1] = tmpA

tmpA = list1[0]
list1[0] = list1[2]
list1[2] = tmpA
print(list1[0] + " " + list1[1] + " " + list1[2])

Buggy submission (verdict: Runtime Error):
i = input()
list1 = i.split()
tmpA = list1[0]
list1[0] = list1[1]
list1[1] = tmpA

tmpA = list1[0]
list1[0] = list1[2]
list1[2] = tmpA
print(list1[0] + " " + list1[1] + " " + list1[2]
Problem p03071 (python)

Fixed submission:
a,b=map(int,input().split())
if abs(a - b) <= 1:
    print(a + b)
else:
    if a > b:
        print(a + a -1)
    else:
        print(b + b -1)

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

Fixed submission:
#!/usr/bin/env python

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

if a == b:
    print(c)
elif b == c:
    print(a)
elif c == a:
    print(b)
else:
    pass

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

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

if a == b:
    print(c)
elif b == c:
    print(a)
elif c == a:
    print(b)
else
    pass
Problem p03693 (python)

Fixed submission:
#!/usr/bin/env python3

r, g, b = map(int, input().split())
num = (100 * r) + (10 * g) + (1 * b)

if num % 4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

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

print(max(a) - min(a))
Problem p03694 (python)

Fixed submission:
#!/usr/bin/env python3
 
N = int(input())
a = list(map(int, input().split()))
 
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

a = [ int(input()) for i in range(int(input())) ]

print(max(a)-min(a))
Problem p03697 (python)

Fixed submission:
#!/usr/bin/env python3

x = input().split()

A = int(x[0])
B = int(x[1])

if (A+B) < 10:
    print(A+B)
else:
    print("error")

Buggy submission (verdict: Runtime Error):
import math
 
def check(x):
    k = 0
    global h, a, b
    for i in h:
        if x * b < i:
            k += math.ceil((i - x * b) / (a - b))
    return k <= x
 
 
n, a, b = map(int, input().split())
h = []
for i in range(n):
    h.append(int(input()))
l = -1
r = max(h) // b + 1
while r - l > 1:
    m = (l + r) // 2
    if check(m):
        r = m
    else:
        l = m
print(r)
Problem p03997 (python)

Fixed submission:
x = [input() for i in range(3)]

a = int(x[0])
b = int(x[1])
h = int(x[2])

y=((a + b) * h) / 2
ans=int(y)
print(ans)

Buggy submission (verdict: Runtime Error):
a=input().split()
b=input().split()
h=input().split()

ans=((a + b) * h) / 2

print(ans)
Problem p02780 (python)

Fixed submission:
#At coder 2020/2/9 D
#import numpy as np

# 入力
N,K= map(int, input().split())
p = list(map(int, input().split())) 
#p2 = sorted(p, reverse=True)
#print(p2)
kk=[0] * (N-K+1)
#p=np.array(p)
kk[0]=sum(p[0:K])
for ii in range(1,N-K+1):
    kk[ii]=kk[ii-1]-p[ii-1]+p[K+ii-1]
kk=max(kk)
K=float(K)
kk=float(kk)
ans=0.5*(kk+K)

print(ans)

Buggy submission (verdict: Runtime Error):
#At coder 2020/2/9 D
#import numpy as np

# 入力
N,K= map(int, input().split())
p = list(map(int, input().split())) 
#p2 = sorted(p, reverse=True)
#print(p2)
kk=[0] * (N-K+1)
#p=np.array(p)
if N==K:
    kk=sum(p)
else:
    for ii in range(N-K+1):
        kk[ii]=sum(p[ii:K+ii])
kk=max(kk)
K=float(K)
kk=float(kk)
ans=0.5*(kk+K)

print(ans)

Buggy submission (verdict: Runtime Error):
#At coder 2020/2/9 D
import numpy as np

# 入力
N,K= map(int, input().split())
p = list(map(int, input().split())) 
#p2 = sorted(p, reverse=True)
#print(p2)
kk=[0] * (N-K+1)
p=np.array(p)
if N==K:
    kk=sum(p)
else:
    for ii in range(N-K+1):
        kk[ii]=np.sum(p[ii:K+ii])
kk=max(kk)
K=float(K)
kk=float(kk)
ans=0.5*(kk+K)

print(ans)

Buggy submission (verdict: Runtime Error):
#At coder 2020/2/9 D

# 入力
N,K= map(int, input().split())
p = list(map(int, input().split())) 
#p2 = sorted(p, reverse=True)
#print(p2)
kk=[0] * (N-K+1)

if N==K:
    kk=sum(p)
else:
    for ii in range(N-K+1):
        kk[ii]=sum(p[ii:K+ii])
kk=max(kk)
K=float(K)
kk=float(kk)
ans=0.5*(kk+K)

print(ans)
Problem p02789 (python)

Fixed submission:
a = [int(i) for i in input().split()]
if a[0] == a[1]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a = [int(i) for i in input().split()]
if a[0] == a[1]:
  print('Yes')
else
  print('No')
Problem p02719 (python)

Fixed submission:
import math
 
N, K = map(int, input().split())
mod = N % K
  
if abs(mod-K) < mod:
  mod = abs(mod-K)
  
print(mod)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
K = int(input())
mod = N % K
  
if(abs(mod-K) < mod)
  mod = abs(mod-K);
  
print(mod)
Problem p02717 (python)

Fixed submission:
in_ = input()
a, b, c = map(int, in_.split())
b2 = a
c2 = b
a2 = c
print(a2, b2, c2)

Buggy submission (verdict: Runtime Error):
import sys
a, b, c = map(int, sys.argv[1:])
b2 = a
c2 = b
a2 = c
print(a2, b2, c2)

Buggy submission (verdict: Runtime Error):
a, b, c = input
b2 = a
c2 = b
a2 = c
print(a2, b2, c2)
Problem p02724 (python)

Fixed submission:
X = int(input())

a = int(X / 500)
b = X % 500
c = int(b / 5)
print(a * 1000 + c * 5)

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

a = X / 500
b = X % 500
c = b / 5
    
print(a * 1000 + c * 5)

Buggy submission (verdict: Runtime Error):
a = X / 500
b = X % 500
c = b / 5
    
print(a * 1000 + c * 5)
Problem p02910 (python)

Fixed submission:
def main():
    result = 'Yes'
    S = str(input())
    for i in range(len(S)):
        if i % 2 == 0:
            if S[i] == 'L':
                result = 'No'
                break
        else:
            if S[i] == 'R':
                result = 'No'
                break
    print(result)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    result = 'Yes'
    S = str(input())
    for i in range(len(S)):
        if(i%2==0):#index=0は1文字目なので奇数ルール
            if(S[i]=='L'):
                result = 'No'
                break
        else:#偶数ルール
            if(S[i]=='R'):
                result = 'No'
                breakpoint
    print(result)

if __name__ == "__main__":
    main()
Problem p02742 (python)

Fixed submission:
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil((H * W) / 2))

Buggy submission (verdict: Runtime Error):
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil((H * W) / 2))
import math
H, W = map(int, input().split())

print(math.ceil((H * W) / 2))
Problem p02783 (python)

Fixed submission:
a, b = map(int, input().split())
ans  = -(-a//b)
print(ans)

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split())
a = map(int, input().split())
ans = "Yes" if sum(a) >= h else "No" 
print(ans)
Problem p03101 (python)

Fixed submission:
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
h,w = map(int,input().split())
prin((H-h)*(W-w))
Problem p03145 (python)

Fixed submission:
a,b,c = map(int, input().split())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
a,c = map(int, input().split())
print(a*c*//2)

Buggy submission (verdict: Runtime Error):
a,c = map(int, input().split())
print(a*c*1/2)
Problem p03219 (python)

Fixed submission:
x, y =map(int, input().split())
print(x+y//2)

Buggy submission (verdict: Runtime Error):
x = int(input())
y = int(input())
print(x + (y//2))
Problem p03598 (python)

Fixed submission:
N = int(input())
K = int(input())
X = list(map(int, input().split()))
minSum = 0
for i in X:
    minSum += min(i, K - i) * 2
print(minSum)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
X = list(map(int, input()))
minSum = 0
for i in X:
    minSum += min(i, K - i) * 2
print(minSum)
Problem p03657 (python)

Fixed submission:
a, b= map(int, input().split())
if a%3 == 0:
  print("Possible")
elif b%3 == 0:
  print("Possible")
elif (a+b)%3 == 0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
a, b= map(int, input().split())
x = False
for i in [a, b, a+b]:
  if i%3 == 0:
    x = True
print("Possible" if x else "Impossible"
Problem p02756 (python)

Fixed submission:
s = input()
q = int(input())
q1 = [list(map(str,input().split())) for i in range(q)]

ap = ["", ""]
revCount = 0

for j in q1:
  if j[0] == "1":
    revCount = revCount ^ 1

  else:
    ind = revCount ^ int(j[1]) - 1
    ap[ind] = ap[ind] + j[2]

if revCount == 0:
  ap[0] = ap[0][::-1]
  print(ap[0] + s + ap[1])

else:
  aps = (s+ap[1])[::-1]
  print(aps + ap[0])

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
q1 = [list(map(str,input().split())) for i in range(q)]

ap = ["", ""]
revCount = 0

for j in q1:
  if j[0] == "1":
    revCount = (revCount+1) % 2

  else:
    if revCount == 0:
      ap[j[1] - 1] = ap[j[1] - 1] + j[2]
    else:
      ap[j[1] - 2] = ap[j[1] - 2] + j[2]
        

if revCount == 0:
  ap[0] = ap[0][::-1]
  print(ap[0] + s + ap[1])

else:
  aps = (s+ap[1])[::-1]
  print(aps + ap[0])
Problem p02866 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
ans = 1
t = 1
if n == 1:
  if l[0] == 0:
    print(1)
  else:
    print(0)
 
elif n == 2:
  if l[0] ==0 and l[1] == 1:
    print(1)
  else:
    print(0)
 
else:
  if l[0] != 0:
    print(0)
  else:
    a = [0]*n
    for i in range(n):
      a[l[i]] += 1
 
    if a[0] != 1:
      print(0)
    else:
      for i in range(n-1):
        if a[i]==0 and a[i+1]!=0:
          t = 0
          
        elif a[i]!=0 and a[i+1]!=0:
          ans = ans * (a[i]**a[i+1])
      if t == 1:
        print(ans%998244353)
      else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
ans = 1
if n == 1:
  if l[0] == 0:
    print(1)
  else:
    print(0)

elif n == 2:
  if l[0] ==0 and l[1] == 1:
    print(1)
  else:
    print(0)

else:
  if l[0] != 0:
    print(0)
  else:
    a = [0]*n
    for i in range(n):
      a[l[i]] += 1

    if a[0] != 1:
      print(0)
    else:
      for i in range(n-1):
        if a[i]!=0 and a[i+1]!=0:
          ans = ans * (a[i]**a[i+1])
        else:
          break

      print(ans%n = int(input())
l = list(map(int,input().split()))
ans = 1
if n == 1:
  if l[0] == 0:
    print(1)
  else:
    print(0)

elif n == 2:
  if l[0] ==0 and l[1] == 1:
    print(1)
  else:
    print(0)

else:
  if l[0] != 0:
    print(0)
  else:
    a = [0]*n
    for i in range(n):
      a[l[i]] += 1

    if a[0] != 1:
      print(0)
    else:
      for i in range(n-1):
        if a[i]!=0 and a[i+1]!=0:
          ans = ans * (a[i]**a[i+1])
        else:
          break

      print(ans%998244353)
Problem p02924 (python)

Fixed submission:
n=int(input())

print(int((n-1)*n//2))

Buggy submission (verdict: Runtime Error):
n=int(input())
if n==1:
  print(0):
else:
  print(int((n-1)*n/2))
Problem p02994 (python)

Fixed submission:
n,l=map(int,input().split())
li=[]
for i in range(1,n+1):
  li.append(l+i-1)
print(sum(li)-[i for i in li if abs(i)==min(list(map(abs,li)))][0])

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
li=[]
for i in range(1,n+1):
  li.append(l+i-1)
print(sum(li)-li[li.index(min(list(map(abs,li))))])
Problem p03001 (python)

Fixed submission:
W,H,x,y=map(int,input().split())
if float(x)==W/2 and float(y)==H/2:
  print(W*H/2,1)
else:
  print(W*H/2,0)

Buggy submission (verdict: Runtime Error):
W,H,x,y=map(int,input().split())
if x,y==int(W/2),int(H/2):
  print(W*H,1)
else:
  print(W*H,0)
Problem p03274 (python)

Fixed submission:
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
if k==n:
  q.append(li[n-1]-li[0]+min(abs(li[n-1]),abs(li[0])))
else:
  for i in range(k,n+1):
    if li[i-1]<0:
      q.append(-li[i-k])
    elif li[i-k]>0:
      q.append(li[i-1])
    else:
      q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
for i in range(k,n):
  if li[i-1]<=0:
    q.append(-li[i-k])
  elif li[i-k]>=0:
    q.append(li[i-1])
  else:
    q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
for i in range(k,n):
  if li[i-1]<0:
    q.append(-li[i-k])
  elif li[i-k]>0:
    q.append(li[i-1])
  else:
    q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=list(map(int,input().split()))
q=[]
for i in range(k,n):
  if i<0 or i-k+1>0:
    q.append(li[i-1]-li[i-k])
  else:
    q.append(li[i-1]-li[i-k]+min(li[i-1],abs(li[i-k])))
print(min(q))
Problem p03434 (python)

Fixed submission:
n=int(input())
li=list(map(int,input().split()))
li.sort()
a=[]
b=[]
for i in range(n):
  if n%2==1:
    if i%2==0:
      a.append(li[i])
    else:
      b.append(li[i])
  else:
    if i%2==0:
      b.append(li[i])
    else:
      a.append(li[i])
print(sum(a)-sum(b))

Buggy submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))
li.sort
a=[]
b=[]
for i in range(n):
  if n%2==1:
    if i%2==0:
      a.append(li[i])
    else:
      b.appemd(li[i])
  else:
    if i%2==0:
      b.append(li[i])
    else:
      a.append(li[i])
print(sum(a)-sum(b))

Buggy submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))
li.sort
a=[]
b=[]
for i in range(n):
  if n%2==1:
    if i%2==0:
      a.append(li[i])
    else:
      b.appemd(li[i])
  else:
    if i%2==0:
      b.append(li[i])
    else:
      a.append(li[i])
print(sum(a)-sum(b))
Problem p03470 (python)

Fixed submission:
n=int(input())
li=[input() for i in range(n)]
li.sort()
ans=1
if n==1:
  print(1)
else:
  for i in range(n-1):
    if li[i+1] > li[i]:
      ans+=1
  print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
li=[input() for i in range(n)]
li.sort()
ans=0
if n=1:
  print(1)
else:
  for i in range(n-1):
    if li[i+1] > li[i]:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
li=[input() for i in range(n)]
li.sort()
ans=0
if n=1:
  print(1)
else:
  for i in range(n-1):
    if li[i+1] > li[i]:
      ans+=1
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
a=int(input())
print(a.count("1"))

Buggy submission (verdict: Runtime Error):
a=int(input())
print(a.count(1))
Problem p02801 (python)

Fixed submission:
c = input()
import string
alphStr = string.ascii_lowercase
alph = alphStr.index(c)
print(alphStr[alph+1])

Buggy submission (verdict: Runtime Error):
c = input()
import string
alphStr = string.ascii_lowercase
print(alphStr.index(c)[alph+1])
Problem p02817 (python)

Fixed submission:
s, t = map(str, input().split())

print(str(t+s))

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

if a-k>=0:
    print(int(a-k),int(b))
elif a+b<k:
    print(0,0)
else:
    print(0,int(a+b-k))
Problem p02780 (python)

Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = np.array(input().split(), dtype=int)
# 期待値に変換
Q = P/2 + 0.5
# 累積和をとる
S = Q.cumsum()
# K範囲での最大値
if N == K:
    print(S[-1])
else:
	T = S[K:] - S[:-K]
	print(max(T))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
P = np.array(input().split(), dtype=int)
# 期待値に変換
Q = P/2 + 0.5
# 累積和をとる
S = Q.cumsum()
# K範囲での最大値
T = S[K:] - S[:-K]

print(max(T))
Problem p02909 (python)

Fixed submission:

Weather = input()

if Weather == 'Sunny' :
  print('Cloudy')
elif Weather == 'Cloudy' :
  print('Rainy')
else :
  print('Sunny')

Buggy submission (verdict: Runtime Error):
import sys

Weather = input()

if Weather = 'Sunny' :
  print('Cloudy')
elif Weather = 'Cloudy' :
  print('Rainy')
else :
  print('Sunny')
Problem p02717 (python)

Fixed submission:
X, Y, Z = map(int, input().split())
print (Z, X, Y)

Buggy submission (verdict: Runtime Error):
X, Y, Z = input()
print(Z X Y)
Problem p02747 (python)

Fixed submission:
# coding:utf8
S = input()

if S == "hi" or S =="hihi" or S=="hihihi" or S=="hihihihi" or S=="hihihihihi":
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
# coding:utf8
S = input()

if S == hi or S ==hihi or S=hihih or S=hihihihi or S=hihihihihi:
    print("Yes")
else :
    print("No")
Problem p02755 (python)

Fixed submission:
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==int(i*0.1) :
    print(i)
    exit()
print("-1")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==int(i*0.1) :
    print(i)
    exit()
plint("-1")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==(i*0.1) :
    print(i)
    exit()
plint("-1")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
N<10000
N*8/100==A
N*10/100==B
print(N)
Problem p02909 (python)

Fixed submission:
S=input()

if S=="Sunny" :
  print("Cloudy")
else :
  if S=="Cloudy" :
    print("Rainy")
  else :
    print("Sunny")

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

if S=="Sunny" :
  print("Cloudy")
else :
  if S=="Cloudy" :
    print("Rainy")
  else S="Rainy" :
    print("Sunny")
Problem p03294 (python)

Fixed submission:
input()
ip = input().split()
data = []
ans = 0
for i in ip:
    ans += int(i) - 1

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(x,y):
    if x > y:
        a = x
        b = y
    else:
        a = y
        b = x
    while a % b != 0:
        b = a % b
        a = b
    return b

input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))


def lcmbase(x, y):
    return x * y / gcd(int(x), int(y))

def lcm(num):
    buf = num[0]
    for i in range(1, len(num)):
        buf = lcmbase(num[i], buf)
    return buf

usedata = int(lcm(data) - 1)

suming = 0
for i in data:
    suming += usedata % i

print(suming)

Buggy submission (verdict: Runtime Error):
import math

input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))


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

def lcm(num):
    buf = num[0]
    for i in range(1, len(num)):
        buf = lcmbase(num[i], buf)
    return buf

usedata = int(lcm(data) - 1)

suming = 0
for i in data:
    suming += usedata % i

print(suming)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))

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

def lcm(num):
    return reduce(lcmB,num)

print(int(lcm(data) - 1))