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

Fixed submission:
S = str(input())
K = int(input())
for i in range(K):
  if S[i] != "1":
    print(S[i])
    break
else:
  print(1)

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())
for i in range(K):
  if S[i] != "1":
    print(S[i]) 
else:
  print(S[K-1])
Problem p03284 (python)

Fixed submission:
N, K = (int(i) for i in input().split())
if N % K == 0:
    print(int(0))
else :
  print(int(1))

Buggy submission (verdict: Runtime Error):
n = int(input())
if n % 4 == 3 or n % 4 == 0:
    print('Yes')
else:
  print('No')
Problem p03323 (python)

Fixed submission:
A, B = (int(i) for i in input().split())
if A <= 8 and B <= 8:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
A, B = (int(i) for i in input().split())
if A =< 8 and B =< 8:
  print('yay!')
else:
  print(':(')
Problem p03060 (python)

Fixed submission:
# coding: utf-8
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
VC = []
for i in range(N):
    VC.append(V[i] -  C[i])
ans = 0
for j in VC:
    if j > 0:
        ans+=j
print(ans)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in [ V[_] - C[_] for _ in range(N)]:
    if i> 0:
        ans+=j
print(ans)
Problem p03079 (python)

Fixed submission:
A=[int(x) for x in input().split()]

A=sorted(A)

if A[0]==A[1] and A[0]==A[2]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N,Q=input().split()
N=int(N)
Q=int(Q)
s=input()
t=['']*Q
d=['']*Q
for i in range(Q):
    t[i],d[i]=input().split()

    
t.reverse()
d.reverse()

golem=set()
count=set()

for i in range(Q):
    tmp=set()
    
    if d[i]=='R':
        for gtmp in golem-count:
            if gtmp>1 and (gtmp-1 not in golem):
                if s[gtmp-1]==t[i]:
                    tmp.add(gtmp-1)
                    count.add(gtmp)
    else:
        for gtmp in golem-count:
            if gtmp<N-1 and (gtmp+1 not in golem):
                if s[gtmp+1]==t[i]:
                    tmp.add(gtmp+1)
                    count.add(gtmp)

    golem=golem.union(tmp)
    if t[i]==s[0] and d[i]=='L':
        golem.add(0)
    elif t[i]==s[-1] and d[i]=='R':
        golem.add(N-1)

        
print(N-len(golem))

Buggy submission (verdict: Runtime Error):
N,Q=input().split()
N=int(N)
Q=int(Q)
s=input()
t=['']*Q
d=['']*Q
for i in range(Q):
    t[i],d[i]=input().split()

    
t.reverse()
d.reverse()

golem=set()

for i in range(Q):
    tmp=set()
    for gtmp in golem:
        if gtmp>1:
            if s[gtmp-1]==t[i] and d[i]=='R':
                tmp.add(gtmp-1)
        if gtmp<N-1:
            if s[gtmp+1]==t[i] and d[i]=='L':
                tmp.add(gtmp+1)
    golem=golem.union(tmp)
    if t[i]==s[0] and d[i]=='L':
        golem.add(0)
    elif t[i]==s[-1] and d[i]=='R':
        golem.add(N-1)

        
print(N-len(golem))
Problem p03059 (python)

Fixed submission:
A, B, T = map(int, input().split())
print(int( (T+0.5)/A)*B)

Buggy submission (verdict: Runtime Error):
A, B, T = map(int, raw_input().split())
print(int( (T+0.5)/A)*B)

Buggy submission (verdict: Runtime Error):
A, B, T = map(int, raw_input().split())
print(((T+0.5)//A)*B)

Buggy submission (verdict: Runtime Error):
print((T//A)*B)

Buggy submission (verdict: Runtime Error):
print((T//A)*B)

Buggy submission (verdict: Runtime Error):
return (T//A)*B
Problem p03076 (python)

Fixed submission:
input_list=[input() for i in range(5)]
dishes = [int(n) for n in input_list]
s = 0
for n in dishes:
    if n%10 == 0:
        s += n

dishes = [n for n in dishes if n%10 != 0]
if dishes:
    minmod = min([n%10 for n in dishes])

    for n in dishes:
        s += n + 10 - n%10

    s -= 10
    s += minmod
print(s)

Buggy submission (verdict: Runtime Error):
input_list=[input() for i in range(5)]
dishes = [int(n) for n in input_list]
s = 0
for n in dishes:
    if n%10 == 0:
        s += n

dishes = [n for n in dishes if n%10 != 0]
minmod = min([n%10 for n in dishes])


for n in dishes:
    s += n + 10 - n%10

s -= 10
s += minmod
print(s)
Problem p03106 (python)

Fixed submission:
a,b,k=(int(x) for x in input().split())
list =[]
 
for x in range(1,max(a,b)+1):
    if(a%x == 0 and b%x == 0):
        list.append(x)
 
print(list[-k])

Buggy submission (verdict: Runtime Error):
a,b,k=(int(x) for x in input().split())
list =[]

for x in range(1,max(a,b)):
    if(a%x == 0 and b%x == 0):
        list.append(x)

print(list[-k])
Problem p03076 (python)

Fixed submission:
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]

T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))
if T_0.size == 5:
    print(np.sum(T_0))
else:
    print(np.sum(T_c) - 10 + np.sum(T_0) + T_s[0])

Buggy submission (verdict: Runtime Error):
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))

if T_0 != np.array([0,0,0,0,0]):
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)

Buggy submission (verdict: Runtime Error):
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))
print(T_0,T_o,T_c,T_s)
if T_0 != np.array([0,0,0,0,0]):
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)

Buggy submission (verdict: Runtime Error):
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))

if np.all(T_0 == 0) == False:
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
p=a*b
if p%2==0:
  print('Even')
else:
  print('Odd')

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

p=n[0]*n[1]
if p%2==0:
  print('Even')
else:
  print('Odd')
Problem p03059 (python)

Fixed submission:
x = input()
x = x.split(" ")
a = int(x[0])
b = int(x[1])
c = int(x[2])
n = c // a 
print(n * b)

Buggy submission (verdict: Runtime Error):
x = input()
x = x.split(" ")
a = x[0]
b = x[1]
c = x[2]
n = c // a 
return(n * b)

Buggy submission (verdict: Runtime Error):
x = input()
x = x.split(" ")
a = x[0]
b = x[1]
c = x[2]
n = c // a 
print(n * b)
Problem p03067 (python)

Fixed submission:
points = input()
points = points.split(" ")
a = int(points[0])
b = int(points[1])
c = int(points[2])

if (a < b) and (a < c) and (c < b):
    print("Yes")
elif (a > b) and (a > c) and (c > b):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
len_s = range(n)

for i in len_s:
    if s[i] == "#":
        s = s[i::]
        break
count_sharp = s.count("#")
count_dot = s.count(".")
if min(count_dot, count_sharp) == 0:
    print(0)
else:
    print(min(count_dot, count_sharp))
Problem p03085 (python)

Fixed submission:
a=input()
if a=="A":
	print("T")
elif a=="T":
    print("A")
elif a=="G":
	print("C")
else:
	print("G")

Buggy submission (verdict: Runtime Error):
a=input()
if a="A":
  print("T")
elif a="T":
  print("A")
elif a="G":
  print("C")
else:
  print("G")
Problem p03086 (python)

Fixed submission:
a=input()+"o"
b=["A","T","C","G"]
ans=0
c=0
for i in range(len(a)):
  if a[i] in b:
    c+=1
  else:
    if c>ans:
      ans=c
    c=0
print(ans)

Buggy submission (verdict: Runtime Error):
a=input()+"o"
b=["A","T","C","G"]
ans=0
c=0
for i in range(len(a)):
  if a[i] in b
    c+=1
  else:
    if c>ans:
      ans=c
    c=0
print(ans)
Problem p03489 (python)

Fixed submission:
n = len(input())
mp, res = {}, 0
for el in list(map(int, input().split())): mp[el] = mp.get(el, 0) + 1
for key in mp:
    val = mp[key]
    if key > val: res += val
    elif key < val: res += val - key
print(res)

Buggy submission (verdict: Runtime Error):
n = len(input())
mp, res = {}, 0
for el in list(map(int, input().split())): mp[el] = mp.get(el, 0) + 1
for key, val in mp:
  if key > val: res += val
  elif key < val: res += val - key
print(res)
Problem p03260 (python)

Fixed submission:
# Read the values of A and B from the screen, save them as integers
a, b = [int(i) for i in input().split()]

# Note that all we have to do is check if both A and B are odd.
if a*b % 2 == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# Read the values of A and B from the screen, save them as integers
a = int(input())
b = int(input())

# Use a for-loop to check if there is integer C, A <= C <= B
# such that A*B*C is odd
got_an_odd = False
for c in range(a, b+1):
    if a*b*c % 2 == 1:
        got_an_odd = True

# Print the answer on the screen
if got_an_odd:
    print("Yes")
else:
    print("No")
Problem p03074 (python)

Fixed submission:
import sys
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N,K = map(int, input().split())
    S = sys.stdin.readline()
  else:
    # For Test
    # N = 5
    # K = 1
    # S = "00010"
    # N = 14
    # K = 2
    # S = "11101010110011"
    # N = 1
    # K = 1
    # S = "1"
    N = 5
    K = 1
    S = "11111"
    
  SC = []
  i = 0
  if S[0] == "0":SC.append(0)
  while i < N :
    if S[i] == "0":
      j = S.find("1",i)
    else:
      j = S.find("0",i)
    if j == -1: j = N 
    cnt = j - i
    i = j
    SC.append(cnt)
    
  if 'get_ipython' in globals(): print(SC)
    
  SH = []
  cnt = 0
  for i in range(len(SC)):
    cnt += SC[i]
    SH.append(cnt)
  
  if 'get_ipython' in globals(): print(SH)
  
  lenSC = len(SC) - 1
  ans = 0
  for i in range(0,lenSC+1,2):
    k = i + K * 2
    if k > lenSC:
      k = lenSC
    if i != 0:
      cnt = SH[k] - SH[i-1]
    elif k == i:
      cnt = SH[k]
    else:
      cnt = SH[k] - SH[i]
    if ans < cnt: ans = cnt

  print(ans)

main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N,K = map(int, input().split())
    S = sys.stdin.readline
  else:
    # For Test
    # N = 5
    # K = 1
    # S = "00010"
    N = 14
    K = 2
    S = "11101010110011"
    # N = 1
    # K = 1
    # S = "1"
    
  SC = []
  i = 0
  if S[0] == "0":SC.append(0)
  while i < N :
    if S[i] == "0":
      j = S.find("1",i)
    else:
      j = S.find("0",i)
    if j == -1: j = N 
    cnt = j - i
    i = j
    SC.append(cnt)
    
  if 'get_ipython' in globals(): print(SC)
    
  i = 0
  lenSC = len(SC) - 1
  ans = 0
  while i <= lenSC:
    cnt = 0
    k = i + K * 2
    if k > lenSC:
      k = lenSC
    k += 1
    cnt = sum(SC[i:k])
    if ans < cnt:
      ans = cnt
    i += 2

  print(ans)

main()
Problem p03078 (python)

Fixed submission:
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    X, Y, Z, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()] 
    B = [int(i) for i in input().split()]
    C = [int(i) for i in input().split()] 
  else:
    A = [1,10,100]
    B = [2,20,200]
    C = [1,10,100]
    #A = [4,6]
    #B = [1,5]
    #C = [3,8]
    X = len(A)
    Y = len(B)
    Z = len(C)
    K = 5
    #K = 8

  # Processing
  AB = []
  A.sort(reverse=True)
  B.sort(reverse=True)
  for i in A[0:K]:
    for j in B[0:K]:
      AB.append(i+j)
  
  AB.sort(reverse=True)
  
  ABC = []
  C.sort(reverse=True)
  
  for i in AB[0:K]:
    for j in C[0:K]:
      ABC.append(i+j)  
  
  ABC.sort(reverse=True)

  for i in ABC[0:K]:
    print(i)      

main()

Buggy submission (verdict: Runtime Error):
 # import sys  sys.exit()を使う時に必要

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    # N = int(input())
    X, Y, Z, K = input().split()
    A = [int(i) for i in input().split()] 
    B = [int(i) for i in input().split()]
    C = [int(i) for i in input().split()] 
    # S = [input() for _ in range(N)]  縦持ち／行数N
    # t = [0] * N  　　ti xi yi 縦持ち/行数N
    # x = [0] * N
    # y = [0] * N
    # for i in range(N):
    #   t[i], x[i], y[i] = map(int, input().split())
  else:
    A = [1,10,100]
    B = [2,20,200]
    C = [1,10,100]
    X = len(A)
    Y = len(B)
    Z = len(C)
    K = 5

  ans = []
  # Processing
  A.sort(reverse=True)
  B.sort(reverse=True)
  C.sort(reverse=True)
      
  for i in A:
    if i >= A[min(K,X)-1]:
      for j in B:
        if j >= B[min(K,Y)-1] :
          for k in C:
            if k >= C[min(K,Z)-1]:
              ans.append(i+j+k)
            else:
              break
        else:
          break
    else:
      break
    
  ans.sort(reverse=True)
  if 'get_ipython' in globals(): 
    print(ans)

  for i in range(0,K):
    print(ans[i])      

main()
Problem p03231 (python)

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()

lcm_num = lcm(N,M)
lN = lcm_num // N
lM = lcm_num // M
gcd_num = lN * lM

for i in range(0,lcm_num,gcd_num):
    if S[i//lN] == T[i//lM]:
        continue
    else:
        print(-1)
        exit()

print(lcm_num)

Buggy submission (verdict: Runtime Error):
import fraction
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()

lcm_num = lcm(N,M)

X_s = ["" for i in range(lcm_num)]
X_t = ["" for i in range(lcm_num)]

# print(X_s,X_t)

for i in range(N):
    tmp = i*lcm_num // N + 1
    X_s[tmp-1] = S[i]


for i in range(M):
    tmp = i*lcm_num // M + 1
    X_t[tmp-1] = T[i]

# print(X_s,X_t)

for s,t in zip(X_s,X_t):
    if s == "" or t == "" :
        continue
    elif s == t:
        continue
    else:
        print(-1)
        exit()

print(lcm_num)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()

lcm_num = lcm(N,M)

X_s = ["" for i in range(lcm_num)]
X_t = ["" for i in range(lcm_num)]

# print(X_s,X_t)

for i in range(N):
    tmp = i*lcm_num // N + 1
    X_s[tmp-1] = S[i]


for i in range(M):
    tmp = i*lcm_num // M + 1
    X_t[tmp-1] = T[i]

# print(X_s,X_t)

for s,t in zip(X_s,X_t):
    if s == "" or t == "" :
        continue
    elif s == t:
        continue
    else:
        print(-1)
        exit()

print(lcm_num)
Problem p03241 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import itertools
from collections import Counter

N, M = map(int, input().split())

def primes(n):
    primfac = []
    d = 2
    while d*d <= n:
        while (n % d) == 0:
            primfac.append(d)  # supposing you want multiple factors repeated
            n //= d
        d += 1
    if n > 1:
       primfac.append(n)
    return primfac


mod = M % N
div = M // N
if mod == 0:
    print(M//N)
    exit()

f = primes(M)

# 素数の場合などは１
if len(f) == 1:
    print(1)
    exit()

cnt = Counter(f)
ans_list = []

tmp_list = []
for k,v in cnt.items():
  tmp_list.append([i for i in range(v+1)])

# print(cnt)
# print(list(itertools.product(*tmp_list)))
for p in itertools.product(*tmp_list):
    tmp = 1
    for k,i in zip(cnt.keys(),p):
        tmp = tmp * (k ** i)

    if tmp > N:
        ans_list.append(M//tmp)

if len(ans_list) == 0:
    print(1)
else:
    print(max(ans_list))

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

N, M = map(int, input().split())

def primes(n):
    primfac = []
    d = 2
    while d*d <= n:
        while (n % d) == 0:
            primfac.append(d)  # supposing you want multiple factors repeated
            n //= d
        d += 1
    if n > 1:
       primfac.append(n)
    return primfac


mod = M % N
div = M // N
if mod == 0:
    print(M//N)
    exit()

f = primes(M)

# 素数の場合などは１
if len(f) <= 1:
    print(1)
    exit()

ans_list = []
for i in range(1,len(f)):
    set1 = set([tuple(sorted(l)) forl in list(itertools.combinations(f, i))])
    for com in set1:
        tmp = 1
        for c in com:
            tmp *= c
        if tmp >= N:
            ans_list.append(M//tmp)

if len(ans_list) == 0:
    print(1)
else:
    print(max(ans_list))

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

N, M = map(int, input().split())

def primes(n):
    primfac = []
    d = 2
    while d*d <= n:
        while (n % d) == 0:
            primfac.append(d)  # supposing you want multiple factors repeated
            n //= d
        d += 1
    if n > 1:
       primfac.append(n)
    return primfac


mod = M % N
div = M // N
if mod == 0:
    print(M//N)
    exit()

f = primes(M)

# 素数の場合などは１
if len(f) <= 1:
    print(1)
    exit()

ans_list = []
for i in range(1,len(f)):
    for com in itertools.combinations(f, i):
        tmp = 1
        for c in com:
            tmp *= c
        if tmp >= N:
            ans_list.append(M//tmp)

print(max(ans_list))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N, M = map(int, input().split())


def primes(n):
    primfac = []
    d = 2
    while d*d <= n:
        while (n % d) == 0:
            primfac.append(d)  # supposing you want multiple factors repeated
            n //= d
        d += 1
    if n > 1:
       primfac.append(n)
    return primfac

if len(primes(M)) <= 1:
    print(1)
    exit()

mod = M % N
div = M // N
if mod == 0:
    print(M//N)
    exit()

# print(mod,div)
# for i in reversed(range(1,div)):
i = div - 1
while True:
    an = M - i*(N-1)
    if an % i == 0:
        print(i)
        exit()
    i -= 1

print(1)
Problem p03262 (python)

Fixed submission:
# -*- coding: utf-8 -*-
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

N, X = map(int, input().split())
xn = list(map(int, input().split()))
xn2 = []

for xi in xn:
    xn2.append(abs(xi - X))

xn2.sort()

gcd_num = max(xn2)
for xi2 in xn2:
    tmp = gcd(xi2,gcd_num)
    if tmp < gcd_num:
        gcd_num = tmp

print(gcd_num)

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

N, X = map(int, input().split())
xn = list(map(int, input().split()))
xn2 = []

for xi in xn:
    xn2.append(xi - X)

xn2.sort()

gcd_num = max(xn2)
for xi2 in xn2:
    tmp = math.gcd(xi2,gcd_num)
    if tmp < gcd_num:
        gcd_num = tmp

print(gcd_num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N, X = map(int, input().split())
xn = list(map(int, input().split()))
xn2 = []

for xi in xn:
    xn2.append(xi - X)

# print(xn2)
print(gcd_list(xn2))
Problem p03287 (python)

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

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N, M = map(int, input().split())
An = list(map(int, input().split()))

Cn = [0]*(N+1)

for i,Ai in enumerate(An):
    if i == 0:
        Cn[i+1] = Ai
    else:
        Cn[i+1] = Cn[i] + Ai

# def func(n):
#     if n <= 1:
#         return 1
#     else:
#         tmp = 1
#         for i in range(2,n+1):
#             tmp = tmp * i
#         return tmp

mod = {}
for i in range(N+1):
    if Cn[i]%M in mod:
        mod[Cn[i]%M] += 1
    else:
        mod[Cn[i]%M] = 1

ans = 0
for val in mod.values():
    if val <= 1:
        continue
    elif val == 2:
        ans += 1
    else:
        # tmp = func(val) / (func(2) * func(val - 2))
        tmp = combinations_count(val,2)
        ans += int(tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# import numpy as np

N, M = map(int, input().split())
An = list(map(int, input().split()))

Cn = [0]*(N+1)

for i,Ai in enumerate(An):
    if i == 0:
        Cn[i+1] = Ai
    else:
        Cn[i+1] = Cn[i] + Ai

# print(Cn)

# for l in range(1,N+1):
#     for r in range(l,N+1):
#         if (Cn[r] - Cn[l-1])%M == 0:
#             ans += 1

def func(n):
    if n <= 1:
        return 1
    else:
        return n * func(n - 1)


mod = {}
for i in range(N+1):
    if Cn[i]%M in mod:
        mod[Cn[i]%M] += 1
    else:
        mod[Cn[i]%M] = 1

# print(mod)

ans = 0
for val in mod.values():
    if val <= 1:
        continue
    elif val == 2:
        ans += 1
    else:
        tmp = func(val) / (func(2) * func(val - 2))
        ans += int(tmp)

print(ans)
Problem p03288 (python)

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

R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

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

R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
elif:
    print('AGC')
Problem p03323 (python)

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

# スペース区切りの整数の入力
A, B = map(int, input().split())

if A <= 8 and B <= 8:
    print('Yay!')
else:
    print(':(')

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

# スペース区切りの整数の入力
N = int(input())
an = list(map(int, input().split()))

sum_cnt = 0
for a in an:
    tmp = a
    cnt = 0
    while tmp % 2 == 0:
        cnt += 1
        tmp = tmp / 2

    sum_cnt += cnt

print(sum_cnt)
Problem p03361 (python)

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

H, W = map(int, input().split())
s = []

for i in range(H):
    s.append(list(input()))

for i in range(H):
    for j in range(W):
        OK_cnt = 0
        if s[i][j] == '#':
            #上
            if j > 0 and s[i][j-1] == '#':
                OK_cnt += 1
            #右
            if i+1 < H and s[i+1][j] == '#':
                OK_cnt += 1
            #下
            if j+1 < W and s[i][j+1] == '#':
                OK_cnt += 1
            #左
            if i > 0 and s[i-1][j] == '#':
                OK_cnt += 1
            if OK_cnt == 0:
                print('No')
                exit()

print('Yes')

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

H, W = map(int, input().split())
s = []

for i in range(H):
    s.append(list(input()))

for i in range(H):
    for j in range(W):
        OK_cnt = 0
        if s[i][j] == '#':
            #上
            if j > 0 and s[i][j-1] == '#':
                OK_cnt += 1
            #右
            if i+1 < W and s[i+1][j] == '#':
                OK_cnt += 1
            #下
            if j+1 < H and s[i][j+1] == '#':
                OK_cnt += 1
            #左
            if i > 0 and s[i-1][j] == '#':
                OK_cnt += 1
            if OK_cnt == 0:
                print('No')
                exit()

print('Yes')