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

Fixed submission:
import math

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


def f(num):
    n_max = math.ceil(math.log2(num+1))
    result = 0
    for n in range(n_max):
        if n == 0:
            r = num % 4
            if r == 1 or r == 2:
                result += 1
            continue
        r = (num+1) % 2**(n+1)
        if r <= 2**n:
            continue
        else:
            r -= 2**n

        if r % 2 == 1:
            result += 2**n

    return result


if A > 0:
    print(f(A-1) ^ f(B))
else:
    print(f(B))

Buggy submission (verdict: Runtime Error):
import math

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


def f(num):
    n_max = math.ceil(math.log2(num+1))
    result = 0
    for n in range(n_max):
        if n == 0:
            r = num % 4
            if r == 1 or r == 2:
                result += 1
            continue
        r = (num+1) % 2**(n+1)
        if r <= 2**n:
            continue
        else:
            r -= 2**n

        if r % 2 == 1:
            result += 2**n

    return result


print(f(A-1) ^ f(B))
Problem p03222 (python)

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

h, w, k = map(int, input().split())


def f(x):
    lst = [1, 2, 3, 5, 8, 13, 21]
    if 0 <= x < 7:
        return lst[x]
    else:
        return 1


ptn = [[0] * (w + 2) for _ in range(w + 2)]
for i in range(w + 2):
    for j in range(w + 2):
        if i == 0 or i == w + 1 or j == 0 or j == w + 1:
            continue
        elif i == j:
            ptn[i][j] = f(i-2)*f(w-i-1)
        elif i == j + 1:
            ptn[i][j] = f(i-3)*f(w-i-1)
        elif i == j - 1:
            ptn[i][j] = f(i-2)*f(w-i-2)

for _ in range(h - 1):
    temp = [[0] * (w + 2) for _ in range(w + 2)]
    for i in range(w + 2):
        for j in range(w + 2):
            if i == 0 or i == w + 1 or j == 0 or j == w + 1:
                continue
            else:
                temp[i][j] = ptn[i-1][j]*f(i-3)*f(w-i-1) + ptn[i][j]*f(i-2)*f(w-i-1) + ptn[i+1][j]*f(i-2)*f(w-i-2)

    ptn = temp

print(ptn[1][k] % 1000000007)

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

h, w, k = map(int, input().split())

ptn = [[0] * (w + 2) for _ in range(w + 2)]
for i in range(w + 2):
    for j in range(w + 2):
        if i == 0 or i == w or j == 0 or j == w:
            continue
        if abs(i - j) <= 1:
            ptn[i][j] = 1


def f(x):
    l = [1, 2, 3, 5, 7, 13, 19]
    if 0 <= x < 7:
        return l[x]
    else:
        return 1


for _ in range(h - 1):
    temp = [[0] * (w + 2) for _ in range(w + 2)]
    for i in range(w + 2):
        for j in range(w + 2):
            if i == 0 or i == w or j == 0 or j == w:
                continue
            else:
                temp[i][j] = ptn[i-1][j]*f(i-3)*f(w-i-1) + ptn[i][j]*f(i-2)*f(w-i-1) + ptn[i+1][j]*f(i-2)*f(w-i-2)

    ptn = temp

print(ptn[1][k] % 1000000007)

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

h, w, k = map(int, input().split())

ptn = [[0] * (w + 2) for _ in range(w + 2)]
for i in range(w + 2):
    for j in range(w + 2):
        if i == 0 or i == w or j == 0 or j == w:
            continue
        if abs(i - j) <= 1:
            ptn[i][j] = 1


def f(x):
    l = [1, 2, 3, 5, 7, 13, 19]
    if 0 <= x < 7:
        return l[x]
    else:
        return 1


for _ in range(h - 1):
    temp = [[0] * (w + 2) for _ in range(w + 2)]
    for i in range(w + 2):
        for j in range(w + 2):
            if i == 0 or i == w or j == 0 or j == w:
                continue
            else:
                temp[i][j] = ptn[i-1][j]*f(i-3)*f(w-i-1) + ptn[i][j]*f(i-2)*f(w-i-1) + ptn[i+1][j]*f(i-2)*f(w-i-2)

    ptn = temp

print(ptn[1][k])
Problem p02990 (python)

Fixed submission:
import math
N,K = map(int,input().split())
k = 10**9+7
for i in range(1,K+1):
  A= 1
  for j in range(i-1):
    A *= K-1-j
  A = A//math.factorial(i-1)%k
  B = 1
  if N-K-i+1>=0:
    B = math.factorial(N-K+1)//math.factorial(N-K-i+1)//math.factorial(i)%k
    print(A*B%k)
  else:
    print(0)

Buggy submission (verdict: Runtime Error):
import math
N,K = map(int,input().split())
k = 10**9+7
for i in range(1,K+1):
  A= 1
  for j in range(i-1):
    A *= K-1-j
  A = A//math.factorial(i-1)%k
  B = math.factorial(N-K+1)//math.factorial(N-K-i+1)//math.factorial(i)%k
  print(A*B%k)
Problem p03013 (python)

Fixed submission:
N,M = map(int,input().split())
a = set([int(input()) for _ in range(M)])
k = 10**9+7
dp = [0]*(N+1)
dp[0] = 1
if N == 1:
  print(1)
else:
  for i in range(1,N+1):
    if i in a:
      continue
    elif i==1:
      dp[1] = 1
    elif i==2:
      dp[i] = 1+dp[1]
    else:
      dp[i] = dp[i-1]+dp[i-2]
  print(dp[N]%k)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
dp = [0]*(N+1)
dp[0] = 1
for i in range(M):
  dp[a] = -1
k = 10**9+7
d = 1
if N == 1:
  print(1)
else:
  for i in range(1,N+1):
    if dp[i] == -1:
      continue
    elif i==1:
      dp[i] = 1
    elif i==2:
      dp1 = dp[i-1] if dp[i-1] != -1 else 0
      d += dp[1]
      dp[i] = d
    else:
      dp1 = dp[i-1] if dp[i-1] != -1 else 0
      dp3 = dp[i-3] if dp[i-3] != -1 else 0
      d = d-dp3+dp1
      dp[i] = d
  print(dp[N]%k)
Problem p02577 (python)

Fixed submission:
n = int(input())
if n % 9 == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
sum1 = 0
while n!=0:
  sum1 += int(n%10)
  n = int(n/10)
if sum1 % 9 == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
sum1 = 0
while n!=0:
  sum1 += int(n%10)
  n = int(n/10)
if sum1%9 == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
sum1 = 0
while n>0:
  sum1 += n%10
  n = int(n/10)
if sum1%9 == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
sum1 = 0
while n>0:
  sum1 += n%10
  n= int(n/10)
if sum1%9 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n = int(input())
sum1 = 0
while n>0:
  sum1 += n%10
  n/=10
if sum1%9 == 0:
  print('YES')
else:
  print('NO')
Problem p02659 (python)

Fixed submission:
A, B = input().split()
a = int(A)
b = round(float(B) * 100)
c = a * b // 100
print(c)

Buggy submission (verdict: Runtime Error):
A, B = input.split()
a = int(A)
b = round(float(B) * 100)
c = a * b // 100
print(c)

Buggy submission (verdict: Runtime Error):
A, B = input.split()
a = int(A)
b = float(B) * 100
c = a * b // 100
print(c)
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
C = A + B
D = N // C
E = N % C
if N <= A:
    print(N)
elif N <= C:
    print(A)
else:
    if E <= A:
        print(A*D + E)
    else:
        print(A*D + A)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split()))
s = b * n[1]
t = r * n[2]
u = 10**100
v = (s + t) * u
w = v.count("b", 0, n[0])
print(w)
Problem p02701 (python)

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [int(input()) for _ in range(n)]
print(len(set(s)))
Problem p02711 (python)

Fixed submission:
n = input()
ans = 'No'
for s in n:
    if s == '7':
        ans = 'Yes'
        break
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = 'No'
for s in n:
    if s == '7'
    ans = 'Yes'
    break
print(ans)
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
ans = -1
if a < 10 and b < 10:
    ans = a * b
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
ans = -1
if a < 10 and b < 10:
    ans = a * b
print(ans)
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
a = {int(input()) for _ in range(m)}
mod = 10**9 + 7

dp = [0]*(n+1)
dp[0] = 1
    
for i in range(1,n+1):
    if i in a:
        continue
    x = dp[i-1] 
    if i > 1:
        x += dp[i-2]
    dp[i] = x % mod
ans = dp[n]
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = {int(input()) for _ in range(m)}
mod = 10**9 + 7

dp = [0]*(n+1)
dp[0] = 1
    
for i in range(1,n+1):
    if i in a:
        continue
    x = dp[i-1] 
    if i > 1:
        x += dp[i-2]
    dp[i] = x
ans = dp[n] % x
print(ans)
Problem p03072 (python)

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
a = 0
for i in range(len(h)):
    if i == 0:
        a += 1
    else:
        if h[i] >= max(h[0:i]):
            a += 1
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
a = 0
for i in range(len(h)):
    if h[i] >= max(h[0:i-1]):
        a += 1
print(a)
Problem p03073 (python)

Fixed submission:
s = str(input())
ans1 = s[::2].count('0') + s[1::2].count('1')
ans2 = s[::2].count('1') + s[1::2].count('0')
print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
import numpy as np
s = str(input())
s_list = np.array([int(list(s)[i]) for i in range(len(s))])

if len(s_list) % 2 == 0:
    s01 = np.array([0,1]*(len(s_list)//2))
    s10 = np.array([1,0]*(len(s_list)//2))
else:
    s01 = np.array([0,1]*(len(s_list)//2))
    s01 = np.append(s01, 0)
    s10 = np.array([1,0]*(len(s_list)//2))
    s10 = np.append(s10, 1)

ans = min(np.sum(s_list == s01), np.sum(s_list == s10))
print(ans)
Problem p03075 (python)

Fixed submission:
a,b,c,d,e,k = map(int, [input() for i in range(6)])
if(e-a > k):
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k = map(int, input())
if(e-a > k):
    print(":(")
else:
    print("Yay!")
Problem p02577 (python)

Fixed submission:
n = int(input())
if n % 9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def sum_each_num(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n = n // 10
    return sum

def main():
    n = input()
    sum = sum_each_num(n)
    if n % 9 == 0:
        print("Yes")
    else:
        print("No")

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

Fixed submission:
import collections 
n=int(input())
s_list=list(input() for _ in range(n))
c=collections.Counter(s_list)
print(len(c.keys()))

Buggy submission (verdict: Runtime Error):
import collections 
n=int(input())
s_list=list(input() for _ in range(n))
c=collections.Ceounter(s_list)
print(len(c.keys()))
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
#A
n=input()
if n%2=0:
    ans=int(n/2)
else:
    ans=int(n/2)+1
print(ans)
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()))

A.append(100)
C.append(0)

total = 0

for i in range(0,N):
    if(A[i + 1] - A[i] == 1):
        total += C[A[i] - 1]
    total += B[A[i] - 1]

print(total)

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()))

# 定義してないリストを参照するとエラーがでるからダミー置いといた。
A.append(100)
C.append(0)

total = 0

total = sum(B)

for i in range(1, N):
    if (A[i] - A[i - 1] == 1):
        total += C[A[i] - 1 - 1]

print(total)

A = list(map(int, input().split()))
print(A)
print(sum(A))
Problem p03774 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n, m = [int(w) for w in input().split()]
ls = [[int(w) for w in input().split()] for _ in range(n)]
lp = [[int(w) for w in input().split()] for _ in range(m)]

for a, b in ls:
    ans = -1
    dist = 10e10
    for i, (c, d) in enumerate(lp):
        d = abs(a-c) + abs(b-d)
        if d < dist:
            ans = i
            dist = d
    print(ans+1)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n, m = [int(w) for w in input().split()]
ls = [[int(w) for w in input().split()] for _ in range(n)]
lp = [[int(w) for w in input().split()] for _ in range(n)]

for a, b in ls:
    ans = -1
    dist = 10e10
    for i, (c, d) in enumerate(lp):
        d = abs(a-c) + abs(b-d)
        if d < dist:
            ans = i
            dist = d
    print(ans+1)
Problem p02879 (python)

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

if A>9 or B>9:
  print(-1)
else:
  print(A*B)

Buggy submission (verdict: Runtime Error):
N=int(input())
flag=0
for A in range(1,10):
  for B in range(1,10):
    if N==A*B:
      flag=1
      break
 
print( "Yes" if flag == 1 else "No" )

#if flag==0:
#  print('NO')
#else:
#  print('YES')
Problem p02880 (python)

Fixed submission:
n = int(input())

flag = 0

for i in range(1,10):
    for j in range(1,10):
        if i*j == n:
            flag = 1
            break

print( "Yes" if flag == 1 else "No" )

Buggy submission (verdict: Runtime Error):
N=input()
N=int(N)
A=1
B=1
flag=0
if N>81:
    flag=0
else:
    for A in range(10):
    for B in range(10):
        if N==A*B:
        flag=1
    else:
        flag=0
if flag==0:
    print('NO')
else:
    print('YES')
Problem p02897 (python)

Fixed submission:
n = int(input())

if n%2==0:
  print(0.5)
else:
  answer = (int(n/2)+1)/n
  print(answer)

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

if n%2==0:
  print(0.5)
else:
  answer = (n/2+1)/na
  print(answer)
Problem p02689 (python)

Fixed submission:
import numpy as np
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
F=[0]*len(H)
for i in range(M):
  A,B=list(map(int,input().split()))
  if(H[A-1]<H[B-1]):
    F[A-1]=1
  elif(H[A-1]>H[B-1]):
    F[B-1]=1
  else:
    F[B-1]=1
    F[A-1]=1
print(F.count(0))

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
HH=np.zeros((N,N))
for i in range(M):
  A,B=list(map(int,input().split()))
  HH[A-1][B-1]=1
HH=HH+HH.T
count=0
for i in range(N):
  for j in range(N):
    if(HH[i][j]>0 and H[i]<=H[j]):
      count+=1
      break
print(N-count)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
HH=np.zeros((N,N))
for i in range(M):
  A,B=list(map(int,input().split()))
  HH[A-1][B-1]=1
HH=HH+HH.T
count=0
#print(HH)
for i in range(N):
  for j in range(N):
    if(HH[i][j]>0):
      if(H[i]<=H[j]):
        count+=1
        break
print(N-count)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
HH=np.zeros((N,N))
for i in range(M):
  A,B=list(map(int,input().split()))
  HH[A-1][B-1]=1
HH=HH+HH.T
count=0
for i in range(N):
  ma=0
  for j in np.where(HH[i]>0)[0]:
    if(H[i]<=H[j]):
      count+=1
      break
print(N-count)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
HH=np.zeros((N,N))
for i in range(M):
  A,B=list(map(int,input().split()))
  HH[A-1][B-1]=1
HH=HH+HH.T
count=0
for i in range(N):
  ma=0
  for j in np.where(HH[i]==1)[0]:
    if(H[i]<=H[j] and i!=j):
      count+=1
      break
print(N-count)
Problem p02777 (python)

Fixed submission:
l=input().split() 
n = list(map(int, input().split()))
t=input()
if l[0]==t:
    n[0]=n[0]-1
    print(n[0],n[1])
elif l[1]==t:
    n[1]=n[1]-1
    print(n[0],n[1])

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

Buggy submission (verdict: Runtime Error):
l=input().split() 
n = list(map(int, input().split()))
t=input()
if l[0]==t:
    n[0]=n-1
    print(n)
elif l[1]==t:
    n[1]=n-1
    print(n)
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 = input()

l = len(s)
ans = 0

for i in range(l-3):
    left = i
    right = left + 4
    while (right < l+1):
        now = int(s[left:right])
        if (now % 2019 == 0):
            right += 4
            ans += 1
        else:
            right += 1

print(ans)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
array = []
for _ in range(M):
    tmp = list(map(int, input().split()))
    array.append(tmp)
array.sort(key=lambda x: x[1], reverse=True)

_sum = 0
_num = 0

for i in range(N+M):
    if A[0] > array[0][1]:
        _sum += A.pop(0)
        _num += 1
        
    else:
        a = array[0][0] if array[0][0] < N - _num else N - _num
        _sum += array.pop(0)[1] * a
        _num += a
        if not array:
            break
        
    if _num == N:
        break
    
if _num != N:
    while _num < N:
        _sum += A.pop(0)
        _num += 1
        
print(_sum)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
array = []
for _ in range(M):
    tmp = list(map(int, input().split()))
    array.append(tmp)
array.sort(key=lambda x: x[1], reverse=True)

_sum = 0
_num = 0

for i in range(N+M):
    if A[0] > array[0][1]:
        _sum += A.pop(0)
        _num += 1
    else:
        a = array[0][0] if array[0][0] < N - _num else N - _num
        _sum += array.pop(0)[1] * a
        _num += a
        
    if _num == N:
        break
    
print(_sum)
Problem p02676 (python)

Fixed submission:
K=int(input())
S=input()

if len(S) > K:
    print(S[:K]+"...")
else:
    print(S)

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

if len(S) > K:
    print(S[:K]+"..."
else:
    print(S)
Problem p02693 (python)

Fixed submission:
K=int(input())
A,B=map(int,input().split())
a='NG'
for i in range(A,B+1):
  if i%K==0:
    a='OK'
    break
print(a)

Buggy submission (verdict: Runtime Error):
K=int(input())
A,B=map(int,input().split())
a='NG'
for i in range(A,B+1):
  if i%K==0:
    a=OK'
    break
print(a)
Problem p02711 (python)

Fixed submission:
chars = str(input())
n = 0

for char in chars:
	if int(char) == 7:
		n = 1

	if n != 0:
		break

if n == 0:
	print('No')
else:
	print('Yes')

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

for char in chars:
	if int(char) == 7:
		n = 1

	if n != 0:
		break

if n == 0:
	print('No')
else:
	print('Yes')

Buggy submission (verdict: Runtime Error):
import sys

chars = sys.argv[1]
n = 0

for char in chars:
	if int(char) == 7:
		n = 1

	if n != 0:
		break

if n == 0:
	print('No')
else:
	print('Yes')
Problem p02712 (python)

Fixed submission:
n = int(input())
total = 0

for j in range(n):
	i = j+1
	if (i % 3 != 0) and (i % 5 != 0):
		total += i

print(total)

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

for i in range(n):
	if (i % 3 != 0) and (i % 5 != 0):
		total += i

print(total)

Buggy submission (verdict: Runtime Error):
import sys

n = int(sys.argv[1])
total = 0

for i in range(n):
	if (i % 3 != 0) and (i % 5 != 0):
		total += i

print(total)
Problem p02689 (python)

Fixed submission:
N,M = map(int,input().split())
H = [int(h) for h in input().split()]

d = {}

for i in range(N):
    d[i+1] = H[i]

for _ in range(M):
    A,B = map(int,input().split())

    if H[B-1] >= H[A-1]:
        d[A] = 0

    if H[B-1] <= H[A-1]:
        d[B] = 0

print(N - list(d.values()).count(0))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = [int(h) for h in input().split()]

d = {}

for i in range(N):
    d[i+1] = H[i]

for _ in range(M):
    A,B = map(int,input().split())

    if H[B-1] > H[A]:
        d[A] = 0

    elif H[B-1] < H[A]:
        d[B] = 0

    elif H[B-1] == H[A]:
        d[A] = 0
        d[B] = 0


print(N - list(d.values()).count(0))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = [int(h) for h in input().split()]

d = {}

for i in range(N):
    d[i+1] = H[i]

for _ in range(M):
    A,B = map(int,input().split())

    if H[B-1] > H[A]:
        d[A] = 0

    elif H[B-1] < H[A]:
        d[B] = 0


print(N - list(d.values()).count(0))
Problem p02723 (python)

Fixed submission:
S = input()
#S = S.split()
if ((S[2]==S[3])&(S[4]==S[5])):
	print("Yes")
else: 
	print("No")

Buggy submission (verdict: Runtime Error):
S = input()
S = S.split()
if ((S[2]==S[3])&(S[4]==S[5])):
	print("Yes")
else: 
    print("No")

Buggy submission (verdict: Runtime Error):
S = S.split()
if S[2]==S[3]:
  if S[4]==S[5]:
    return "Yes"
  else: return "No"
else: return "No"

Buggy submission (verdict: Runtime Error):
S = S.split()
if (S[2]=="f")&(S[3]=="f"):
  if (S[4]=="e")&(S[5]=="e"):
    return Yes
  else: return No
else: return No
Problem p02577 (python)

Fixed submission:
s=input();
sum=0;
for i in range(len(s)):
  sum=sum+int(s[i])
if(sum%9==0):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input();
int sum=0;
for i in range(len(s)):
  sum=sum+int(s[i])
if(sum%9==0):
  print("Yes")
else:
  print("No")
Problem p02577 (python)

Fixed submission:
import sys
input = sys.stdin.readline
I = lambda : list(map(int,input().split()))

n=I()
if sum(n)%9==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
I = lambda : list(map(int,input().split()))

n,=I()
if sum(n)%9==0:
  print("Yes")
else:
  print("No")
Problem p02763 (python)

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

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    S = list(input())
    Q = int(input())

    L = [[] for x in range(26)] # i番目のリストは、アルファベットが現れるインデックスのリストを持つ。

    for idx, s in enumerate(S):
        L[ord(s)-ord("a")].append(idx)

    for _ in range(Q):
        row = input().split()
        if row[0] == '1':
            y, z = int(row[1])-1, row[2]
            if S[y] != z:
                idx_target = ord(S[y]) - ord("a")
                idx_del = bisect.bisect_left(L[idx_target], y)
                if idx_del < len(L[idx_target]):
                    L[idx_target].pop(idx_del)
                bisect.insort(L[ord(z) - ord("a")], y)
                S[y] = z

        elif row[0] == '2':
            y, z = int(row[1]) - 1, int(row[2]) - 1
            answer = 0
            for idx_alphabet in range(26):
                left = bisect.bisect_left(L[idx_alphabet], y)
                if left < len(L[idx_alphabet]) and y <= L[idx_alphabet][left] <= z:
                    answer += 1
            print(answer)

    # Failed to predict input format
    pass

if __name__ == '__main__':
    main()

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

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    S = list(input())
    Q = int(input())

    L = [[] for x in range(26)] # i番目のリストは、アルファベットが現れるインデックスのリストを持つ。

    for idx, s in enumerate(S):
        L[ord(s)-ord("a")].append(idx)

    for _ in range(Q):
        row = input().split()
        if row[0] == '1':
            y, z = int(row[1])-1, row[2]
            idx_target = ord(S[y]) - ord("a")
            idx_del = bisect.bisect_left(L[idx_target], y)
            if idx_del < len(L[idx_target]):
                L[idx_target].pop(idx_del)
            bisect.insort(L[ord(z) - ord("a")], y)
            S[y] = z

        elif row[0] == '2':
            y, z = int(row[1]) - 1, int(row[2]) - 1
            answer = 0
            for idx_alphabet in range(ord("a"), ord("z")+1):
                left = bisect.bisect_left(L[idx_alphabet], y)
                if left < len(L[idx_alphabet]) and y <= L[idx_alphabet][left] <= z:
                    answer += 1
            print(answer)

    # Failed to predict input format
    pass

if __name__ == '__main__':
    main()