Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#ABC171B
n,k = map(int,input().split())
p = sorted(list(map(int,inout().split())))
print(sum(p[:k]))

Fixed submission:
#ABC171B
n,k = map(int,input().split())
p = sorted(list(map(int,input().split())))
print(sum(p[:k]))
Buggy python submission (verdict: Runtime Error):
#ABC167B
a,b,c,d,k = map(int,input().split())
print(min(a,k)-max(k-a-b,0))

Fixed submission:
#ABC167B
a,b,c,k = map(int,input().split())
print(min(a,k)-max(k-a-b,0))
Buggy python submission (verdict: Runtime Error):
#ABC163B
n,m = map(int,input().split())
a = list(map(int,inout().split()))
print(-1 if sum(a) >= n else n-sum(a))

Fixed submission:
#ABC163B
n,m = map(int,input().split())
a = list(map(int,input().split()))
print(-1 if sum(a) > n else n-sum(a))
Buggy python submission (verdict: Runtime Error):
#ABC160A
s = input()
print("Yes" if s[3]==s[4] and s[5]==s[6] else "No")


Fixed submission:
#ABC160A
s = input()
print("Yes" if s[2]==s[3] and s[4]==s[5] else "No")

Buggy python submission (verdict: Runtime Error):
#ABC160A
s = input()
print("Yes" if s[3]==s[4] ans s[5]==s[6] else "No")

Fixed submission:
#ABC160A
s = input()
print("Yes" if s[2]==s[3] and s[4]==s[5] else "No")
Buggy python submission (verdict: Runtime Error):
#ABC158
s = input()
print("Yes" if len(set(s))== else "No")

Fixed submission:
#ABC158
s = input()
print("Yes" if len(set(s))==2 else "No")
Buggy python submission (verdict: Runtime Error):
s = input()
print("x"**len(s))

Fixed submission:
s = input()
print("x"*len(s))
Buggy python submission (verdict: Runtime Error):
#ABC153B
h,n = map(int,input().split())
a = list(map(int,inout().split()))
print("Yes" if sum(a) >= h else "No")

Fixed submission:
#ABC153B
h,n = map(int,input().split())
a = list(map(int,input().split()))
print("Yes" if sum(a) >= h else "No")
Buggy python submission (verdict: Runtime Error):
#ABC147
a = [map(int,input().split())]
print("bust" if sum(a)>=22 else "win")

Fixed submission:
#ABC147
a = list(map(int,input().split()))
print("bust" if sum(a)>=22 else "win")
Buggy python submission (verdict: Runtime Error):
#ABC144A
a,b = map(int,input().split())
print(a*b if 1<=a<=9 ans 1<=b<=9 else -1)

Fixed submission:
#ABC144A
a,b = map(int,input().split())
print(a*b if 1<=a<=9 and 1<=b<=9 else -1)
Buggy python submission (verdict: Runtime Error):
#ABC090
s = input()
t = input()
ans = 0
if s[0]=t[0]:
    ans+=1
if s[1]=t[1]:
    ans+=1
if s[2]=t[2]:
    ans+=1
print(ans)    

Fixed submission:
#ABC090
s = input()
t = input()
ans = 0
if s[0]==t[0]:
    ans+=1
if s[1]==t[1]:
    ans+=1
if s[2]==t[2]:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
#ABC117B
n = int(input())
l = [int(input()) for i in range(n)]
print("Yes" if max(l) >= (sum(l)-max(l)) else "No")

Fixed submission:
#ABC117B
n = int(input())
l = list(map(int,input().split()))
print("Yes" if max(l) < (sum(l)-max(l)) else "No")

Buggy python submission (verdict: Runtime Error):
#ABC117B
n = int(input())
l = [int(input()) for i in range(n)]
print("Yes" if max(l) >= sum(l)-max(l) else "No")

Fixed submission:
#ABC117B
n = int(input())
l = list(map(int,input().split()))
print("Yes" if max(l) < (sum(l)-max(l)) else "No")
Buggy python submission (verdict: Runtime Error):
*a = map(int,input().split())
print(max(a)-min(a))


Fixed submission:
*a, = map(int,input().split())
print(max(a)-min(a))

Buggy python submission (verdict: Runtime Error):
*a = map(input().split())
print(max(a)-min(a))

Fixed submission:
*a, = map(int,input().split())
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
#ABC093
s = [input().split()]
print("Yes" if len(set(s))==3 else "No")

Fixed submission:
#ABC093
s = input()
print("Yes" if len(set(s))==3 else "No")
Buggy python submission (verdict: Runtime Error):
#ABC080B
n = input()
print("Yes" if sum(map(int,n))%n == 0 else "No")

Fixed submission:
#ABC080B
n = input()
print("Yes" if int(n) %sum(map(int,n)) == 0 else "No")
Buggy python submission (verdict: Runtime Error):
a =  input()
print("Yes" if a[0]==a[1]==a[2] or a[3]==a[1]==a[2] "No")

Fixed submission:
a =  input()
print("Yes" if a[0]==a[1]==a[2] or a[3]==a[1]==a[2] else "No")
Buggy python submission (verdict: Runtime Error):
#ABC070A
n = input().split()
print("Yes" if (a[-1] == a[0]) else "No")

Fixed submission:
a = input()
print("Yes" if a[0]==a[2] else "No")
Buggy python submission (verdict: Runtime Error):
a,*b,c = input()
print(a+string(len(b))+c)


Fixed submission:
a,*b,c = input()
print(a+str(len(b))+c)

Buggy python submission (verdict: Runtime Error):
a,*b,c = input()
print(a+string(b)+c)

Fixed submission:
a,*b,c = input()
print(a+str(len(b))+c)

Buggy python submission (verdict: Runtime Error):
a,*b,c = input()
print(a+len(b)+c)

Fixed submission:
a,*b,c = input()
print(a+str(len(b))+c)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print("Yes",if a<=c<=b else "No")

Fixed submission:
a,b,c = map(int,input().split())
print("Yes" if a<=c<=b else "No")
Buggy python submission (verdict: Runtime Error):

#ABC058B
o = input()
e = input()

for i in range(len(o)):
    print(o[i]+e[i],end="")

Fixed submission:
o = list(input())
e = list(input())+[""]

for i,j in zip(o,e): print(i+j,end="")

Buggy python submission (verdict: Runtime Error):
o = list(input())
e = list(input())+[""]

for i,j zip(o,e): print(i+j,end="")

Fixed submission:
o = list(input())
e = list(input())+[""]

for i,j in zip(o,e): print(i+j,end="")
Buggy python submission (verdict: Runtime Error):
c  = input()
if c in "aeiou":
  print("vowel")
 else:
  print("consonant")

Fixed submission:
c = input()
if c in "aeiou":
  print("vowel")
else:
  print("consonant")
Buggy python submission (verdict: Runtime Error):

print("A%sC"%inut()[8])

Fixed submission:
print("A%sC"%input()[8])
Buggy python submission (verdict: Runtime Error):
a,b,c,d=[int(input()) for i in [0]*4]
print(n,k,x,y=(int(input()) for i in [0]*4))

Fixed submission:
n,k,x,y=[int(input()) for i in [0]*4]
print(n*x-(x-y)*max(n-k,0))
Buggy python submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = [input() for i in range(n)]
print(*stored(s),sep="")


Fixed submission:
n,l = map(int,input().split())
s = [input() for i in range(n)]
print(*sorted(s),sep="")

Buggy python submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = input() for i in range(n)
print(*stored(s),sep="")


Fixed submission:
n,l = map(int,input().split())
s = [input() for i in range(n)]
print(*sorted(s),sep="")

Buggy python submission (verdict: Runtime Error):
n = input()
l = input()
s = input() for i in range(n)
print(*stored(s),sep="")


Fixed submission:
n,l = map(int,input().split())
s = [input() for i in range(n)]
print(*sorted(s),sep="")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
a = [int(each) for each in input().split()]

result = 0

for a, b in itertools.combinations(a, 2):
    result += a*b % 1000000007
print(result % 1000000007)

Fixed submission:
n = int(input())
a = [int(each) for each in input().split()]

result = 0
s = sum(a)
for i in range(len(a)):
    s = (s-a[i])
    result += s % 1000000007 * a[i]
print(result % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(each) for each in input().split()]

result = 0
for i in range(len(a)):
    result += a[i] * sum(a[i+1:]) % 1000000007

print(result % 1000000007)

Fixed submission:
n = int(input())
a = [int(each) for each in input().split()]

result = 0
s = sum(a)
for i in range(len(a)):
    s = (s-a[i])
    result += s % 1000000007 * a[i]
print(result % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(each) for each in input().split()]

result = 0
for i in range(len(a)):
    for j in range(i):
        result += a[i] * a[j] % 1000000007

print(result % 1000000007)

Fixed submission:
n = int(input())
a = [int(each) for each in input().split()]

result = 0
s = sum(a)
for i in range(len(a)):
    s = (s-a[i])
    result += s % 1000000007 * a[i]
print(result % 1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

def add(c):
    return sum([int(k)*int(v) for k, v in c.items()])

n = int(input())
a = [int(each) for each in input().split()]
q = int(input())
rep = [tuple(int(each) for each in input().split()) for i in range(q)]

s = [str(sum(a))]

c = collections.Counter(a)
for i in range(q):
    # 存在しないときにエラーになる
    if c.get(rep[i][0]):
        c[rep[i][1]] += c.pop(rep[i][0])
    s.append(add(c))
print('\n'.join([str(each) for each in s[1:]]))

Fixed submission:
import collections

n = int(input())
a = [int(each) for each in input().split()]
q = int(input())
rep = [tuple(int(each) for each in input().split()) for i in range(q)]

s = [sum(a)]

c = collections.Counter(a)
for i in range(q):
    diff = (rep[i][1]-rep[i][0])
    num = c.get(rep[i][0])
    if not num:
        num = 0
    # print('i:', i)
    # print(c)
    # print('差分:', diff, '個数:', num)
    s.append(s[-1]+num*diff)

    # 存在しないときにエラーになる
    if c.get(rep[i][0]):
        c[rep[i][1]] += c.pop(rep[i][0])

print('\n'.join([str(each) for each in s[1:]]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(each) for each in input().split()]
q = int(input())
rep = [tuple(int(each) for each in input().split()) for i in range(q)]

s = [str(sum(a))]

for i in range(q):
    a = [rep[i][1] if x==rep[i][0] else x for x in a]
    s.append(str(sum(a)))
print('\n'.join(s[1:]))

Fixed submission:
import collections

n = int(input())
a = [int(each) for each in input().split()]
q = int(input())
rep = [tuple(int(each) for each in input().split()) for i in range(q)]

s = [sum(a)]

c = collections.Counter(a)
for i in range(q):
    diff = (rep[i][1]-rep[i][0])
    num = c.get(rep[i][0])
    if not num:
        num = 0
    # print('i:', i)
    # print(c)
    # print('差分:', diff, '個数:', num)
    s.append(s[-1]+num*diff)

    # 存在しないときにエラーになる
    if c.get(rep[i][0]):
        c[rep[i][1]] += c.pop(rep[i][0])

print('\n'.join([str(each) for each in s[1:]]))
Buggy python submission (verdict: Time Limit Exceeded):
import operator
from functools import reduce
n = input()
l = [int(each) for each in input().split()]
result = reduce(operator.mul,l)
if result > 10**18:
    result = -1
print(result)

Fixed submission:
n = input()
l = [int(each) for each in input().split()]
if 0 in l:
    print(0)
else:
    result = 1
    for each in l:
        result *= each
        if result > 1000000000000000000:
            result = -1
            break
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
l = [int(each) for each in input().split()]
result = 1
for each in l:
    result *= each
if result > 10**18:
    result = -1
print(result)

Fixed submission:
n = input()
l = [int(each) for each in input().split()]
if 0 in l:
    print(0)
else:
    result = 1
    for each in l:
        result *= each
        if result > 1000000000000000000:
            result = -1
            break
    print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = (int(each) for each in input().split())
h = [int(each) for each in input().split()]
pathlist = list()
for i in range(m):
    pathlist.append(set([int(each) for each in input().split()]))

score = 0
for deck in range(1, n+1):
    # それぞれの展望台につながっている展望台の高さのリストを出力
    listhofheights = [h[(path - set([deck])).pop()-1] for path in pathlist if deck in path]
    if len(listhofheights) == 0:
        score += 1
    elif max(listhofheights) < h[deck-1]:
        score += 1
    # print('deck', deck,':' , [h[(path - set([deck])).pop()-1] for path in pathlist if deck in path])
print(score)

Fixed submission:
n, m = (int(each) for each in input().split())
h = [int(each) for each in input().split()]
pathlist = list()
for i in range(m):
    pathlist.append([int(each) for each in input().split()])
score = 0

decklist = set(range(1, n+1))
for path in pathlist:
    # もし道のうち前者が高ければ
    if h[path[0]-1] >= h[path[1]-1]:
        # print('remove:', path[1])
        decklist.discard(path[1])
    # 後者が高ければ
    if h[path[0]-1] <= h[path[1]-1]:
        # print('remove:', path[0])
        decklist.discard(path[0])
print(len(decklist))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

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

k = int(input())
sum = 0

for a in range(k):
    for b in range(k):
        for c in range(k):
            # print(a+1, b+1, c+1)
            sum += gcd(a+1, b+1, c+1)

print(sum)

Fixed submission:
import math

k = int(input())
sum = 0

for a in range(k):
    for b in range(k):
        aandb = math.gcd(a+1, b+1)
        for c in range(k):
            sum += math.gcd(aandb, c+1)

print(sum)
Buggy python submission (verdict: Runtime Error):
n, k = (int(each) for each in input().split())
if n > k:
    a = n%k
    print(min(abs(a-k), a))
else:
    k = k%n+n+n
    b = min(abs(n-k), k-abs(n-k))
    if b == 0:
        print(n)
    else:
        print(b)

Fixed submission:
def calc(n, k):
    if n == 0:
        return 0
    if n > k:
        a = n%k
        return min(abs(a-k), a)
    # kのほうがnより大きいとき
    if n*2 < k:
        return n
    else:
        # k = k%n+n+n
        return min(abs(n-k), k-abs(n-k))

n, k = (int(each) for each in input().split())
print(calc(n, k))
Buggy python submission (verdict: Runtime Error):
def calculate(n, m, condition_list):
    if [1, 0] in condition_list:
        return '-1'
    # こたえは1桁ごとに区切ったリストにする
    # 最後にjoinして回答する
    result = ['null']*n
    for condition in condition_list:
        if result[condition[0]-1] != 'null':
            if not result[condition[0]-1] == condition[1]:
                return '-1'
        result[condition[0]-1] = condition[1]
    # 指定がない桁はまだnullのままなのでそれを埋める
    for i in range(result):
        if result[i] == 'null':
            # 一番左の桁が空いていたら1にする
            if i == 0 and n != 1:
                result[i] = 1
            # それ以外の桁が空いていたら0にする
            else:
                result[i] = 0
    return ''.join([str(each) for each in result])

n, m = (int(each) for each in input().split(' '))

# 条件をリストに入れる
condition_list = []
for i in range(m):
    condition_list.append([int(each) for each in input().split(' ')])

print(calculate(n, m, condition_list))

Fixed submission:
def calculate(n, m, condition_list):
    if [1, 0] in condition_list and n > 1:
        return '-1'
    # こたえは1桁ごとに区切ったリストにする
    # 最後にjoinして回答する
    result = ['null']*n
    for condition in condition_list:
        if result[condition[0]-1] != 'null':
            if not result[condition[0]-1] == condition[1]:
                return '-1'
        result[condition[0]-1] = condition[1]
    # 指定がない桁はまだnullのままなのでそれを埋める
    for i in range(len(result)):
        if result[i] == 'null':
            # 一番左の桁が空いていたら1にする
            if i == 0 and n != 1:
                result[i] = 1
            # それ以外の桁が空いていたら0にする
            else:
                result[i] = 0
    return ''.join([str(each) for each in result])

n, m = (int(each) for each in input().split(' '))

# 条件をリストに入れる
condition_list = []
for i in range(m):
    condition_list.append([int(each) for each in input().split(' ')])

print(calculate(n, m, condition_list))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

total = 0

for i in range(1, n + 1):
  m = n // i
  total += i * sum(range(1, m + 1))

print(total)

Fixed submission:
n = int(input())

total = 0

for i in range(1, n + 1):
  m = n // i
  total += i * m * (m + 1) // 2

print(total)
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = list()

while True:
  a, b = divmod(n, 26)
  n = a
  lst.append(b)
  if a == 0:
    break

for i in range(len(lst)):
  if lst[i] <= 0:
    lst[i] += 26
    lst[i + 1] -= 1

if lst[-1] == 0:
  lst.pop()

for i in range(len(lst)):
  lst[i] = chr(lst[i] + 96)

print("".join(lst[::-1]))

Fixed submission:
n = int(input())
lst = list()
 
while True:
  a, b = divmod(n, 26)
  n = a
  lst.append(b)
  if a == 0:
    break
 
for i in range(len(lst) - 1):
  if lst[i] <= 0:
    lst[i] += 26
    lst[i + 1] -= 1
 
if lst[-1] == 0:
  lst.pop()
 
for i in range(len(lst)):
  lst[i] = chr(lst[i] + 96)
 
print("".join(lst[::-1]))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = int(input())

for _ in range(n):
  query = input().split()
  if query == ["1"]:
    s = s[::-1]
  else:
    if query[1] == "1":
      s = query[2] + s
    else:
      s = s + query[2]

print(s)

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

reverse  = False
forward  = ""
backward = ""

for _ in range(n):
  query = input().split()
  if query == ["1"]:
    reverse = not reverse
  else:
    if query[1] == "1":
      if reverse:
        backward += query[2][::-1]
      else:
        forward = query[2] + forward
    else:
      if reverse:
        forward = query[2][::-1] + forward
      else:
        backward += query[2]

if reverse:
  print(backward[::-1] + s[::-1] + forward[::-1])
else:
  print(forward + s + backward)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
dices = list(map(int, input().split()))

max_exp_value = 0

for i in range(n - k + 1):
  exp_value = (sum(dices[i : i + k]) + k) / 2
  if exp_value > max_exp_value:
    max_exp_value = exp_value

print(max_exp_value)

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

exp_value = (sum(dices[:k]) + k) / 2
max_exp_value = exp_value

for i in range(n - k):
  exp_value += (dices[i + k] - dices[i]) / 2
  if exp_value > max_exp_value:
    max_exp_value = exp_value

print(max_exp_value)
Buggy python submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

a.sort()

bc = []

for _ in range(m):
  bc.append(list(map(int, input().split())))

print(bc)

Fixed submission:
rest = []

n = int(input())
for i in range(n):
  tmp = input().split()
  tmp[1] = int(tmp[1]) * (-1)
  tmp.append(i + 1)
  rest.append(tmp)

rest.sort()

for r in rest:
  print(r[2])
Buggy python submission (verdict: Time Limit Exceeded):
n, q = list(map(int, input().split()))
s = input()

lst = []

for _ in range(q):
  lst.append(list(map(int, input().split())))

for i in range(q):
  print(s[lst[i][0] - 1:lst[i][1]].count("AC"))

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


ac = [0] * n

for i in range(n - 1):
  if s[i : i + 2] == "AC":
    ac[i + 1] = ac[i] + 1
  else:
    ac[i + 1] = ac[i]

for _ in range(q):
  l, r = list(map(int, input().split()))
  print(ac[r - 1] - ac[l - 1])
Buggy python submission (verdict: Time Limit Exceeded):
k, s = list(map(int, input().split()))

n = 0

for i in range(k + 1):
  for j in range(k + 1):
    for l in range(k + 1):
      if i + j + l == s:
        n += 1
        
print(n)

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

n = 0

for i in range(k + 1):
  for j in range(k + 1):
    dif = s - (i + j)
    if dif >= 0 and dif <= k:
      n += 1
        
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
sum = 1

for i in range(n):
    sum *= a[i]

if(sum > 1000000000000000000):
    print(-1)
    exit(0)

print(sum)


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

for i in range(n):
    if a[i] == 0:
        print(0)
        exit(0)

for i in range(n):
    sum *= a[i]
    if(sum > 1000000000000000000):
        print(-1)
        exit(0)

print(sum)
Buggy python submission (verdict: Runtime Error):
h = input()
count = 0
count_1 = 1
count_2 = 1
while True:
    if h == 1:
        print(count_2)
        break
    else:
        h = h // 2
        count_1 = count_1 * 2
        count_2 += count_1

Fixed submission:
h = int(input())
count = 0
count_1 = 1
count_2 = 1
while True:
    if h == 1:
        print(count_2)
        break
    else:
        h = h // 2
        count_1 = count_1 * 2
        count_2 += count_1
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [int(x) for x in input().split()]
ans = 0
d = 0
for i in l:
    d += i
    ans += 1
    if d > x:
        print(ans)
        exit(1)



Fixed submission:
n, x = map(int, input().split())
l = [int(x) for x in input().split()]
ans = 1
d = 0
for i in l:
    d += i
    if d <= x:
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
num = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  
cnt = 0
for i in range(num):
  sets = len(make_divisors(i))
  cnt+=sets

print(cnt)

Fixed submission:
num = int(input())

def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table
  
cnt = 0

print(sum(num_divisors_table(num)[:-1]))
Buggy python submission (verdict: Runtime Error):
num = map(lambda x: int(x), input().split())

if num[0]/num[2]<=num[1]: print('Yes')
else: print('No')

Fixed submission:
num = list(map(lambda x: int(x), input().split()))

if num[0]/num[2]<=num[1]: print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
i = input().split()
i = [int(j) for j in i]

flg = 0
for a in range(i[0]):
  if 2*a+4*b==i[1]:
    print("Yes")
    flg = 1
    
if flg==0:
  print("No")

Fixed submission:
i = input().split()
i = [int(j) for j in i]
 
flg = 0
for a in range(i[0]+1):
  if 2*a+4*(i[0]-a)==i[1]:
    print("Yes")
    flg = 1
    
if flg==0:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
num = int(input())
arr = input().split()
arr = sorted([int(i) for i in arr])
arr = list(set(arr))

lis1 = [0]*(arr[-1]+1)

for num in arr:
  for j in range(0, len(lis1), num):
    lis1[j] += 1

cnt = 0
for num in arr:
  if lis1[num]==1: cnt+=1
    
print(cnt)

Fixed submission:
import math
num = int(input())
arr = input().split()
arr = sorted([int(i) for i in arr])

lis1 = [0]*(arr[-1]+1)

for num in arr:
  for j in range(0, len(lis1), num):
    lis1[j] += 1

cnt = 0
for num in arr:
  if lis1[num]==1: cnt+=1
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
tmp = ["Sunny", "Cloudy", "Rainy"]
today = input()

print(tmp[tmp.index(today)%3 + 1])

Fixed submission:
tmp = ["Sunny", "Cloudy", "Rainy"]
today = input()

print(tmp[(tmp.index(today)+1)%3])