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

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
co=0
for i in range(len(B)):
    co+=B[i]
for j in range(len(C)):
    if A[j+1]==A[j]+1:
        co+=C[A[j]-1]
print(co)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
co=0
for i in range(len(B)):
    co+=B[i]
for j in range(len(C)):
    if A[j+1]==A[j]+1:
        co+=C[A[j]]
print(co)
Problem p02987 (python)

Fixed submission:
s=input()
s2=sorted(s)
if s2[0]==s2[1] and s2[2]==s2[3] and s2[1]!=s2[2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=input()
s2=sorted(s)
if s2[0]==s2[1] and s2[2]==s2[3] and s2[1]!=s2[2]
  print('Yes')
else:
  print('No')
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
a = set()
for i in range(m):
    a.add(int(input()))

b = [0] * (n + 1)
b[0] = 1
if 1 not in a:
    b[1] = 1
for i in range(2, n + 1):
    if i in a:
        b[i] = 0
    else:
        b[i] = b[i - 1] + b[i - 2]
print(b[n] % 1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split()))
a=[int(input()) for i in range(m)]
b=[0]*(n+1)
b[0]=1
if 1 not in a:
    b[1]=1
for i in range(2,n+1):
    if i in a:
        b[i]=0 #0の代入で2連続以上の場合もカバー
    else:
        b[i]=b[i-1]+b[i-2]
print(b[-1]%1000000007)
Problem p02689 (python)

Fixed submission:
import numpy as np
import copy

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    maxH  = np.zeros(N)

    for itr in range(M):
        A, B = list(map(int, input().split()))
        if H[A- 1] == H[B- 1] :
            maxH[A- 1] = copy.copy(H[A- 1]) + 1
            maxH[B- 1] = copy.copy(H[A- 1]) + 1
        elif H[A- 1] > H[B- 1] :
            if maxH[A- 1] < H[A- 1] :
                maxH[A- 1] = copy.copy(H[A- 1])
            if maxH[B- 1] < H[A- 1] :
                maxH[B- 1] = copy.copy(H[A- 1])
        elif H[A- 1] < H[B- 1] :
            if maxH[A- 1] < H[B- 1] :
                maxH[A- 1] = copy.copy(H[B- 1])
            if maxH[B- 1] < H[B- 1] :
                maxH[B- 1] = copy.copy(H[B- 1])
    
    result = 0
    for itr in range(N):
        if H[itr] == maxH[itr] or maxH[itr] == 0:
            result += 1
    #print(maxH)
    print(result)

if __name__ == "__main__":
    main()

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

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    edges = np.zeros((N, N))
        
    for itr in range(M):
        A, B = list(map(int, input().split()))
        edges[A- 1][B- 1] = H[B- 1]
        edges[B- 1][A- 1] = H[A- 1]
    
    result = 0
    for itr in range(N):
        count = 1
        for inner_itr in range(N):
            if edges[itr][inner_itr] >= H[itr] :
                count = 0
                break
        result += count
        #print(itr, result, H[itr])
    
    print(result)
    #print(edges)

if __name__ == "__main__":
    main()

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

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    edges = np.zeros((N, N))
        
    for itr in range(M):
        A, B = list(map(int, input().split()))
        if H[A - 1] >= H[B- 1] :
            edges[A - 1][B- 1] = H[A- 1]
            edges[B - 1][A- 1] = H[B- 1]
        else :
            edges[A - 1][B- 1] = H[B- 1]
            edges[B - 1][A- 1] = H[A- 1]
    
    result = 0
    for itr in range(N):
        count = 1
        for inner_itr in range(N):
            if edges[itr][inner_itr] >= H[itr] :
                count = 0
                break
        result += count
    
    print(result)

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

Fixed submission:
import collections
S=[]
N=int(input())
for i in range(N):
    S.append(input())
print(len(collections.Counter(S)))

Buggy submission (verdict: Runtime Error):
mport collections
S=[]
N=int(input())
for i in range(N):
    S.append(input())
print(len(collections.Counter(S)))
Problem p02766 (python)

Fixed submission:
N,K=(int(x) for x in input().split())
b=1
a=1
if N==1:
    print(1)
else:
     while a<=N:
          b=b+1
          a=K**b
     else:
          print(b)

Buggy submission (verdict: Runtime Error):
N,K=(int(x) for x in input().split())
b=1
a=1
If N=1:
    print(1)
else:
     while a<=N:
          b=b+1
          a=K**b
     else:
          print(b)

Buggy submission (verdict: Runtime Error):
N,K=(int(x) for x in input().split())
b=1
a=1
while a=<N:
    b=b+1
    a=K**b
else:
     print(b)
Problem p03011 (python)

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

P=list(map(int,input().split()))
print(sum(P)-max(P))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [ int(input()) for _ in range(m)]
M=10**9+7
lis = [1] + [0]*n

for i in a:
  lis[i]=-1
lis[1] += 1
for i in range(n-1):
  if lis[i+2]<0:
    lis[i+2]= 0
  else:
    lis[i+2] = (lis[i+1] + lis[i])%M
print(lis[n])
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
a = [ int(input()) for _ in range(m)]
M=10**9+7
lis = [1] + [0]*n

for i in a:
  lis[i]=-1
lis[1] += 1
for i in range(n-1):
  if lis[i+2]<0:
    lis[i+2]= 0
  else:
    lis[i+2] = (lis[i+1] + lis[i])%M
print(lis[n])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int,input().split()))
lis = [1] + [0]*n

for i in a:
  lis[i]=-1
lis[1] += 1
for i in range(n-1):
  if lis[i+2]==-1:
    lis[i+2]= 0
  else:
    lis[i+2] = lis[i+1] + lis[i]
print(lis[n]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int,input().split()))
lis = [1] + [0]*n

for i in a:
  lis[i]=-1
lis[1] += 1
for i in range(n-1):
  if lis[i+2]==-1:
    lis[i+2]= 0
  else:
    lis[i+2] = lis[i+1] + lis[i]
print(lis[n])

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
N,M = list(map(int,input().split()))
A = [int(input()) for _ in range(M)]
 
a2 = 1
a1 = 0 if 1 in A else 1
i = 1
def stair(stepb2,stepb1):
    global i
    i+=1
    step = stepb2 + stepb1
    
    if i in A:
        step = 0
    if i == N:
        print(step%1000000007)
        return step
    else:
        stair(stepb1,step)
if N == 1:
    print(a1)
else:
    _ = stair(a2,a1)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
N,M = list(map(int,input().split()))
A = [int(input()) for _ in range(M)]
 
a2 = 1
a1 = 0 if 1 in A else 1
i = 1
def stair(stepb2,stepb1):
    global i
    i+=1
    step = stepb2 + stepb1
    
    if i in A:
        step = 0
    if i == N:
        print(step%1000000007)
        return step
    else:
        stair(stepb1,step)
_ = stair(a2,a1)

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

N,M = list(map(int,input().split()))
A = [int(input()) for _ in range(M)]

a2 = 1
a1 = 0 if 1 in A else 1 
for i in range(2,N+1):
    a = 0 if a in A else (a2+a1)%1000000007
    a2 = a1
    a1 = a
print(1 if N == 1 else a%1000000007)
Problem p03038 (python)

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

def sol():
    N,M = list(map(int,input().split()))
    A = list(map(int,input().split()))
    tmp = sorted([list(map(int,input().split())) for _ in range(M)],key = lambda x:-x[1])

    t = []
    for a,b in tmp:
        t+=[b]*a
        
        if len(t) >=N:
            break

    A += t
    A.sort(reverse = 1)
    print(sum(A[:N]))

if __name__ == '__main__':
    sol()

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

N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
Amin = min(A)
tmp = []
for _ in range(M):
    a,b= list(map(int,input().split()))
    if b>=Amin:
        tmp.append([a,b])

tmp = sorted(tmp,key = lambda x:-x[1])
cnt = 0
t = []
if tmp != []:
    for i in range(M):
        t=t+[tmp[i][1]]*tmp[i][0]
        cnt+= tmp[i][0]
        if cnt >=N:
            break
A = sorted(A+t,reverse = 1)

print(sum(A[:N]))

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

N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
Amin = min(A)
tmp = []
for _ in range(M):
    a,b= list(map(int,input().split()))
    if b>=Amin:
        tmp.append([a,b])

tmp = sorted(tmp,key = lambda x:-x[1])
cnt = 0
t = []
for i in range(M):
    t=t+[tmp[i][1]]*tmp[i][0]
    cnt+= tmp[i][0]
    if cnt >=N:
        break
A = sorted(A+t,reverse = 1)

print(sum(A[:N]))
Problem p03041 (python)

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

for i in range(len(S)):
    if i != K-1:
        print(S[i],end='')
    else:
        print(chr(ord(S[i])+32),end="")

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

S = list(input())

S[K] = chr(ord(S[K])+32)

print(''.join(S))

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

S = list(input())

S[K] = S[K].lower()

print(''.join(S))

Buggy submission (verdict: Runtime Error):
N,K=list(map(int,input().split()))
S = list(input())
S[K]=S[K].lower()
print("".join(S))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N,K=list(map(int,input().split()))
S = list(input().rstrip())
S[K]=S[K].lower()
print("".join(S))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N,K=list(map(int,input().split()))
S = list(input().rstrip())
S[K]=S[K].lower()
print("".join(S))
Problem p03346 (python)

Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
P = [int(input()) for _ in range(N)]

Q = [0]*(N)
for i in range(N):
    Q[P[i]-1]=i

cnt = 1
ans = 1
for i in range(N-1):
    if Q[i+1]>Q[i]:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 1
ans = max(ans,cnt)
print(N-ans)

Buggy submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
P = [int(input()) for _ in range(N)]

cnt = 0
if P[0] == 1:
    isFirstNum = 1
else:
    isFirstNum = 0
    cnt +=1

if P[-1] == N:
    isLastNum = 1
else:
    isLastNum = 0
    cnt +=1
    
isBefore = 0
isAfter = 0

P.remove(1)
P.remove(N)


for i in range(len(P)-1):
    if P[i]>P[i+1]:
        cnt += 1
        if N-P[i]<=P[i+1]-1:
            isAfter = 1
        else:
            isBefore = 1

ope = cnt+isBefore*isFirstNum+isAfter*isLastNum

print(ope)

Buggy submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
P = [int(input()) for _ in range(N)]

cnt = 0
if P[0] == 1:
    isFirstNum = 1
else:
    isFirstNum = 0
    cnt +=1

if P[-1] == N:
    isLastNum = 1
else:
    isLastNum = 0
    cnt +=1
    
isBefore = 0
isAfter = 0

P.remove(1)
P.remove(N)


for i in range(len(P)-1):
    if P[i]>P[i+1]:
        cnt += 1
        if P[i]>N//2:
            isAfter = 1
        else:
            isBefore = 1

ope = cnt+isBefore*isFirstNum+isAfter*isLastNum

print(ope)
Problem p03426 (python)

Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

H,W,D=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(H)]
Q = int(input())
LR=[list(map(int,input().split())) for i in range(Q)]


dict_map = {}
for ih in range(H):
    for iw in range(W):
        dict_map[A[ih][iw]]=(ih,iw)

memo = [-1]*(H*W+1)
for i in range(1,D+1):
    useMP = 0
    direct = range(i,H*W+1,D)
    memo[i]=0
    for p in range(len(direct)-1):
        x0,y0 = dict_map[direct[p]]
        x1,y1 = dict_map[direct[p+1]]
        dist = abs(x0-x1)+abs(y0-y1)
        useMP += dist
        memo[direct[p+1]]=useMP

for q in range(Q):
    L,R=LR[q]
    print(memo[R]-memo[L])

Buggy submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

H,W,D=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(H)]
Q = int(input())
LR=[list(map(int,input().split())) for i in range(Q)]


dict_map = {}
for ih in range(H):
    for iw in range(W):
        dict_map[A[ih][iw]]=(ih,iw)

memo = [[-1]*(W*H+1) for _ in range(W*H+1)]

for i in range(Q):
    L = LR[i][0]
    R = LR[i][1]
    useMP = 0
    if memo[L][R] == -1:
        point = range(L,R+1,D)
        for p in range(1,len(point)):
            x0,y0 = dict_map[point[p-1]]
            x1,y1 = dict_map[point[p]]
            useMP += abs(x0-x1)+abs(y0-y1)
            memo[(point[p-1])][point[p]]=abs(x0-x1)+abs(y0-y1)
        memo[L][R]=useMP 
          
    else:
        useMP = memo[L][R]
    print(useMP)
Problem p03464 (python)

Fixed submission:
import sys,math,collections,itertools
input = sys.stdin.readline

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

min_child = 2
max_child = 2

for i in range(K-1,-1,-1):
    if math.ceil(min_child/A[i])>0 and math.floor(max_child/A[i])>0 and math.floor(max_child/A[i])-math.ceil(min_child/A[i])>=0:
        min_child = math.ceil(min_child/A[i])*A[i]
        max_child =math.floor(max_child/A[i])*A[i]+A[i]-1
    else:
        print(-1)
        exit()
print(min_child,max_child)

Buggy submission (verdict: Runtime Error):
import sys,math,collections,itertools
input = sys.stdin.readline

K=int(input())
A=list(map(int,input().split()))[::-1]

ans =2
for i in range(1,K):
    if A[i] >= A[i-1]*2:
        print(-1)
        exit()
    elif A[i-1]<=A[i]<A[i-1]*2:
        ans = A[i]
    elif A[i-1]>A[i]:
        ans = math.ceil(A[i-1]/A[i])*A[i]

print(ans,ans+A[i]-1)
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
S, W = map(int, input().split())
if W >= S:
	print(unsafe)
else:
	print(safe)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
while A % B != 0:
	A, B = B, A % B
G = B
ans = 1
list = [2]
for i in range(3, G + 1):
	chk = True
	for j in list:
		if i % j == 0:
			chk = False
	if chk == True:
		list.append(i)
for k in list:
	if G % k == 0:
		ans += 1
print(ans)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
L = []
for i in range(M):
	b, c = map(int, input().split())
	L.append((c, b))
L = sorted(L, reverse = True)
L.append((0, N))
temp = 0
sum = 0
for i in range(M + 1):
	for j in range(L[i][1]):
		if A[temp] < L[i][0]:
			sum += L[i][0]
			temp += 1
		else:
			sum += A[temp]
			temp += 1
		if temp == N:
			break
	if temp == N:
		break
print(sum)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
L = []
for i in range(M):
	b, c = map(int, input().split())
	for j in range(b):
		L.append(c)
list.sort(L, reverse = True)
if len(L) >= N:
	L = L[:N]
else:
	L.append(0 * (N - len(L)))
i = 0
while L[i] >= A[i] and i < N:
	i += 1
x = sum(L[:i]) + sum(A[i:])
print(x)
Problem p03137 (python)

Fixed submission:
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M:
	print(0)
else:
	X.sort()
	Y = [0] * (M - 1)
	for i in range(M - 1):
		Y[i] = X[i+1] - X[i]
	Y.sort(reverse = True)
	print(max(X) - min(X) - sum(Y[:N - 1]))

Buggy submission (verdict: Runtime Error):
from collections import deque
N, M = map(int, input().split())
X = deque(map(int, input().split()))
if N >= M:
	print(0)
else:
	X.sort()
	x = 0
	y = deque([0] * (N - 1))
	for i in range(M - 1):
		a = X[i+1] - X[i]
		b = min(y)
		if a > b:
			y.remove(b)
			y.append(a)
			x += b
		else:
			x += a
	print(x)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M:
	print(0)
else:
	X.sort()
	x = 0
	y = [0] * (N - 1)
	for i in range(M - 1):
		a = X[i+1] - X[i]
		b = min(y)
		if a > b:
			y.remove(b)
			y.append(a)
			x += b
		else:
			x += a
	print(x)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
x = 0
y = [0] * (N - 1)
for i in range(M - 1):
	a = X[i+1] - X[i]
	b = min(y)
	if a > b:
		y.remove(b)
		y.append(a)
		x += b
	else:
		x += a
print(x)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
y = []
if M == 1:
	print(0)
else:
	for i in range(M - 1):
		y.append(X[i+1] - X[i])
	for i in range(N - 1):
		y.remove(max(y))
	print(sum(y))
Problem p03221 (python)

Fixed submission:
N, M = map(int, input().split())
l = [None] * M
for i in range(M):
	p, y = map(int, input().split())
	l[i] = [p, y, i]
l.sort()
ans = []
t = l[0][0]
x = 0
for i in l:
	if t == i[0]:
		x += 1
		ans.append([i[2], i[0], x])
	else:
		t = i[0]
		x = 1
		ans.append([i[2], i[0], x])
ans.sort()
for i in ans:
	p = str(i[1])
	x = str(i[2])
	print('0' * (6 - len(p)) + p + '0' * (6 - len(x)) + x)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
l = [None] * M
for i in range(M):
	p, y = map(int, input().split())
	l[i] = [p, y, i]
l.sort()
ans = []
t = l[0][0]
x = 0
for i in l:
	if t == i[0]:
		x += 1
		ans.append([l[2], i[0], x])
	else:
		t = i[0]
		x = 1
		ans.append([l[2], i[0], x])
ans.sort()
for i in ans:
	p = str(i[1])
	x = str(i[2])
	print('0' * (6 - len(p)) + p + '0' * (6 - len(x)) + x)
Problem p02549 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b
def ceil(x):
    return math.ceil(x)
def floor(x):
    return math.floor(x)


def main():
    MOD = 998244353
    N, K = map(int, input().split())
    L = [0] * K
    R = [0] * K
    for i in range(K):
        L[i], R[i] = map(int, input().split())

    dp = [0] * (N + 1)
    dpsum = [0] * (N + 1)
    dp[1] = 1
    dpsum[1] = 1
    for i in range(2, N + 1):
        for j in range(K):
            li = i - R[j]
            li = max(li, 1)
            ri = i - L[j]
            if ri < 0:
                continue
            dp[i] += (dpsum[ri] - dpsum[li - 1]) % MOD
        dpsum[i] += (dpsum[i - 1] + dp[i]) % MOD
    print(dp[N] % MOD)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b
def ceil(x):
    return math.ceil(x)
def floor(x):
    return math.floor(x)

def main():
    mod = 998244353
    N, K = map(int, input().split())
    L = [0] * K
    R = [0] * K
    for i in range(K):
        L[i], R[i] = map(int, input().split())

    S = set()
    for i in range(K):
        for j in range(L[i], R[i] + 1):
            S.add(j)

    dp = [0] * N
    dp[0] = 1
    for s in S:
        dp[s] += 1
    for i in range(N):
        if dp[i] != 0:
            for s in S:
                if i + s <= N - 1:
                    dp[i + s] += 1
    print(dp[N - 1] % mod)


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

Fixed submission:
alpha = input()

upper = ["A", "B", "C", "D", 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
lower = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

if alpha in upper:
    print("A")
else:
    print("a")

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

upper = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
lower = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]

if alpha in upper:
    print("A")
else:
    print("a")
Problem p02689 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    A = [0] * M
    B = [0] * M
    for i in range(M):
        A[i], B[i] = map(int, input().split())

    l = [1] * N
    for i in range(M):
        if H[A[i] - 1] < H[B[i] - 1]:
            l[A[i] - 1] -= 1
        elif H[A[i] - 1] > H[B[i] - 1]:
            l[B[i] - 1] -= 1
        else:
            l[A[i] - 1] -= 1
            l[B[i] - 1] -= 1
    print(l.count(1))

if __name__ == '__main__':
    main()

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

ans = 0
for i in range(N):
    count = 0
    good = 0
    for j in range(M):
        if A[j] == i + 1:
            count += 1
            if H[B[j] - 1] < H[i]:
                good += 1
        if B[j] == i + 1:
            count += 1
            if H[A[j] - 1] < H[i]:
                good += 1
    if count == good:
        ans += 1

print(ans)
Problem p02753 (python)

Fixed submission:
s = input()
for i in range(0,2):
  if s[i] != s[i+1]:
    print('Yes')
    break
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
for i in range(1, 1001):
  if floor(i * 0.08) == a and floor(i * 0.1) == b:
    print(i)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
ans = int(n / (a + b))
rem = n % (a + b)
if rem > a:
    print(ans * a + a)
else:
    print(ans * a + rem)

Buggy submission (verdict: Runtime Error):
s = input()
f = False
if s[0] != s[1]:
  f = True
elif s[1] != s[2]:
  f = True
  
if f == True:
  print('Yes')
else
  print('No')
Problem p02759 (python)

Fixed submission:
import math
n = float(input())
print(math.ceil(float(n / 2)))

Buggy submission (verdict: Runtime Error):
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
for number in b:
    if b in a:
        a[a.index(b)] = 0
if a[0][0] == a[1][1] == a[2][2] == 0:
    print('Yes')
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2] == 0:
            print('Yes')
            break
        elif a[0][i] == a[1][i] == a[2][i] == 0:
            print('Yes')
            break
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
for number in b:
    if b in a:
        a[a.index(b)] = 0
if a[0][0] == a[1][1] == a[2][2]:
    print('Yes')
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2]:
            print('Yes')
            break
        elif a[0][i] == a[1][i] == a[2][i]:
            print('Yes')
            break
    else:
        print('No')
Problem p02777 (python)

Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print('{0} {1}'.format(a,b))

Buggy submission (verdict: Runtime Error):
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print('{0} {1}'.format(a,b))

Buggy submission (verdict: Runtime Error):
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1