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

Fixed submission:
N,M = map(int,input().split())
student = [list(map(int,input().split())) for _ in range(N)]
cpoint = [list(map(int,input().split())) for _ in range(M)]
for i in range(N):
    mannmn = 10**10
    mann = 10**10
    for j in range(M):
        mann = abs(student[i][0] - cpoint[j][0])+abs(student[i][1] - cpoint[j][1])
        if mann < mannmn:
            mannmn = mann
            ref = j
    print(ref+1)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
student = [list(map(int,input().split())) for _ in range(N)]
cpoint = [list(map(int,input().split())) for _ in range(M)]
for i in range(N):
    mannmn = 10**8
    for j in range(M):
        mann = abs(student[i][0] - cpoint[j][0])+abs(student[i][1] - cpoint[j][1])
        if mann <= mannmn:
            mannmn = mann
            ref = j
    print(ref+1)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
student = [list(map(int,input().split())) for _ in range(N)]
cpoint = [list(map(int,input().split())) for _ in range(M)]
for i in range(N):
    mannmn = 10**8
    for j in range(M):
        mann = abs(student[i][0] - cpoint[j][0])+abs(student[i][1] - cpoint[j][1])
        if mann < mannmn:
            mannmn = mann
            ref = j+1
    print(ref)
Problem p03803 (python)

Fixed submission:
lst = list(map(int,input().split()))

if lst[1] != 1 and lst[0] > lst[1] :
    print('Alice')
elif lst[0] != 1 and lst[0] < lst[1]:
    print('Bob')
elif lst[1] == 1 and lst[0] != 1:
    print('Bob')
elif lst[0] == 1 and lst[1] != 1:
    print('Alice')
else:
  print('Draw')

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

if lst[0] > lst[1]:
  print('Alice')
elif lst[0] < lst[1]:
  print('Bob')
else:
  print('Draw')
Problem p02661 (python)

Fixed submission:
N = int(input())
A = [0]*N
B = [0]*N
i = 0
for i in range(N):
    A[i], B[i] = map(int, input().split())
sA = sorted(A)
sB = sorted(B)
if N % 2 == 0:
    ans = ((sB[(N//2)-1]+sB[(N//2)]) - (sA[(N//2)-1]+sA[(N//2)])) + 1
else:
    ans = (sB[(N-1)//2]-sA[(N-1)//2]) + 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())
A = [0]*N
B = [0]*N
i = 0
for line in readlines():
    A[i], B[i] = map(int, line.rstrip().decode('utf-8').split())
    i+=1
sA = sorted(A)
sB = sorted(B)
if N % 2 == 0:
    ans = ((sB[(N//2)-1]+sB[(N//2)]) - (sA[(N//2)-1]+sA[(N//2)])) + 1
else:
    ans = (sB[(N-1)//2]-sA[(N-1)//2]) + 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b = input().split()
A = int(a)
B = float(b)
print(int(A*B))
Problem p02712 (python)

Fixed submission:
N = int(input())
FB = [0]*N
for i in range(1,N+1):
    if i % 3 != 0 and i % 5 != 0:
        FB[i-1] = i

print(sum(FB))

Buggy submission (verdict: Runtime Error):
N = int(input())
FB = [0]*N
for i in range(1,N+1):
    if i % 3 != 0 and i % 5 != 0:
        FB[i] = i

print(sum(FB))
Problem p02726 (python)

Fixed submission:
import itertools

N, X, Y = map(int, input().split())

combi = list(itertools.combinations(range(1,N+1), 2))
dist = [[i+1, 0] for i in range(0, N-1)]

c = [min([kyori[1] - kyori[0], int(abs((kyori[1] - Y))) + 1 + int(abs((X - kyori[0])))]) for kyori in combi]

for i in range(len(c)):
    dist[c[i]-1][1] += 1
for i in range(0, N-1):
    print(dist[i][1])

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
#from scipy.special import comb
import itertools

N, X, Y = map(int, input().split())

combi = list(itertools.combinations(range(1,N+1), 2))
#print(combi)
dist = {}
for i in range(1, N):
    dist[i] = 0

for kyori in combi:
    a = kyori[1] - kyori[0]
    b = int(abs((kyori[1] - Y))) + 1 + int(abs((X - kyori[0])))
    c = min([a, b])
    dist[c] += 1
    #print(c, kyori)
dist2 = sorted(dist.items())
#print(dist, dist2)
for i in range(0, N-1):
    print(dist2[i][1])

Buggy submission (verdict: Runtime Error):
#from scipy.misc import comb
from scipy.special import comb
import itertools

N, X, Y = map(int, input().split())

combi = list(itertools.combinations(range(1,N+1), 2))
#print(combi)
dist = {}
for i in range(1, N):
    dist[i] = 0

for kyori in combi:
    if kyori[1] >= Y and kyori[0] <= X:
        c = (kyori[1] - Y) + 1 + (X - kyori[0])
    elif kyori[1] >= Y:
        a = kyori[1] - kyori[0]
        b = (kyori[1] - Y) + 1 + int(abs((X - kyori[0])))
        c = min([a, b])
    elif kyori[0] <= X:
        a = kyori[1] - kyori[0]
        b = int(abs(kyori[1] - Y)) + 1 + (X - kyori[0])
        c = min([a, b])
    else:
        c = kyori[1] - kyori[0]
    dist[c] += 1
    #print(c, kyori)
dist2 = sorted(dist.items())
#print(dist, dist2)
for i in range(0, N-1):
    print(dist2[i][1])
Problem p02729 (python)

Fixed submission:
from scipy.misc import comb
n, m = map(int, input().split())
print(comb(n, 2, exact=True)+comb(m, 2, exact=True))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 21:08:11 2020

@author: azikausy
"""


from scipy.special import comb
n, m = map(int, input().split())
print(int(comb(n,2)+comb(m,2)))
Problem p02735 (python)

Fixed submission:
import numpy as np

H, W = map(int, input().split())
temp = [list(input().replace("#","0").replace(".","1")) for i in range(H)]
masu = [[int(temp[i][j]) for j in range(W)] for i in range(H)]

dp = np.zeros((H, W))
if masu[0][0] == 0:
    dp[0][0] = 1

for i in range(0,H):
    for j in range(0,W):
        if i == 0:
            a = 100000
        else:
            if masu[i][j] == 0 and masu[i-1][j] == 1:
                a = dp[i-1][j] + 1
            else:
                a = dp[i-1][j]
        if j == 0:
            b = 100000
        else:
            if masu[i][j] == 0 and masu[i][j-1] == 1:
                b = dp[i][j-1] + 1
            else:
                b = dp[i][j-1]
        if a != 100000 or b != 100000:
            dp[i][j] = min([a, b])
print(int(dp[H-1][W-1]))

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
s = ""
for i in range(0, H):
    temp = input().replace("#", "0")
    l_bit = temp.replace(".", "1")
    s = s + l_bit

route1 = []
route = [[]]
for j in range(0, W-1):
    route[0].append(j)
print(route)
count = len(route)

#k :0~W-1
best = (H - 1) + (W - 1)
for k in range(0, W-1):    
    for num in range(0, count):
        for p in range(0, (H*W)-(W-k)):
            route1 = route[num]
            route1[W-2-k] = route1[W-1-k-1] + p
            if W > 2:
                if route1[W-k-3] % W <= route1[W-k-2] % W: 
                    route.append(route1) 
                    count += 1
                    block = (H - 1) + (W - 1)
                    print(route1)
                    for q in range(0, len(route1)):
                        if q+1 != len(route1)+1:
                            print(q)
                            if s[route1[q+1]] == s[route1[q]] and ((route1[q+1] == route1[q] + 1) or (route1[q] % W == (route1[q] + 1) % W)):
                                block = block - 1
                                best = min([best, block])
            else:
                route.append(route1) 
                count += 1
                block = (H - 1) + (W - 1)
                print(route1)
                for q in range(0, len(route1)):
                    if q+1 != len(route1):
                        if s[route1[q+1]] == s[route1[q]] and ((route1[q+1] == route1[q] + 1) or (route1[q] % W == (route1[q] + 1) % W)):
                            block = block - 1
                best = min([best, block])

print(best)

Buggy submission (verdict: Runtime Error):
                    route.append(route1) 
                    count += 1
                    block = (H - 1) + (W - 1)
                    print(route1)
                    for q in range(0, len(route1)):
                        if q+1 != len(route1):
                            if s[route1[q+1]] == s[route1[q]] and ((route1[q+1] == route1[q] + 1) or (route1[q] % W == (route1[q] + 1) % W)):
                                block = block - 1
                    best = min([best, block])
Problem p02912 (python)

Fixed submission:
import heapq
import math
#これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

"""
a = [1,7,3,5,4]

#heapify
#配列a = [1,7,3,5,4]をheapにする
heapq._heapify_max(a)
print(a) #[7, 5, 3, 1, 4]

#heappop
#最大値の取り出し
print(_heappop_max(a)) #7
print(a) #[5, 4, 3, 1]

#heappush
#要素(2)の挿入
_heappush_max(a,2)
print(a) #[5, 4, 3, 1, 2]

#最大値の取り出し
print(_heappop_max(a)) #5
"""

N, M = map(int, input().split())
a = [int(i) for i in input().split()]
heapq._heapify_max(a)

for j in range(M):
    _heappush_max(a, _heappop_max(a)//2)
print(sum(a))

Buggy submission (verdict: Runtime Error):
import heapq
import math
#これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

"""
a = [1,7,3,5,4]

#heapify
#配列a = [1,7,3,5,4]をheapにする
heapq._heapify_max(a)
print(a) #[7, 5, 3, 1, 4]

#heappop
#最大値の取り出し
print(_heappop_max(a)) #7
print(a) #[5, 4, 3, 1]

#heappush
#要素(2)の挿入
_heappush_max(a,2)
print(a) #[5, 4, 3, 1, 2]

#最大値の取り出し
print(_heappop_max(a)) #5
"""

N, M = map(int, input().split())
a = [int(i) for i in input().split()]
heapq._heapify_max(a)

okaiage = []
heapq._heapify_max(okaiage)
_heappush_max(okaiage, _heappop_max(a)/2)

m = M - 1
for j in range(N-1):
    temp_oka = _heappop_max(okaiage)
    temp_a = _heappop_max(a)
    #print(temp_oka, temp_a)
    if m > 0:
        if temp_a > temp_oka:
            _heappush_max(okaiage, temp_a/2)
            _heappush_max(okaiage, temp_oka)
        else:
            _heappush_max(okaiage, temp_a)
            _heappush_max(okaiage, temp_oka/2)
    else:
        _heappush_max(okaiage, temp_a)
        _heappush_max(okaiage, temp_oka)
    m -= 1
if m > 0:
    for i in range(m):
        temp_oka = _heappop_max(okaiage) / 2
        _heappush_max(okaiage, temp_oka)
#print(okaiage)
okaiage_kiri = [int(math.floor(_heappop_max(okaiage))) for i in range(N)]
#print(okaiage_kiri)
print(sum(okaiage_kiri))
Problem p02990 (python)

Fixed submission:
def comb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n-r)
import math

MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(K):
    if N-K - j < 0:
        print(0)
        continue
    tmp = (comb(N-K+1, j+1)) % MOD
    print(int((comb(K-1, j) * tmp) % MOD))

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
#if min(K, N-K+1) == N-K+1:
#    for i in range(N-K+1, K):
#        print(0)

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)
Problem p03075 (python)

Fixed submission:
i = [int(input()) for i in range(6)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[4] - i[2] > i[5]:
  temp += 1
if i[4] - i[1] > i[5]:
  temp += 1
if i[4] - i[0] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[3] - i[1] > i[5]:
  temp += 1
if i[3] - i[0] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1
if i[2] - i[0] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

Buggy submission (verdict: Runtime Error):
i = [int(input()) for i in range(5)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[3] - i[2] > i[4]:
  temp += 1
if i[2] - i[1] > i[4]:
  temp += 1  
if i[1] - i[0] > i[4]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

Buggy submission (verdict: Runtime Error):
i = [int(input()) for i in range(5)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp == 0:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
i = [int(input()) for i in range(5)]
temp = 0
for j in range(len(i)-1):
  for k in range(j-1):
    if i[j] - i[k] > i[5]:
      temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
i = [int(input()) for i in range(3)]
temp = 0
if i[1] - i[0] > i[5]:
  temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
s = [input() for i in range(3)]
temp = 0
if int(s[1])-int(s[0]) > int(s[5]):
  temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
s = [input() for i in range(3)]
temp = 0
for i in range(len(s)-1):
  for j in range(i):
    if int(s[i])-int(s[j]) > int(s[5]):
      temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
s = [int(input()) for i in range(3)]
temp = 0
for i in range(len(s)-1):
  for j in range(i):
    if s[i]-s[j] > s[5]:
      temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
temp = input().split()
a, b, c, d, e, k = int(temp[0]), int(temp[1]), int(temp[2]), int(temp[3]), int(temp[4]), int(temp[5])
answer = 0
if e - d > k:
  answer += 1
if d - c > k:
  answer += 1
if c - b > k:
  answer += 1
if b - a > k:
  answer += 1
if answer == 0:
  print('Yay!')
else:
  print(':(')
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
	S = input()
	LEN = len(S)
	r = LEN
	l = LEN-1
	count = 0
	lst = []
	amari = 0
	while(l >= 0):
		amari = (amari + int(S[l])*10**(l-1)%2019)%2019
		
		if amari in lst:
			count += 1
		elif amari == 0:
			count += 1
			lst.append(count)
		else:
			lst.append(amari)
		l -= 1

	print(count)
Problem p02831 (python)

Fixed submission:
import fractions as math

if __name__ == '__main__':
	A, B = map(int, input().split())
	gcd = math.gcd(A,B)
	ans = (A//gcd) * B
	print(ans)

Buggy submission (verdict: Runtime Error):
import math

if __name__ == '__main__':
	A, B = map(int, input().split())
	gcd = math.gcd(A,B)
	ans = (A//gcd) * B
	print(ans)
Problem p02820 (python)

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


def main():
  N, K = list(map(int, input().split()))
  R, S, P = list(map(int, input().split()))
  T = input()[:-1]

  mem = []
  hand_map = {'r': 'p', 's': 'r', 'p': 's'}
  score_map = {'r': P, 's': R, 'p': S}

  score = 0

  for i in range(K):
    mem.append(hand_map[T[i]])
    score += score_map[T[i]]

  for i in range(K, N):
    if not mem[i-K] == hand_map[T[i]]:
      mem.append(hand_map[T[i]])
      score += score_map[T[i]]
      continue
    cand = ['r', 's', 'p']
    # print(mem[i-K])
    cand.remove(mem[i-K])
    if i+K < N and not(mem[i-K] == hand_map[T[i+K]]):
      cand.remove(hand_map[T[i+K]])
    mem.append(cand[0])

  print(score)


if(__name__ == '__main__'):
  main()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
from sys import stdin
input = stdin.readline


def main():
  N, K = list(map(int, input().split()))
  R, S, P = list(map(int, input().split()))
  T = input()[:-1]

  mem = []
  hand_map = {'r': 'p', 's': 'r', 'p': 's'}
  score_map = {'r': P, 's': R, 'p': S}

  score = 0

  for i in range(K):
    mem.append(hand_map[T[i]])
    score += score_map[T[i]]

  for i in range(K, N):
    if not mem[i-K] == hand_map[T[i]]:
      mem.append(hand_map[T[i]])
      score += score_map[T[i]]
      continue
    cand = ['r', 's', 'p']
    # print(mem[i-K])
    cand.remove(mem[i-K])
    if i+K <= N and not(mem[i-K] == hand_map[T[i+K]]):
      cand.remove(hand_map[T[i+K]])
    mem.append(cand[0])

  print(score)


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

Fixed submission:
import sys 
a,b,c,k = map(int,input().split())
max=0
if(a==k):
    print(a)
elif(a>k):
    print(k)
else:
    if(a<k):
        max+=a
        k=k-a
    if(b>k):
        print(max)
    else:
        k=k-b
        if(k<=0):
            print(max)
        else:
            if(c>=k):
                max-=k
                print(max)
            elif(c<k):
                max-=c
                print(max)

Buggy submission (verdict: Runtime Error):
import os
import random
import re
import sys

def solution(a,b,c,k):
    max=0
    while(k>0):
        while(a>0 and k>0):
            max+=1
            a-=1
            k-=1
        if(k<=0):
            return max
            break
        while(b>0 and k>0):
            b-=1
            k-=1
        if(k<=0):
            return max
            break
        while(c>0 and k>0):
            max-=1
            c-=1
            k-=1
        return max
            
                
if __name__ == '__main__':
    fptr = sys.stdout
    a=int(input())
    b=int(input())
    c=int(input())
    k=int(input())
    result = solution(a,b,c,k)

    fptr.write(str(result) + '\n')


fptr.close()
Problem p02987 (python)

Fixed submission:
import collections
s = input()
c = collections.Counter(s)
if list(c.values())[0] == 2 and list(c.values())[1] == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split(' '))
red = N-K
p = 10**9+7


def comb(n, k, p):
    """power_funcを用いて(nCk) mod p を求める"""
    from math import factorial
    if n < 0 or k < 0 or n < k:
        return 0
    if n == 0 or k == 0:
        return 1
    a = factorial(n) % p
    b = factorial(k) % p
    c = factorial(n-k) % p
    return (a*power_func(b, p-2, p)*power_func(c, p-2, p)) % p


def power_func(a, b, p):
    """a^b mod p を求める"""
    if b == 0:
        return 1
    if b % 2 == 0:
        d = power_func(a, b//2, p)
        return d*d % p
    if b % 2 == 1:
        return (a*power_func(a, b-1, p)) % p


def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)


for i in range(1, K+1):
    print(comb(red+1, i, p)*comb(K-1, i-1, p) % p)
Problem p02785 (python)

Fixed submission:
n,k = map(int,input().split())
l = [int(i) for i in input().split()]
ls = sorted(l)
if k == 0:
  print(sum(l))
else:
  print(sum(ls[:-k]))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = [int(i) for i in input().split()]
for i in range(k):
    l.remove(max(l))
print(sum(l))
Problem p02859 (python)

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

Buggy submission (verdict: Runtime Error):
r = input()
print(r**2)
Problem p02880 (python)

Fixed submission:
N = int(input())
L=set()
for i in range(1,10):
  for j in range(1,10):
    L.add(i*j)
if N in L:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
L=set()
for i in range(2,9):
  for j in range(2,9):
    L.add(i*j)
if N in L:
  print(Yes)
else:
  print(No)
Problem p02627 (python)

Fixed submission:
c=input()
if(c.isupper()==True):
  print('A')
else:
  print('a')

Buggy submission (verdict: Runtime Error):
c=input()
if(c.isupper()==True):
  	print('A')
else
	print('a')
Problem p03209 (python)

Fixed submission:
n, x = map(int, input().split())

burger = [1]*(n+1)
patty = [1]*(n+1)

stopped = 0
for i in range(1,n):
	burger[i] = 2*burger[i-1]+3
	patty[i] = 2*patty[i-1]+1
	
def solve(n, x):
	if n == 0:
		if x == 0:
			return 0
		else:
			return 1
	elif n == 1:
		if x == 0:
			return 0
		elif x == 1:
			return 0
		elif x == 2:
			return 1
		elif x == 3:
			return 2
		elif x == 4:
			return 3
		else:
			return 3
	elif x == 0:
		return 0
	elif x == burger[n]:
		return patty[n]
	elif x == burger[n-1]+1:
		return patty[n-1]
	elif x == burger[n-1]+2:
		return patty[n-1]+1
	elif x < burger[n-1]+2:
		return solve(n-1, x-1)
	elif x > burger[n-1]+2:
		return solve(n-1, x-burger[n-1]-2)+patty[n-1]+1

print(solve(n, x))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())

burger = [1]*(n+1)
patty = [1]*(n+1)

stopped = 0
for i in range(1,n):
	burger[i] = 2*burger[i-1]+3
	patty[i] = 2*patty[i-1]+1
	
def solve(n, x):
	if n = 0:
		if x = 0:
			return 0
		else:
			return 1
	elif x == 0:
		return 0
	elif x == burger[n]:
		return patty[n]
	elif x == burger[n-1]+1:
		return patty[n-1]
	elif x == burger[n-1]+2:
		return patty[n-1]+1
	elif x < burger[n-1]+2:
		return solve(n-1, x-1)
	elif x > burger[n-1]+2:
		return solve(n-1, x-burger[n-1]-2)+patty[n-1]+1

print(solve(n, x))
Problem p02707 (python)

Fixed submission:
N = int(input())
ls = list(map(int, input().split()))
anls = [0]*(N+1)
for i in ls:
    anls[i] += 1
for i in range(1,N+1):
    print(anls[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int, input()))
anls = [0]*(N+1)
for i in ls:
    anls[i] += 1
for i in range(1,N+1):
    print(anls[i])
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
a = n*(n-1)/2 + m*(m-1)/2
print(int(a))

Buggy submission (verdict: Runtime Error):
n, m = input().split()
a = n*(n-1)/2 + m*(m-1)/2
print(a)

Buggy submission (verdict: Runtime Error):
def out(m, n):
  a = m*(m-1)%2 + n*(n-1)%2
  return a

m, n = list(input())
a = out(m,n)

print(a)

Buggy submission (verdict: Runtime Error):
def out(m, n):
  a = m*(m-1)%2 + n*(n-1)%2
  return a

m, n = int(input())
a = out(m,n)

print(a)

Buggy submission (verdict: Runtime Error):
def out(m, n):
  a = m*(m-1)%2 + n*(n-1)%2
  return a

m, n = int(input())
a = out(m,n)

print(a)
Problem p03835 (python)

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

ans = 0
for i in range(K+1):
    for j in range(K+1):
        z = S-(i+j)
        if 0<= z and z <= K:
            ans += 1
print(ans)

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

ans = 0
for i in range(K+1):
    if 0<= S-i <= K:
        ans += (S-i)+1
    elif S-i <= 2K:
        a = (S-i) -K
        ans += (K-a)+1
print(ans)
Problem p02701 (python)

Fixed submission:
N = int(input())
S = []
c = 0
for i in range(N):
	S.append(input())

S = list(set(S))
print(len(S))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
c = 0
for i in range(N):
	S.append(input())
    S = list(set(S))
print(len(S))