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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())

bckt = [0]*(int(1e5)+1)
for i in a:
    bckt[i] += 1
    
s = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    q = bckt[b]
    bckt[c] += q
    bckt[b] -= q
    s += (c*q - b*q)
    print(s)

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

bckt = [0]*(n+1)
for i in a:
    bckt[i] += 1
    
s = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    q = bckt[b]
    bckt[c] += q
    bckt[b] -= q
    s += (c*q - b*q)
    print(s)
Problem p02718 (python)

Fixed submission:
n, m = list(map(int, input().split()))
v = list(map(int, input().split()))
t = sum(v)/(4*m)

ct = 0
for i in v:
    if i>=t:
        ct += 1
        
if ct >= m:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
v = list(map(int, input().split()))
t = sum(v)/(4*m)

ct = 0
for i in v:
    if v>t:
        ct += 1
        
if ct >= m:
    print("Yes")
else:
    print("No")
Problem p03165 (python)

Fixed submission:
s = input()
t = input()

dp = [[0]*(1+len(s)) for i in range(1+len(t))]

for i in range(1, 1+len(t)):
    for j in range(1, 1+len(s)):
        if s[j-1] == t[i-1]:
            dp[i][j] = 1+dp[i-1][j-1]
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

i = len(t)
j = len(s)
st = ""

while dp[i][j] != 0:
    if s[j-1] == t[i-1]:
        st += s[j-1]
        i -= 1
        j -= 1
    else:
        if dp[i][j-1] > dp[i-1][j]:
            j -= 1
        else:
            i -= 1
            
print(st[::-1])

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

dp = [[0]*(1+len(s)) for i in range(1+len(t))]

for i in range(1, 1+len(t)):
    for j in range(1, 1+len(s)):
        if s[j-1] == t[i-1]:
            dp[i][j] = 1+dp[i-1][j-1]
            st += s[j-1]
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

i = len(t)
j = len(s)
st = ""

while dp[i][j] != 0:
    if s[j-1] == t[i-1]:
        st += s[j-1]
        i -= 1
        j -= 1
    else:
        if dp[i][j-1] > dp[i-1][j]:
            j -= 1
        else:
            i -= 1
            
print(st[::-1])
Problem p03166 (python)

Fixed submission:
import sys
from collections import defaultdict
    
sys.setrecursionlimit(10**9)
    
n, m = map(int, input().split())
adj = defaultdict(list)
radj = defaultdict(list)

for i in range(m):
    s, e = map(int, input().split())
    adj[s].append(e)
    
dp = [-1]*(n+1)

def dfs(e):
    if dp[e] != -1:
        return dp[e]
    
    temp = 0
    for i in adj[e]:
        temp = max(temp, 1+dfs(i))
        
    dp[e] = temp
    return temp
    
    
for i in range(1, n+1):
    dfs(i)
    
print(max(dp))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
    
n, m = map(int, input().split())
adj = defaultdict(list)
radj = defaultdict(list)

for i in range(m):
    s, e = map(int, input().split())
    adj[s].append(e)
    
dp = [-1]*(n+1)

def dfs(e):
    if dp[e] != -1:
        return dp[e]
    
    temp = 0
    for i in adj[e]:
        temp = max(temp, 1+dfs(i))
        
    dp[e] = temp
    return temp
    
    
for i in range(1, n+1):
    dfs(i)
    
print(max(dp))
Problem p02999 (python)

Fixed submission:
x,a = map(int, input().split())
if x < a :
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
x = int(input())
a = int(input())
if x < a:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
x = int(input())
a = int(input())
if x < a :
    print(0)
else :
    print(10)

Buggy submission (verdict: Runtime Error):
x = int(input())
a = int(input())
if x < a :
    print(0)
else :
    print(10)
Problem p02687 (python)

Fixed submission:
S = input()
if (S == 'ABC'):
  print('ARC')
elif (S == 'ARC'):
  print('ABC')

Buggy submission (verdict: Runtime Error):
S = input()
if (S = 'ABC'):
  print('ARC')
elif (S = 'ARC'):
  print('ABC')

Buggy submission (verdict: Runtime Error):
S = input()
if S = 'ABC':
  print('ARC')
elif S = 'ARC':
  print('ABC')
Problem p02705 (python)

Fixed submission:
import math
print(int(input())*math.pi*2)

Buggy submission (verdict: Runtime Error):
import math
print(int(input())*2*math.py)
Problem p02706 (python)

Fixed submission:
N,M = map(int,input().split())
a = list(map(int, input().split()))
for i in range(M):
  N -= a[i]
print(N if N>=0 else '-1')

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = list(map(int, input().split()))
for i in range(M+1):
  N -= a[i]
print(N if N>0 else '-1')

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
for i in range(M):
  N = N - a[i]
print(N if N>0 else -1)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
for i in range(M):
  N -= a[i]
print(N if N>0 else -1)
Problem p02675 (python)

Fixed submission:
n = input()
if n[-1] == "3":
  print("bon")
elif n[-1] in ["0","1","6","8"]:
  print("pon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[-1] == "3":
  print("bon")
elif n[-1] == ["0","1","6","8"]:
  print("pon")
else:
  print("hon")
Problem p03455 (python)

Fixed submission:
a,b = map(int,input().split())

ans = a*b % 2
if ans == 0:
  print("Even")
else:
  print("Odd")

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

ans = a*b % 2
if ans == 0:
  print(Even)
else:
  print(Odd)
Problem p02613 (python)

Fixed submission:
N = int(input())
hist = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0 }
for i in range(N):
  tc = input()
  hist[tc] += 1

for k in ['AC', 'WA', 'TLE', 'RE']:
  print(f'{k} x {hist[k]}', flush=True)

Buggy submission (verdict: Runtime Error):
N = int(input())
hist = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0 }
for i in range(N):
  tc = input()
    hist[tc] += 1

for k in ['AC', 'WA', 'TLE', 'RE']:
  print(f'{k} x {hist[k]}', flush=True)
Problem p02628 (python)

Fixed submission:
N, K = (int(i) for i in input().split())
p = [int(i) for i in input().split()]

sp = sorted(p)
print(sum(sp[:K]))

Buggy submission (verdict: Runtime Error):
N, K = (int(i) for i in input().split())
p = [input().split()]

sp = sorted(p)
print(sum(sp[:K]))
Problem p02640 (python)

Fixed submission:
def main():
    na, nl = (int(i) for i in input().split())
    nc = (4*na - nl) / 2

    pos = (nc == int(nc) and nc >= 0 and nc <= na)

    if pos:
        print('Yes')
    else:
        print('No')
      
main()

Buggy submission (verdict: Runtime Error):
def main():
    na, nl = (int(i) for i in input().split())
    nc = (4*na - nl) / 2

    pos = nc == int(nc) and nc >= 0 and nc <= x

    if pos:
        print('Yes')
    else:
        print('No')
      
main()

Buggy submission (verdict: Runtime Error):
x, y = (int(i) for in in input().split())

pos = (4*x - y) // 2 >= 0

if pos:
  print('Yes')
else:
  print('No')
Problem p02641 (python)

Fixed submission:
def main():
    # x in [1, 100]
    # n in [0, 100]
    # p_i in [1, 100] 
    x, n = (int(i) for i in input().split())
    if n > 0:
        p = set(int(i) for i in input().split())
    else:
        p = set() 

    b, e = x, x
    while b in p and e in p:
        b -= 1
        e += 1

    if b not in p:
        print(b)
    else:
        print(e)


main()

Buggy submission (verdict: Runtime Error):
def main():
    x, n = (int(i) for i in input().split())
    if n > 0:
        p = [int(i) for i in input().split()]
    else:
        p = []

    mask = [0] * 101 
    for pe in p:
        mask[pe] = 1

    b, e = x, x
    while True:
        if mask[b] == 0 or mask[e] == 0:
            break
        b -= 1
        e += 1

    if mask[b] == 0:
        print(b)
    else:
        print(e)



main()
Problem p02694 (python)

Fixed submission:
from decimal import Decimal
import math

def main():
    x = Decimal(input())
    y = 0
    p = Decimal(100)
    gr = Decimal('1.01')
    while p < x:
        p *= gr 
        p = math.floor(p) 
        y += 1

    print(y)

main()

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

def main():
    x = int(input())
    y = 0
    p = Decimal(100)
    while p < x:
        p *= Decimal(1.01)
        p = math.floor(p) 
        y += 1

    print(y)

main()
Problem p02713 (python)

Fixed submission:
k = int(input())

from math import gcd

s = 0
for a in range(1, k+1):
  for b in range(1, k+1):
    g = gcd(a, b)
    for c in range(1, k+1):
      s += gcd(g, c)

print(s)

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

gcache = { }
s = 0

for a in range(1, k+1):
  for b in range(1, k+1):
    tup = (min(a, b), max(a, b))
    if tup not in gcache:
      gc = math.gcd(tup[0], tup[1])
      gcache[tup] = gc
    gc = gcache[tup]
    for c in range(1, k+1):
      tup = (min(c, gc), max(c, gc))
      if tup not in gcache:
        gc = math.gcd(tup[0], tup[1])
        gcache[tup] = gc
      gc = gcache[tup]
      s += gc

print(s)
Problem p02720 (python)

Fixed submission:
def incr_lunlun(num):
    num[0] += 1
    if len(num) == 1:
        if num[0] == 10:
            num.append(1)
            num[0] = 0
    
    elif num[0] > num[1] + 1 or num[0] == 10:
        suffix = incr_lunlun(num[1:])
        digit = max(0, suffix[0] - 1)
        num = [digit] + list(suffix)

    return num


def main():
    k = int(input())
    num = [1]
    for i in range(k-1): 
        num = incr_lunlun(num)

    print(int(''.join(str(i) for i in reversed(num))))



main()

Buggy submission (verdict: Runtime Error):
def incr_lunlun(num):
    num[0] += 1
    if len(num) == 1:
        if num[0] == 10:
            num.append(1)
            num[0] = 0

    elif num[0] > num[1] + 1 or num[0] == 10:
        suffix = incr_lunlun(num[1:])
        num = [suffix[0] - 1] + list(suffix)

    return num


def main():
    k = int(input())
    num = [1]
    for i in range(k-1): 
        num = incr_lunlun(num)

    print(int(''.join(str(i) for i in reversed(num))))



main()
Problem p02730 (python)

Fixed submission:
s = input()
n = len(s)

t = s[:(n-1)//2]
u = s[(n+3)//2-1:]

if (s == s[::-1]
    and t == t[::-1]
    and u == u[::-1]):
  print('Yes')
else:
  print('No')

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

t = s[:(n-1)//2]
u = s[(n+3)//2:]

if (s == s[::-1]
    and len(t) > 0 and len(u) > 0 and
    and t == t[::-1]
    and u == u[::-1]):
  print('Yes')
else:
  print('No')
Problem p02761 (python)

Fixed submission:
def main():
    n, m = list(map(int, input().split()))
    dcon = [set() for _ in range(n)]
    for _ in range(m):
        s, c = tuple(map(int, input().split()))
        dcon[s-1].add(c)

    if any(len(d) > 1 for d in dcon):
        print(-1)
        return
    
    digits = [0] if n == 1 else [1] + [0] * (n-1)
    for i in range(n):
        if dcon[i]:
            digits[i] = dcon[i].pop()

    if digits[0] == 0 and n != 1:
        print(-1)

    else:
        print(''.join(map(str, digits)))

main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m = list(map(int, input().split()))
    dcon = [set() for _ in range(n)]
    for _ in range(m):
        s, c = tuple(map(int, input().split()))
        dcon[s-1].add(c)

    if any(len(d) > 1 for d in dcon):
        print(-1)
        return
    
    digits = [0] if n == 1 else [1] + [0] * (n-1)
    for i in range(n):
        if d:
            digits[i] = d.pop()

    print(''.join(map(str, digits)))

main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m = list(map(int, input().split()))
    dcon = [set() for _ in range(n)]
    for _ in range(m):
        s, c = tuple(map(int, input().split()))
        dcon[s-1].add(c)

    if any(len(d) > 1 for d in dcon):
        print(-1)
        return
    
    # populate the digits with the constrained digit, if it exists,
    # or the minimum possible digit.  the min possible digit is
    # 1 if it's the leading digit, or zero otherwise
    digits = [d.pop() if d else 0 + int(i == 0) for i, d in enumerate(dcon)]

    if digit[0] == 0:
        print(-1)
    else:
        print(''.join(map(str, digits)))

main()
Problem p03047 (python)

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

print(N - K + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [str(input()) for i in range(N)]

ans = 0
firstB = 0
lastA = 0
cnt = 0
for s in S:
    if s[0] == 'B':
        firstB += 1
    if s[-1:] == 'A':
        lastA += 1

    if s[0] == 'B' and s[-1:] == 'A':
        cnt += 1

    ans += s.count('AB')
    
if cnt == max([firstB,lastA]):
    print(ans + cnt -1)
else:
    print(ans+ min([firstB,lastA]))
Problem p03074 (python)

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

a = [0]

ls = s.replace('10', '1,0')
ls = ls.replace('01', '0,1')
ls = ls.split(',')
for i in ls:
    a.append(a[-1] + len(i))

ans = 0
res = 0
if s[0] == '1':
    for i in range(len(a)):
        if i % 2 == 0:
            ans = a[min(i + 2 * k + 1, len(a) - 1)] - a[i]
        else:
            ans = a[min(i + 2 * k, len(a) - 1)] - a[i]

        res = max(res, ans)

else:
    for i in range(len(a)):
        if i % 2 == 0:
            ans = a[min(i + 2 * k, len(a) - 1)] - a[i]
        else:
            ans = a[min(i + 2 * k + 1, len(a) - 1)] - a[i]

        res = max(res, ans)

print(res)

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

s0 = s[0]
a = [0]

s = s.replace('10', '1,0')
s = s.replace('01', '0,1')
s = s.split(',')
for i in s:
    a.append(a[-1] + len(i))

if len(a) == 2:
    print(a[1])
    exit()
ans = []
if s0 == '0':
    for i in range(2 * k,len(a)):
        ans.append(a[i] - a[i - (2 * k)])
else:
    for i in range(2 * k + 1,len(a)):
        ans.append(a[i] - a[i - (2 * k + 1)])

print(max(ans))
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s = str(input())
d = [list(map(int, input().split())) for i in range(q)]
a = [0,0]
cnt = 0
for i in range(1, n):
    if s[i-1]+s[i] == 'AC':
        cnt += 1
    a.append(cnt)

for i in range(q):
    print(a[d[i][1]]-a[d[i][0]])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = str(input())
a = []
b = []
for i in range(q):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

ss = []
ll = []
for i in range(n):
    c = s[a[i]:b[i]]
    d = c.count('AC')
    print(d)

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = str(input())
a = []
b = []
for i in range(q):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

ss = []
ll = []
for i in range(n):
    c = s[a[i]:b[i]]
    d = c.count('AC')
    print(len(c)-len(d))
Problem p03240 (python)

Fixed submission:
N = int(input())
d = []
for j in range(N):
    X, Y, H = map(int,input().split())
    d.append([X, Y, H])
    if H != 0:
        a = [X, Y, H]
for x in range(101):
    for y in range(101):
        flag = True
        h = a[2] + abs(a[0] - x) + abs(a[1] - y)
        for i in d:
            if i[2] != max(h - abs(i[0] - x) - abs(i[1] - y), 0):
                flag = False
                break

        if flag:
            print(x, y, h)
            exit()

Buggy submission (verdict: Runtime Error):
N = int(input())
d = []
for _ in range(N):
    d.append(list(map(int,input().split())))

for x in range(101):
    for y in range(101):
        flag = True
        h = d[0][2] + abs(d[0][0] - x) + abs(d[0][1] - y)
        for i in d:
            if i[2] != max(h - abs(i[0] - x) - abs(i[1] - y),0):
                flag = False
                break

        if flag:
            ansx = x
            ansy = y
            ansh = h

print(ansx,ansy,ansh)
Problem p03241 (python)

Fixed submission:
N, M = map(int, input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

for i in make_divisors(M):
    if i <= M // N:
        ans = i 

print(ans)

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

for i in make_divisors(M):
    if i < M // N:
        ans = i 
print(ans)
Problem p02630 (python)

Fixed submission:
import numpy as np

n = int(input())
list_a = list(map(int, input().split()))

counts = np.zeros(100000, dtype=int)

ans = 0

for i in range(len(list_a)):
    counts[list_a[i]-1] += 1
    ans += list_a[i]

q = int(input())

for i in range(q):
    b, c = map(int, input().split())

    ans += counts[b-1] * (c - b)

    counts[c-1] += counts[b-1]
    counts[b-1] = 0

    print(ans)

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

list_a.sort()

counts = []

for i in range(1, 100000):
    if i in list_a:
        counts.append(list_a.count(i))
    else:
        counts.append(0)

q = int(input())
ans = sum(list_a)

for i in range(q):
    b, c = map(int, input().split())

    ans += counts[b-1] * (c - b)

    counts[c-1] += counts[b-1]
    counts[b-1] = 0

    print(ans)

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

list_a.sort()

counts = []

for i in range(100000):
    if i in list_a:
        counts.append(list_a.count(i))
    else:
        counts.append(0)

q = int(input())
ans = sum(list_a)

for i in range(q):
    b, c = map(int, input().split())

    ans += counts[b] * (c - b)

    counts[c] += counts[b]
    counts[b] = 0

    print(ans)

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

list_a.sort()

counts = []

for i in range(100000):
    counts.append(list_a.count(i))

q = int(input())
ans = sum(list_a)

for i in range(q):
    b, c = map(int, input().split())

    ans += counts[b] * (c - b)

    counts[c] += counts[b]
    counts[b] = 0

    print(ans)
Problem p02898 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h_s = sorted(h, reverse = True)
ans = n
for i in range(n):
    if h_s[i] < k:
        ans = i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h_s = sort(h, reverse = True)
ans = n
for i in range(n):
    if h_s[i] > k:
        ans = i + 1
        break
print(ans)
Problem p02899 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
    ans[(a[i] - 1)] = i +1
print(' '.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
    ans[a[i]] = i
print(ans)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int, input.split())
if (a*b) % 2 == 1:
	print("Odd")
else:
	print("Even")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input.split())
if a*b % 2 == 1:
	print("Odd")
else:
	print("Even")
Problem p03457 (python)

Fixed submission:
n = int(input())
t_state, x_state, y_state = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    td = t - t_state
    if  td < d or td%2 != d%2:
        print("No")
        exit()
    t_state, x_state, y_state = t, x, y
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
t_state, x_state, y_state = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    td = t - t_state
    if  td < d or td%2 != d%2
        print("No")
        exit()
    t_state, x_state, y_state = t, x, y
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
t_state, x_state, y_state = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    td = t - t_state
    if  td < d or td%2 != d%2
        print("No")
        exit()
    t_state, x_state, y_state = t, x, y
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
t_state = 0
x_state = 0
y_state = 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    if  t - t_state < d or (t-t_state)%2 != d%2
        print("No")
        exit()
    t_state = t
    x_state = x
    y_state = y
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [[0,0,0]]
l.append([[list(map(int, input().split())) for i in range(n)]])
for i in range(n):
    if abs(l[i+1][1] + l[i+1][2] - l[i][1] - l[i][2]) != 1:
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [[0,0,0]]
l.append([[list(map(int, input().split())) for i in range(n)]])
for i in range(n):
    if abs(l[i+1][1] + l[i+1][2] - l[i][1] - l[i][2]) != 1:
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
x_state = 0
y_state = 0
for i in range(n):
    t, x, y = map(int, input().split())
    if abs(x + y - x_state - y_state) != 1:
        print("No")
        exit()
    x_state = x.copy()
    y_state = y.copy()
print("Yes")
Problem p03470 (python)

Fixed submission:
n = int(input())
d = []
for i in range(n):
    d.append(int(input()))
ans = len(set(d))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = []
for i in range(n+1):
    d.append(int(input()))
ans = len(set(d))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = []
for i in range(n+1):
    d.append(int(input()))
ans = len(set(d))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    d[i] = int(input())
ans = len(set(d))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n+1):
    d[i] = int(input())
ans = len(set(d))
print(ans)
Problem p03478 (python)

Fixed submission:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
count = 0
for i in range(n+1):
	ans = i % 10
	while (i // 10) != 0:
        ans += (i // 10)
		i = (i // 10)
	if ans >= a and ans <= b:
		count += 1
print(count)
Problem p03597 (python)

Fixed submission:
a=int(input())
b=int(input())
print(a**2-b)

Buggy submission (verdict: Runtime Error):
int a,b
a=input()
b=input()
print(a**2-b)
Problem p03501 (python)

Fixed submission:
N, A, B = map(int, input().split())
S = N*A
if B < S or B == S:
  print(B)
else:
  print(S)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
if B > N*A
	or B == N*A:
  print(N*A)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
N, A, B = int(input().split)
if B < N*A:
  print(B)
  else:
    (N*A)
Problem p03085 (python)

Fixed submission:
a = str(input())

if (a == 'A'): 
    print('T')
elif (a == 'T'):
    print('A')
elif (a == 'G'):
    print('C')
elif(a =='C'):
    print('G')
else: print("none")

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

if (a == 'A'): 
    print('T')
elif (a == 'T):
    print('A')
elif (a == 'G'):
    print('C')
elif(a =='C'):
    print('G')
else: print("none")
Problem p03193 (python)

Fixed submission:
N, H, W = list(map(int, input().strip().split(' ')))

AB = []

cnt = 0

for i in range(N):
	AB.append(list(map(int, input().strip().split(' '))))	#[A][B]
	
	
for i in range(N):
	if int(AB[i][0]) >= H:
			if int(AB[i][1]) >= W:
				cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
N, H, W = list(map(int, input().strip().split(' ')))

AB = []

cnt = 0

for i in range(N):
	AB.append(input().strip().split(' '))	#[A][B]
	

for i in range(N):
	if int(AB[i][0]) >= H:
		if int(AB[0][i]) >= W:
			cnt += 1

		
		


	
print(cnt)