Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
n=int(input())
v=[int(x) for x in input().split()]
if len(set(v))==1:
    print(n//2)
    import sys
    sys.exit()
from collections import Counter
v1=[]
v2=[]
for i in range(n):
    if i%2==0:
        v1.append(v[i])
    else:
        v2.append(v[i])
v1=Counter(v1)
v2=Counter(v2)
ans=10**10
# print(v1,v2)
for i1 in v1.most_common():
    for i2 in v2.most_common():
        # print(n-i1[1]-i2[1],i1,i2)
        ans=min(n-i1[1]-i2[1],ans)
print(ans)

Fixed submission:
# coding: utf-8
# Your code here!
n=int(input())
v=[int(x) for x in input().split()]
if len(set(v))==1:
    print(n//2)
    import sys
    sys.exit()
from collections import Counter
v1=[]
v2=[]
for i in range(n):
    if i%2==0:
        v1.append(v[i])
    else:
        v2.append(v[i])
v1=Counter(v1)
v2=Counter(v2)
ans=10**10
# print(v1,v2)
for i1 in v1.most_common(min(len(v1),10)):
    for i2 in v2.most_common(min(len(v1),10)):
        # print(n-i1[1]-i2[1],i1,i2)
        if i1==i2:
            continue
        ans=min(n-i1[1]-i2[1],ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=[int(x) for x in input()]
print(max(a,b,c)*10+a+b+c-min(a,b,c))

Fixed submission:
a,b,c=[int(x) for x in input().split()]
print(max(a,b,c)*10+a+b+c-max(a,b,c))
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(len([i for i in range (1,int(input())+1) if i%2 == 1 and len([1 for x in range(1,i+1) if i%x==0]) == 8]))

Fixed submission:
n=int(input())
print(len([i for i in range (1,n+1) if i%2 == 1 and len([1 for x in range(1,i+1) if i%x==0]) == 8]))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=[int(x) for x in input().split()]
a=[int(x)%m for x in input().split()]

a_ruijou_wa=[0]*(n+1)
for i in range(1,n+1):
    a_ruijou_wa[i]=a_ruijou_wa[i-1]+a[i-1]

ans=0
for sentou in range(n+1):
    for ato in range(sentou):
        if (a_ruijou_wa[sentou] - a_ruijou_wa[ato])%m==0:
            ans+=1
print(ans)

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

a_ruiseki_wa=[0]
for i in range(n):
    a_ruiseki_wa.append((a_ruiseki_wa[i]+a[i])%m)

from collections import defaultdict
d=defaultdict(int)
for key  in a_ruiseki_wa:
    d[key]+=1

print(sum([x*(x-1)//2 for x in d.values()]))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
n=int(input())
a=[int(x) for x in input().split()]
import math
def prod(lists):
    ans=1
    for i in lists:
        ans=ans*i
    return ans
def gcd(numbers):
    ans=numbers[0]
    for i in numbers:
        ans=math.gcd(ans,i)
    return ans
lcm=prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
import math
def prod(lists):
    ans=1
    for i in lists:
        ans=ans*i
    return ans
def gcd(numbers):
    ans=numbers[0]
    for i in numbers:
        ans=math.gcd(ans,i)
    return ans
lcm=prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
import math
def prod(lists):
    ans=1
    for i in lists:
        ans=ans*i
    return ans
def gcd(numbers):
    ans=numbers[0]
    for i in numbers:
        ans=math.gcd(ans,i)
    return ans
lcm=prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
import math
from functools import reduce
def prod(lists):
    ans=1
    for i in lists:
        ans=ans*i
    return ans
def gcd(numbers):
    return reduce(math.gcd, numbers)
lcm=prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
import math
from functools import reduce,partial
import operator
prod = partial(reduce, operator.mul)
def gcd(numbers):
    return reduce(math.gcd, numbers)
lcm=prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
import numpy as np
import math
from functools import reduce,partial
import operator
prod = partial(reduce, operator.mul)
def gcd(numbers):
    return reduce(math.gcd, numbers)
lcm=prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
import numpy as np
import math
from functools import reduce
def gcd(numbers):
    return reduce(math.gcd, numbers)
lcm=np.prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))
Buggy python submission (verdict: Runtime Error):
a,b=[int(x) for x in input()]
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")

Fixed submission:
a,b=[int(x) for x in input().split()]
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")
Buggy python submission (verdict: Runtime Error):
n,k=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
index1=a.index(1)
if k>=index1+1 or n-(index1+1)<=k:
    print(round((len(a)-1)/(k-1)))
else:
    ans=float("inf")
    for i in range(k):
        ans=min(ans,1+round((index1+1-k+i)/k)+round(n-(index1+1+i))/k))
    print(ans)

Fixed submission:
n,k=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
import math
print(math.ceil((len(a)-1)/(k-1)))
Buggy python submission (verdict: Runtime Error):
if n==100:
    n+=1
if d==0:
    print(n)
elif d==1:
    print(100*n)
else:
    print(n*100**2)

Fixed submission:
d,n=[int(x) for x in input().split()]
if n==100:
    n+=1
if d==0:
    print(n)
elif d==1:
    print(100*n)
else:
    print(n*100**2)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
ans=[]
for i in range(1,len(s)+1):
    ans=ans+[s[x:x+i] for x in range(len(s)-i+1)]
    ans=list(set(ans))
print(sorted(ans)[k-1])

Fixed submission:
s=input()
k=int(input())
moji=sorted(list(set(s)))
ans=[moji[0]]
mojinum=0
if k==1:
    print(ans[0])
    import sys
    sys.exit()
while(True):
    for r in range(len(moji)):
        if ans[-1]+moji[r] in s:
            ans.append(ans[-1]+moji[r])
            break
        elif r==len(moji)-1:
            mojinum+=1
            ans.append(moji[mojinum])
    if len(ans)>=k:
        break
print(ans[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
ans=[]
for i in range(1,len(s)+1):
    ans=ans+list(set([s[x:x+i] for x in range(len(s)-i+1)]))
print(sorted(ans)[k-1])

Fixed submission:
s=input()
k=int(input())
moji=sorted(list(set(s)))
ans=[moji[0]]
mojinum=0
if k==1:
    print(ans[0])
    import sys
    sys.exit()
while(True):
    for r in range(len(moji)):
        if ans[-1]+moji[r] in s:
            ans.append(ans[-1]+moji[r])
            break
        elif r==len(moji)-1:
            mojinum+=1
            ans.append(moji[mojinum])
    if len(ans)>=k:
        break
print(ans[k-1])
Buggy python submission (verdict: Runtime Error):
a,b=[int(x) for x input().split()]
if a<=b:
    print(a)
else:
    print(a-1)

Fixed submission:
a,b=[int(x) for x in input().split()]
if a<=b:
    print(a)
else:
    print(a-1)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=[int(a) for a in input().split()]
ans=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                ans+=1
print(ans)

Fixed submission:
k,s=[int(a) for a in input().split()]
ans=0
for x in range(k+1):
    for y in range(k+1):
        z=s-(x+y)
        if 0<=z<=k:
            ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

W = [v-c for v, c in zip(V, C) if (v-c) > 0]
print(sum(W)

Fixed submission:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

W = [v-c for v, c in zip(V, C) if (v-c) > 0]
print(sum(W))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())

t = S[K]
newS = [s if s == t else '*' for s in S]
print(''.join(newS))

Fixed submission:
N = int(input())
S = input()
K = int(input())

t = S[K-1]
newS = [s if s == t else '*' for s in S]
print(''.join(newS))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
S = input()

if '.' not in S or '#' not in S:
  print(0)
  sys.exit()
  
ans = N
for i in range(N):
  ans = min(S[:i].count('#') + S[i:].count('.'), ans)

print(ans)

Fixed submission:
import sys
N = int(input())
S = input()

if '.' not in S or '#' not in S:
  print(0)
  sys.exit()
  
l = 0  # 境界より左の'#'の数
r = S.count('.')  # 境界より右の'.'の数
ans = l+r
for s in S:
  if s == '.':
    r -= 1
  else:
    l += 1
  ans = min(l+r, ans)

print(ans)
Buggy python submission (verdict: Runtime Error):
nums = [int(input()) for _ in range(5)]

min1 = min([i % 10 for i in nums if i%10 != 0])

amount = 0
last = True
for i in nums:
  if last and i% 10 == min1:
    amount += i
    last = False
  else:
    amount += (i //10 + 1)*10 if i %10 != 0 else (i//10)*10
print(amount)

Fixed submission:
nums = [int(input()) for _ in range(5)]

h = [i % 10 for i in nums if i%10 != 0]
min1 = 0 if len(h)==0 else min(h)

amount = 0
last = True
for i in nums:
  if last and i% 10 == min1:
    amount += i
    last = False
  else:
    amount += (i //10 + 1)*10 if i %10 != 0 else (i//10)*10
print(amount)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()

for i in range(Q):
  l, r = map(int, input().split())
  P = S[l-1: r]
  cnt = 0
  flg = False
  for p in P:
    if flg:
      if p == 'C':
        cnt += 1
      flg = False
    elif p == 'A':
      flg = True
  print(cnt)

Fixed submission:
N, Q = map(int, input().split())
S = input()
 
C = [0]
 
cnt = 0
flg = False
for s in S:
  if flg:
    if s == 'C':
      cnt += 1
    flg = False
  if s == 'A':
    flg = True
  C.append(cnt)
 
for i in range(Q):
  l, r = map(int, input().split())
  ans = C[r] - C[l-1]
  if l-2 >= 0 and S[l-1] == 'C' and S[l-2] == 'A':
    ans -= 1
  print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
A, B, K = map(int, input().split())

s = 0
def sp(R):
  if R==1:
    return {1:1}
  dic = {}
  I = int(R)
  s=0
  while s==0:
    for i in range(2, R+1):
      if I%i==0:
        I=I/i
        if I==1:
          s=1
        if i not in dic:
          dic[i] = 0
        dic[i] += 1
        break
  return dic

a = sp(A)
b = sp(B)
c = []

if A == 1 and B == 1:
  print(1)
  sys.exit()
elif A == 1:
  for i in range(0, max(b.keys())+1):
    if i in b:
      t = b[i]
      c.append([i**j for j in range(t+1)])
elif B == 1:
  for i in range(0, max(a.keys())+1):
    if (i in a):
      t = a[i]
      c.append([i**j for j in range(t+1)])
else:
  for i in range(0, max(max(a.keys()), max(b.keys()))+1):
    if (i in a) and (i in b):
      t = min(a[i], b[i])
      c.append([i**j for j in range(t+1)])

arr = []
import itertools
from functools import reduce
for i in itertools.product(*c):
  v = reduce(lambda x,y:x*y,i)
  if v not in arr:
    arr.append(v)

arr.sort(reverse=True)

print(arr[K-1])

Fixed submission:
import sys
A,B,K = map(int, input().split())

for i in range(min(A,B), 0, -1):
  if (A % i == 0) and (B%i == 0):
    K-=1
  if K == 0:
    print(i)
    sys.exit()

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

s = 0
def sp(R):
  if R == 1:
    return {1:1}
  dic = {}
  I = int(R)
  s=0
  while s==0:
    for i in range(2, R+1):
      if I%i==0:
        I=I/i
        if I==1:
          s=1
        if i not in dic:
          dic[i] = 0
        dic[i] += 1
        break
  return dic

a = sp(A)
b = sp(B)

c = []
for i in range(0, max(max(a.keys()), max(b.keys()))+1):
  if (i in a) and (i in b):
    t = min(a[i], b[i])
    c.append([i**j for j in range(t+1)])

arr = []
import itertools
from functools import reduce
for i in itertools.product(*c):
  v = reduce(lambda x,y:x*y,i)
  if v not in arr:
    arr.append(v)

arr.sort(reverse=True)

print(arr[K-1])

Fixed submission:
import sys
A,B,K = map(int, input().split())

for i in range(min(A,B), 0, -1):
  if (A % i == 0) and (B%i == 0):
    K-=1
  if K == 0:
    print(i)
    sys.exit()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
S = list(input())

if len(S) == 1:
  print(0)
  sys.exit()

cnt = 0
while True:
  o = True
  i=0
  while i < len(S)-1:
    s=S[i]
    if s != S[i+1]:
      S.pop(i)
      S.pop(i)
      o = False
      cnt += 2
      break
    i+=1
  if o:
    break

print(cnt)

Fixed submission:
S = input()
print(min(S.count('0'), S.count('1'))*2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split())) + [0]
dp = [-1]*N

def dfs(pos):
  if pos >= N:
    return 99999999
  if pos == N-1:
    return 0
  if dp[pos] != -1:
    return dp[pos]
  s1 = dfs(pos+1) + abs(H[pos+1] - H[pos])
  s2 = dfs(pos+2) + abs(H[pos+2] - H[pos])
  dp[pos] = min(s1, s2)
  return dp[pos]

print(dfs(0))

Fixed submission:
N = int(input())
h = [int(i) for i in input().split()]+[0 for _ in range(2)]
dp = [float('inf') for _ in range(N+2)]

dp[0] = 0
for i in range(N-1):
  dp[i+1] = min(dp[i]+abs(h[i]-h[i+1]), dp[i+1])
  dp[i+2] = min(dp[i]+abs(h[i]-h[i+2]), dp[i+2])
print(dp[N-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
dp = [-1]*N

def dfs(pos):
  if pos >= N:
    return 99999999
  if pos == N-1:
    return 0
  if pos == N-2:
    return abs(H[pos+1] - H[pos])
  if dp[pos] != -1:
    return dp[pos]
  s1 = dfs(pos+1) + abs(H[pos+1] - H[pos])
  s2 = dfs(pos+2) + abs(H[pos+2] - H[pos])
  dp[pos] = min(s1, s2)
  return dp[pos]

print(dfs(0))

Fixed submission:
N = int(input())
h = [int(i) for i in input().split()]+[0 for _ in range(2)]
dp = [float('inf') for _ in range(N+2)]

dp[0] = 0
for i in range(N-1):
  dp[i+1] = min(dp[i]+abs(h[i]-h[i+1]), dp[i+1])
  dp[i+2] = min(dp[i]+abs(h[i]-h[i+2]), dp[i+2])
print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = []
for i in range(N):
  T.append(list(map(int, input().split())))

dp = [-1]*N

def dfs(i, prev):
    if i >= N:
      return 0
    maxp = -99999999
    for j in range(3):
      if prev == j:
        continue
      maxp = max(maxp, dfs(i+1, j) + T[i][j])
    return maxp

print(dfs(0,-1))

Fixed submission:
N= int(input())
X = [list(map(int, input().split())) for _ in range(N)]
L = 3
dp = [[0 for _ in range(3)] for _ in range(N+1)]

dp[0] = [0,0,0]
for i in range(N):
  dp[i+1] = [max([dp[i][k] for k in range(L) if k != j]) + X[i][j] for j in range(L)]

print(max(dp[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
T=list(input())

if False not in [s==t for s,t in zip(S,T)]:
  print("Yes")
  exit()

for i in range(len(S)):
  if S[i] == T[i]:
    continue
  c1 = S[i]
  c2 = T[i]
  for j in range(len(S)):
    if S[j] == c1:
      S[j] = c2
    elif S[j] == c2:
      S[j] = c1
  if False not in [s==t for s,t in zip(S,T)]:
    print("Yes")
    exit()

print("No")

Fixed submission:
S=input()
T=input()

from collections import Counter
sd = Counter(S)
td = Counter(T)

sdd = Counter(list(sd.values()))
tdd = Counter(list(td.values()))

for k,v in sdd.items():
  if k not in tdd or tdd[k] != sdd[k]:
    print("No")
    exit()

print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N, Y = map(int, input().split())

for x in reversed(range((Y//10000)+1)):
  for y in reversed(range(((Y-x*10000)//5000)+1)):
    for z in reversed(range(((Y-x*10000-y*5000)//1000)+1)):
      if 10000*x + 5000*y + 1000*z == Y and x+y+z == N:
        print(x, y, z)
        quit()

print("-1 -1 -1")

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

for x in range(N+1):
  for y in range(N-x+1):
    z = N-x-y
    if 10000*x + 5000*y + 1000*z == Y and x+y+z == N:
      print(x, y, z)
      quit()

print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
import math
h = int(input())
i = int(math.ceil(h/2))
print(int("1"*(i+1), 2))

Fixed submission:
import math
h = int(input())
c = 0
while h > 1:
    h /= 2
    c += 1
if h == 1:
    print(int("1"*(c+1),2))
else:
    print(int("1"*c,2))
Buggy python submission (verdict: Runtime Error):
import itertools
N,M = map(int,input().split())
A = sorted(map(int,input().split()))[::-1]

print(sum(sorted([sum(i) for i in itertools.product(A, repeat=2)])[::-1][:M]))


Fixed submission:
A, B = input().split()
print(B+A)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int,input().split())
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
        
print(A, B)

Fixed submission:
A,B,K = map(int,input().split())
A = A - K
if A >= 0:
    print(A,B)
else:
    B = B + A
    if B >= 0:
        print(0,B)
    else:
        print(0,0)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().split()))
b = 1
for i in a:
    if b in a:
        if b == i:
            b += 1
    else:
        break
if b == 1:
    print(-1)
else:
    print(N-b+1)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = 1
for i in range(N):
    if b == a[i]:
        b += 1
if b == 1:
    print(-1)
else:
    print(N-b+1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k = [int(input()) for x in range()]
if e-a <= k:
    print("Yay!")
else:
    print(":(")

Fixed submission:
a,b,c,d,e,k = [int(input()) for x in range(6)]
if e-a <= k:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
s = input().split("")
if s[0] == s[1] == s[2]:
  print("Yes")
else:
  print("No")

Fixed submission:
s = input().split(" ")
if s[0] == s[1] == s[2]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
h = int(input())

count = 0
result = 1
while True:
    h = h//2
    count += 1
    result += 2**count
    if h == 1:
        break

print(result)

Fixed submission:
h = int(input())

count = 0
result = 1

if h == 1:
    print(1)
    exit()

while True:
    h = h//2
    count += 1
    result += 2**count
    if h == 1:
        break

print(result)
Buggy python submission (verdict: Runtime Error):
X = int(input())

num_list = [0]*100001
num_list[0] = 1

for i in range(100001 + 1 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1

print(0)

Fixed submission:
X = int(input())

num_list = [0]*(100001 + 105)
num_list[0] = 1

for i in range(100001 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1

print(0)

Buggy python submission (verdict: Runtime Error):
X = int(input())

num_list = [0]*100000
num_list[0] = 1

for i in range(100001 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1

print(0)

Fixed submission:
X = int(input())

num_list = [0]*(100001 + 105)
num_list[0] = 1

for i in range(100001 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1

print(0)

Buggy python submission (verdict: Runtime Error):
X = int(input())

num_list = [0]*100000
num_list[0] = 1

for i in range(100001 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1


Fixed submission:
X = int(input())

num_list = [0]*(100001 + 105)
num_list[0] = 1

for i in range(100001 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1

print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a_list = [int(input()) for _ in range(q)]
if k > q:
    for _ in range(n):
        print('Yes')
else:
    point_list = [k for _ in range(n)]
    for a in a_list:
        one_list = [1 for _ in range(n)]
        one_list[a-1] = 0
        point_list = [point - one_list[i] for i, point in enumerate(point_list)]
    for point in point_list:
        if point > 0:
            print('Yes')
        else:
            print('No')

Fixed submission:
n, k, q = map(int, input().split())
a_list = [int(input()) for _ in range(q)]
if k > q:
    for _ in range(n):
        print('Yes')
else:
    point_list = [0 for _ in range(n)]
    for a in a_list:
        point_list[a-1] += 1

    all_sum = sum(point_list)

    for point in point_list:
        if k - all_sum + point > 0:
            print('Yes')
        else:
            print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
if n % 2:
    temp = int((1 + n-1) * ((n-1) / 2))
else:
    temp = int((1 + n-1) * ((n-1) // 2) + -(-n // 2))
for i in range(1, n):
    if n % (i+1) > i:
        temp += n-i
print(temp)

Fixed submission:
n = int(input())
print(n * (n-1)//2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n == 1:
    print(0)
else:
    print(sum(list(range(1, n))))

Fixed submission:
n = int(input())
print(n * (n-1)//2)