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

Fixed submission:
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, q = read_line(int, int)
s, = read_line(str)

m = [0 for _ in range(len(s) + 1)]

c = 0
for i in range(len(s)):
    if s[i:i+2] == 'AC':
        c += 1
    m[i + 1] = c

for i in range(q):
    l, r = read_line(int, int)

    if c == 0:
        print(0)
        continue
    print(m[r - 1] - m[l - 1])

Buggy submission (verdict: Runtime Error):
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, q = read_line(int, int)
s, = read_line(str)

p = []
i = 0
while i < len(s) - 1:
    if s[i:i+2] == 'AC':
        p.append(i)
        i += 2
    else:
        i += 1

for i in range(q):
    l, r = read_line(int, int)
    l, r = l - 1, r - 1

    c = 0
    for j in range(len(p)):
        pp = p[j]
        if l <= pp:
            break
        c += 1

    for jj in reversed(range(j, len(p))):
        pp = p[jj]
        if pp + 1 <= r:
            break
        c += 1

    print(len(p) - c)

Buggy submission (verdict: Runtime Error):
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, q = read_line(int, int)
s, = read_line(str)

p = []
i = 0
while i < len(s) - 1:
    if s[i:i+2] == 'AC':
        p.append(i)
        i += 2
    else:
        i += 1

for i in range(q):
    l, r = read_line(int, int)
    l, r = l - 1, r - 1

    c = 0
    for j in range(len(p)):
        pp = p[j]
        if l <= pp:
            break
        c += 1

    for jj in range(len(p) - 1, j - 1, -1):
        pp = p[jj]
        if pp + 1 <= r:
            break
        c += 1

    print(len(p) - c)

Buggy submission (verdict: Runtime Error):
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, q = read_line(int, int)
s, = read_line(str)

p = []
i = 0
while i < len(s) - 1:
    if s[i:i+2] == 'AC':
        p.append(i)
        i += 2
    else:
        i += 1

for i in range(q):
    l, r = read_line(int, int)
    l, r = l - 1, r - 1

    c = 0
    for j in range(len(p)):
        pp = p[j]
        if l <= pp:
            break
        c += 1

    for jj in range(len(p), j, -1):
        pp = p[j]
        if pp + 1 <= r:
            break
        c += 1

    print(len(p) - c)

Buggy submission (verdict: Runtime Error):
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, q = read_line(int, int)
s, = read_line(str)

p = []
for i in range(len(s) - 1):
    if s[i:i+2] == 'AC':
        p.append(i)

for i in range(q):
    l, r = read_line(int, int)
    l, r = l - 1, r - 1

    c = 0
    print(s[l:r + 1])
    for pp in p:
        if l <= pp and pp + 1 < r:
            c += 1
    print(c)

Buggy submission (verdict: Runtime Error):
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, q = read_line(int, int)
s, = read_line(str)

p = []
for i in range(len(s) - 1):
    if s[i:i+2] == 'AC':
        p.append(i)

for i in range(q):
    l, r = read_line(int, int)
    l, r = l - 1, r

    c = 0
    print(s[l:r])
    for pp in p:
        if l <= pp and pp + 1 < r:
            c += 1
    print(c)
Problem p03240 (python)

Fixed submission:
N = int(input())

xyh = []
for _ in range(N):
    x, y, h = map(int, input().split())
    if h != 0:
        xx, yy, hh = x, y, h
    xyh.append((x, y, h))

# print(xyh)

# h = max(H - |x - Cx| - |y - Cy|, 0)

'''
  0 1 2 3
0
1     5
2   5   5
3     5

   99 100
0 192
1 191 192
'''


def f():
    for tx in range(101):
        for ty in range(101):
            th = hh + abs(xx - tx) + abs(yy - ty)
            if all(h == max(th - abs(tx - x) - abs(ty - y), 0) for x, y, h in xyh):
                return tx, ty, th

print(*f())

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

xyh = []
for _ in range(N):
    x, y, h = map(int, input().split())
    xyh.append((x, y, h))

# print(xyh)

# h = max(H - |x - Cx| - |y - Cy|, 0)

'''
  0 1 2 3
0
1     5
2   5   5
3     5

   99 100
0 192
1 191 192
'''


def f():
    for tx in range(101):
        for ty in range(101):
            th = xyh[0][2] + abs(xyh[0][0] - tx) + abs(xyh[0][1] - ty)
            if all(h == max(th - abs(tx - x) - abs(ty - y), 0) for x, y, h in xyh):
                return tx, ty, th
print(*f())
Problem p03605 (python)

Fixed submission:
n = input()

if n[0] == '9' or n[1] == '9':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
from collections import Counter

def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, m, r = read_line(int, int, int)

rs = [int(r) for r in input().split()]

cities = Counter()

routes = {}
costs = {}
for _ in range(m):
    a, b, c = read_line(int, int, int)

    cities[a] = 1
    cities[b] = 1

    if a in routes:
        routes[a][b] = c
    else:
        routes[a] = { b : c }

    if b in routes:
        routes[b][a] = c
    else:
        routes[b] = { a : c }

for a in cities.keys():
    for b in cities.keys():
        if a not in costs:
            costs[a] = {}
        if b not in costs[a]:
            if a in routes and b in routes[a]:
                costs[a][b] = routes[a][b]
            else:
                costs[a][b] = 100000 + 1

# print('*')

keys = list(cities.keys())

for k in keys:
    for i in keys:
        for j in keys:
            c = costs[a][k] + costs[k][b]
            if a != b and costs[a][b] > c:
                costs[a][b] = c

# print('*')

def cost(selected):
    c = 0
    for i in range(len(selected) - 1):
        a = selected[i]
        b = selected[i + 1]
        c += costs[a][b]
    return c

smallest = 100000 + 1

def f(selected, rest):
    global smallest
    if len(rest) == 0:
        c = cost(selected)
        if smallest > c:
            smallest = c
    else:
        for i in range(len(rest)):
            r = rest[i]
            rest_copy = rest[:]
            del rest_copy[i]
            if cost(selected + [r]) < smallest:
                f(selected + [r], rest_copy)

f([], keys)
print(smallest)
Problem p03623 (python)

Fixed submission:
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

x, a, b = read_line(int, int, int)

print('A' if abs(x - a) < abs(x - b) else 'B')

Buggy submission (verdict: Runtime Error):
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n,  = read_line(int)

m = 1000000007

domino = []
domino.append(input())
domino.append(input())

# print(domino[0])
# print(domino[1])

def compress(line):
    x = [line[0]]
    for c in line[1:]:
        if x[-1] != c:
            x.append(c)
    return x

domino[0] = compress(domino[0])
domino[1] = compress(domino[1])

xs = []
for i in range(len(domino[0])):
    xs.append(domino[0][i] != domino[1][i])
# print(xs)

patterns = None
if xs[0]:
    patterns = 6
else:
    patterns = 3

lastX = xs[0]
for x in xs[1:]:
    if x:
        # T -> T
        if lastX:
            patterns *= 3
        else:
            # F -> T
            patterns *= 2
    else:
        # T -> F
        if lastX:
            patterns *= 1
        else: # F -> F
            patterns *= 2
    lastX = x

print(patterns % m)

# T -> T

# 6 * 4 = 24

# 0|1120
# 1|2002

# 0
# 2

# 1
# 0

# 1
# 2

# 2
# 0

# 2
# 1


# F -> T

# 3 * 2 = 6

# 0|12
# 0|21
# 
# 1|02
# 1|20
# 
# 2|10
# 2|01


# T -> F

# 6 * 1 = 6

# 0|2
# 1|2

# 0|1
# 2|1

# 1|2
# 0|2

# 1|0
# 2|0

# 2|1
# 0|1

# 2|0
# 1|0

# F -> F

# 3 * 2 = 6

# 0 | 12
# 1 | 02
# 2 | 01
Problem p02983 (python)

Fixed submission:
import sys

l, r = [int(x) for x in input().split()]

remainder_list = []

if r - l >= 2019:
    print(0)
    sys.exit()
else :
    for x in range(l, r):
        for y in range(x + 1, r + 1):
            remainder_list.append((x * y) % 2019)

remainder_list.sort()
print(remainder_list[0])

Buggy submission (verdict: Runtime Error):
l, r = [int(x) for x in input().split()]

remainder_list = []

if r - l >= 2019:
  print(0)
else :
  for x in range(l, r):
    remainder_list.append((l * (x + 1)) % 2019)

remainder_list.sort()
print(remainder_list[0])

Buggy submission (verdict: Runtime Error):
l, r = [int(x) for x in input().split()]

remainder_list = []

if r - l >= 2019:
	print(0)
else :
	for x in range(l, r):
    	remainder_list.append((l * (x + 1)) % 2019)

remainder_list.sort()
print(remainder_list[0])
Problem p02995 (python)

Fixed submission:
import fractions

d = [int(x) for x in input().split()]
lcm = int(d[2] * d[3] // fractions.gcd(d[2], d[3]))
b = d[1] - int(d[1] // d[2]) - int(d[1] // d[3]) + int(d[1] // lcm)
a_1 = d[0] - 1
a = a_1 - int(a_1 // d[2]) - int(a_1 // d[3]) + int(a_1 // lcm)
print(b - a)

Buggy submission (verdict: Runtime Error):
import math ##the version before 3.4 : import fractions

d = [int(x) for x in input().split()]
print(d[1] - d[0] + 1 - (int(d[1] // d[2]) - int((d[0] - 1) // d[2]) + int(d[1] // d[3]) - int((d[0] - 1) // d[3]) - int(d[1] // (d[2] * d[3] // math.gcd(d[2], d[3]))) - int((d[0] - 1) // (d[2] * d[3]// math.gcd(d[2], d[3])))))

Buggy submission (verdict: Runtime Error):
import fraction

d = [int(x) for x in input().split()]
print(d[1] - d[0] + 1 - (int(d[1] / d[2]) - int((d[0] - 1) / d[2]) + int(d[1] / d[3]) - int((d[0] - 1) / d[3]) - int(d[1] / (d[2] * d[3] / fraction.gcd(d[2], d[3]))) - int((d[0] - 1) / (d[2] * d[3]/ fraction.gcd(d[2], d[3])))))

Buggy submission (verdict: Runtime Error):
import math

d = [int(x) for x in input().split()]
print(d[1] - d[0] + 1 - (int(d[1] / d[2]) - int((d[0] - 1) / d[2]) + int(d[1] / d[3]) - int((d[0] - 1) / d[3]) - int(d[1] / (d[2] * d[3] / math.gcd(d[2], d[3]))) - int((d[0] - 1) / (d[2] * d[3]/ math.gcd(d[2], d[3])))))
Problem p03160 (python)

Fixed submission:
def solve_dp(p):
    i = 0
    while i < N:
        if p == 0:
            dp[0] = 0
        elif p == 1:
            dp[1] = abs(h[1] - h[0])
        elif p >= 2 and p <= N - 1:
            if abs(h[p] - h[p-1]) + dp[p-1] > abs(h[p] - h[p-2]) + dp[p-2]:
                dp[p] = abs(h[p] - h[p-2]) + dp[p-2]
            else:
                dp[p] = abs(h[p] - h[p-1]) + dp[p-1]
        else:
            return

        p += 1
        i += 1

N = int(input())
h = [int(x) for x in input().split()]

dp = [0] * N
solve_dp(0)

print(dp[N-1])

Buggy submission (verdict: Runtime Error):
def solve_dp(p):
    while p < N:
        if p < N - 1:
            if dp[p+1] > (abs(h[p] - h[p+1]) + dp[p]):
                dp[p+1] = abs(h[p] - h[p+1]) + dp[p]

        if p < N - 2:
            if dp[p+2] > (abs(h[p] - h[p+2]) + dp[p]):
                dp[p+2] = abs(h[p] - h[p+2]) + dp[p]

        print(dp)
        p += 1

N = int(input())
h = [int(x) for x in input().split()]
dp = [100000000] * (N + 1)
dp[0] = 0
solve_dp(0)
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
def solve_dp(p):
    if p == 0:
        dp[0] = 0
    elif p == 1:
        dp[1] = abs(h[1] - h[0])
    elif p >= 2 and p <= N - 1:
        if abs(h[p] - h[p-1]) > abs(h[p] - h[p-2]):
            dp[p] = abs(h[p] - h[p-2]) + dp[p-2]
        else:
            dp[p] = abs(h[p] - h[p-1]) + dp[p-1]
    else:
        return

    p += 1
    solve_dp(p)

N = int(input())
h = [int(x) for x in input().split()]

dp = [0] * N
solve_dp(0)

print(dp[N-1])
Problem p03633 (python)

Fixed submission:
import fractions
from functools import reduce

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

def lcm_rec(num):
    return reduce(lcm, num, 1)

N = int(input())
T = [0]*N
for i in range(N):
    T[i] = int(input())

ans = lcm_rec(T)
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce

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

def lcm_rec(num):
    return reduce(lcm, num, 1)

N = int(input())
T = [0]*N
for i in range(N):
    T[i] = int(input())

ans = lcm_rec(T)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

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

def lcm_rec(num):
    return reduce(lcm, num, 1)

N = int(input())
T = [0]*N
for i in range(N):
    T[i] = int(input())

ans = lcm_rec(T)
print(ans)
Problem p03136 (python)

Fixed submission:
num = int(input())
lens = [int(a) for a in input().split(' ')]
max_len = max(lens)
lens.remove(max_len)
sum_lens = sum(lens)
 
if max_len < sum_lens:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
num = int(input())
lens = [int(a) for a in input().split(' ')]
max_len = max(len)
lens.remove(max_len)
sum_lens = sum(lens)

if max_len < sum_lens:
  print('Yes')
else:
  print('No')
Problem p03264 (python)

Fixed submission:
import math

s = int(input())

print(math.ceil(s/2)*math.floor(s/2))

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

if s%2 == 0:
  a = s/2
  b = s/2
else:
  a = s/2
  b = s/2+1

print(a*b)

Buggy submission (verdict: Runtime Error):
import math

s = input()

print(math.ceil(s/2)*math.floor(s/2))

Buggy submission (verdict: Runtime Error):
import math
s = input()
return math.floor(s/2)*math.ceil(s/2)
Problem p03338 (python)

Fixed submission:
N = int(input())
S = list(str(input()))
countlist=[]
for i in range(0,N):
    s1 = set(S[:i])
    s2 = set(S[i:])

    matched_list=list(s1 & s2)
    countlist.append(len(matched_list))

ans = max(countlist)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(str(input()))
countlist=[]
for i in range(1,N-1):
    s1 = set(S[0:i])
    s2 = set(S[i:])

    matched_list=list(s1 & s2)
    countlist.append(len(matched_list))

ans = max(countlist)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(str(input()))
countlist=[]
if N % 2 == 0:
    split = N / 2
    odd = False
else:
    split = N / 2 + 1
    odd = True
for i in range(1,N-1):
    s1 = set(S[0:i])
    s2 = set(S[i:])
    
    matched_list=list(s1 & s2)
    countlist.append(len(matched_list))

ans = sorted(countlist,reverse=True)


print(ans[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(str(input()))
countlist=[]
anslist =[]
if N % 2 == 0:
    split = N / 2
    odd = False
else:
    split = N / 2 + 1
    odd = True
for i in range(1,N-1):
    if i > split:
        check = 0
    else:
        check = 1
    s1 = list(set(S[0:i]))
    s2 = list(set(S[i:]))
   # print(s1)
   # print(s2)
    if check == 0:
        for j in s2:
            if j not in s1:
                s2.remove(j)
    else:
        for j in s1:
            if j not in s2:
                s1.remove(j)
    if(check == 0):
        countlist.append(len(s2))
    else:
        countlist.append(len(s1))

ans = sorted(countlist,reverse=True)


print(ans[0])
Problem p03359 (python)

Fixed submission:
a,b = list(map(int,input().split()))
cnt = 0
for m in range(1,a+1):
    if m == a:
        last = b
    else:
        last = 31
    for d in range(1,last+1):
        if m == d :
            cnt += 1
            #print(m,d)

print(cnt)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
arr = [list(input()) for i in range(N)]
newmat = [[0 for i in range(M)] for j in range(N)]
nocheck = 0
count = 0
for i in range(N):
    for j in range(M):
        if arr[i][j] is '#':
            newmat[i][j] = 1
        else:
            newmat[i][j] = 0

for i in range(N):
    for j in range(M):
        if newmat[i][j] == 1:
            count += 1
            if i == 0 and j == 0:
                if newmat[i][j+1] == 0 and newmat[i+1][j] == 0:
                    nocheck = 1
                    break
            elif i == 0 and j == (M-1):
                if newmat[i][j-1] == 0 and newmat[i+1][j] == 0:
                    nocheck = 1
                    break
            elif i == (N-1) and j == 0:
                if newmat[i][j+1] == 0 and newmat[i-1][j] == 0:
                    nocheck = 1
                    break
            elif i == (N-1) and j == (M-1):
                if newmat[i][j-1] == 0 and newmat[i-1][j] == 0:
                    nocheck = 1
                    break
            elif i == 0 and j != 0:
                if newmat[i][j+1] == 0 and newmat[i+1][j] == 0 and newmat[i][j-1] == 0:
                    nocheck = 1
                    break
            elif i != 0 and j == 0:
                if newmat[i][j + 1] == 0 and newmat[i + 1][j] == 0 and newmat[i-1][j] == 0:
                    nocheck = 1
                    break
            elif i == (N-1) and j != (M-1):
                if newmat[i][j+1] == 0 and newmat[i-1][j] == 0 and newmat[i][j-1] == 0:
                    nocheck = 1
                    break
            elif i != (N-1) and j == (M-1):
                if newmat[i-1][j] == 0 and newmat[i+1][j] == 0 and newmat[i][j-1] == 0:
                    nocheck = 1
                    break

            else:
                if newmat[i][j + 1] == 0 and newmat[i + 1][j] == 0 and newmat[i][j - 1] == 0 and newmat[i-1][j]:
                    nocheck = 1

if(nocheck == 0 and count != 1):
    print("Yes")
else:
    print("No")
Problem p02971 (python)

Fixed submission:
import copy
N=int(input())
A=[]
for i in range(N):
  A.append(int(input()))

x=max(A)
count=(A.count(x))
index=[]
if count!=1:
    for i in range(N):
        print(x)
else:
    B=copy.copy(A)
    B.remove(x)
    y=max(B)
    for i in range(N):
        if A[i]==x:
            print(y)
        else:
            print(x)

Buggy submission (verdict: Runtime Error):
port copy
N=int(input())
A=[]
for i in range(N):
  A.append(int(input()))

x=max(A)
count=(A.count(x))
index=[]
if count!=1:
    for i in range(N):
        print(x)
else:
    B=copy.copy(A)
    B.remove(x)
    y=max(B)
    for i in range(N):
        if A[i]==x:
            print(y)
        else:
            print(x)
Problem p03611 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
m=max(a)
c=[0]*(m+3)

for i in a:
    c[i]=c[i]+1

if len(c)==1:
    T=1
else:
    T=c[0]+c[1]+c[2]
    for i in range(m):
        T=max(T,c[i-1]+c[i]+c[i+1])
print(T)

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

for i in a:
    c[i]=c[i]+1
T=c[0]+c[1]+c[2]
for i in range(m):
    T=max(T,c[i-1]+c[i]+c[i+1])
print(T)
Problem p02900 (python)

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

         
def nfac(n):
    if n % 2 == 0:
        while n % 2 == 0:
            n //= 2
        r = 2
    else:
        r = 1

    p = 3
    while p*p <= n:
        if n % p == 0:
            n //= p
            r += 1
            while n % p == 0:
                n //= p
        p += 2
    if n > 1:
        r += 1
    return r

         
a, b = map(int, input().split())
print(nfac(gcd(a,b)))

Buggy submission (verdict: Runtime Error):
    def gcd(a, b):
      while b > 0:
        a, b = b, a % b
      return a
     
    def nfac(n):
      if n % 2 == 0:
        while n % 2 == 0:
          n //= 2
        r = 2
      else:
        r = 1
      p = 3
      while p*p <= n:
        if n % p == 0:
          n //= p
          r += 1
          while n % p == 0:
            n //= p
        p += 2
      if n > 1:
        r += 1
      return r
     
    a, b = map(int, input().split())
    g = gcd(a, b)
    print(nfac(g))
Problem p03448 (python)

Fixed submission:
n_500 = int(input())
n_100 = int(input())
n_50 = int(input())
price = int(input())
count = 0

for i in range(n_500+1):
    for j in range(n_100+1):
        for k in range(n_50+1):
            if(price ==500*i+100*j+50*k):
                count+=1

print(count)

Buggy submission (verdict: Runtime Error):
n_500 = int(input())
n_100 = int(input())
n_50 = int(input())
price = int(input())
count = 0

for i in range(n_500+1):
    for j in range(n_100+1):
        for k in range(n_50+1):
            if(price ==500*i+100*j+50*k):
                count+=1S

print(count)
Problem p03493 (python)

Fixed submission:
count = input().count('1')
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().Split())
count = 0;
while true:
	for i in a :
  		if i%2!=0:
          break
        else :
          a[i] = a%i
    count++
    
print(str(count))
Problem p03494 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split(' ')))
count = 0;
flag =True
while True:
    for i in a :
        if i % 2 != 0 :
            flag=False
            break
    if flag :
        a = list(map(lambda x: x/2 , a))
        count=count+1
    else:
        break
    
print(str(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().Split(' '))
count = 0;
while true:
	for i in a :
  		if i%2!=0:
          break
        else :
          a[i] = a%i
    count++
    
print(str(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int,input())
count = 0;
while true:
	for i in a :
  		if i%2!=0:
          break
        else :
          a[i] = a%i
    count++
    
print(str(count))
Problem p02882 (python)

Fixed submission:
import sys
import math

a,b,x=(int(x) for x in input().split())

if a*a*b/2 <= x:
	T=a*(b-(x/(a*a)))
	c=2*T/a 
	d = math.atan2(c, a)
	d_deg=math.degrees(d)
else:
	e=2*x/(a*b)
	d = math.atan2(b, e)
	d_deg=math.degrees(d)
	
#print(d)
print(d_deg)

Buggy submission (verdict: Runtime Error):
import sys
import math

a,b,x=(int(x) for x in input().split())

if a*a*b/2 <= x:
	T=a*(b-(x/(a*a)))
	c=2*T/a 
	d = math.atan2(c, a)
	d_deg=math.degrees(d)
else:
	e=2*X/(a*b)
	d = math.atan2(e, b)
	d_deg=math.degrees(d)
	
#print(d)
print(d_deg)
Problem p02911 (python)

Fixed submission:
import sys

N,K,Q=(int(x) for x in input().split())
#Ai=[]
par=[]
for i in range(N):
	par.append(K)

par = [0] * N

for i in range(Q):
	a=int(input())
	par[a-1] += 1 	


#Ai.append(a)
#print(par)
for i in range(N):
	if par[i]+K > Q:
		print("Yes")
	else:
		print("No")
#print(par)

Buggy submission (verdict: Runtime Error):
10 13 15
3
1
4
1
5
9
2
6
5
3
5
8
9
7
9
Problem p03473 (python)

Fixed submission:
print(48-int(input()))

Buggy submission (verdict: Runtime Error):
 print(48-map(int, input()))

Buggy submission (verdict: Runtime Error):
M = map(int, input())
print 48-M
Problem p03485 (python)

Fixed submission:
import math
a, b = map(int, input().split())
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s1="".join(sorted(s));
t1="".join(sorted(t, reverse=true))
if s1<t1:
	print("Yes\n")
else:
	print("No\n")
Problem p03486 (python)

Fixed submission:
s=input()
t=input()
s1="".join(sorted(s));
t1="".join(sorted(t, reverse=True))
if s1<t1:
	print("Yes\n")
else:
	print("No\n")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s1="".join(sorted(s));
t1="".join(sorted(t, reverse=true))
if s1<t1:
	print("Yes\n")
else:
	print("No\n")
Problem p03796 (python)

Fixed submission:
x = int(raw_input())
y = 1

for i in range(1, x + 1):
    y *= i
    if y > (10**9 + 7):
        y %= 10 ** 9 + 7

print y

Buggy submission (verdict: Runtime Error):
#include <iostream>

using namespace std;
int N;

int main()
{
    scanf("%d", &N);
    int q = N/15;
    printf("%d\n", 800*N - 200*q);
    return 0;
}
Problem p02910 (python)

Fixed submission:
s = input()
count = 0

for i in range(len(s)):
    if (i%2==0 and s[i]== 'L') or (i%2==1 and s[i] == 'R'):
        count = 1
        
if count ==1:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
s = input()
count = 0

for i in range(len(s)):
    if (i%2==0 and s[i]== 'R') or (i%2==0 and s[i] = 'L'):
        count = 1
        
if count ==1:
    print('No')
else:
    print('Yes')
Problem p03005 (python)

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

if k!=1:
    print(n-k)
else:
    print('0')

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
if k!=1:
    print(n-k)
else:
    pritn('0')

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
if k!=1:
    print(n-k)
else:
    pritn(0)