Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
s=[0]*m
c=[0]*m
ans=[]
judge=False
for i in range(m):
    s[i],c[i]=map(int,input().split())
for j in range(10**n):
    j=str(j)
    for l in range(m):
        if int(j[s[l]-1])==c[l]:
            pass
        else:
            break
    else:
        ans.append(int(j))
        judge=True
if judge:
    print(min(ans))
else:
    print('-1')

Fixed submission:
N,M=map(int,input().split())
s=[]
c=[]
for i in range(M):
    a,b=map(int,input().split())
    s.append(a)
    c.append(b)
found=False
start=pow(10,N-1)
stop=pow(10,N)
if N==1:
    start=0
for i in range(start,stop):
    i_str=str(i)
    passed=True
    for j in range(M):
        if not i_str[s[j]-1]==str(c[j]):
            passed=False
            break
    if passed:
        found=True
        print(i)
        break
if not found:
    print('-1')

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
s=[0]*m
c=[0]*m
ans=[]
judge=False
for i in range(m):
    s[i],c[i]=map(int,input().split())
for j in range(10**(n-1)-1,10**n):
    j=str(j)
    for l in range(m):
        if int(j[s[l]-1])==c[l]:
            pass
        else:
            break
    else:
        ans.append(int(j))
        judge=True
if judge:
    print(min(ans))
else:
    print('-1')

Fixed submission:
N,M=map(int,input().split())
s=[]
c=[]
for i in range(M):
    a,b=map(int,input().split())
    s.append(a)
    c.append(b)
found=False
start=pow(10,N-1)
stop=pow(10,N)
if N==1:
    start=0
for i in range(start,stop):
    i_str=str(i)
    passed=True
    for j in range(M):
        if not i_str[s[j]-1]==str(c[j]):
            passed=False
            break
    if passed:
        found=True
        print(i)
        break
if not found:
    print('-1')

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
s=[]
c=[]
for i in range(M):
    a,b=map(int,input().split())
    s.append(a)
    c.appemd(b)
found=False
start=pow(10,N-1)
stop=pow(10,N)
if N==1:
    start=0
for i in range(start,stop):
    i_str=str(i)
    passed=True
    for j in range(M):
        if not i_str[s[j]-1]==str(c[j]):
            passed=False
            break
    if passed:
        found=False
        print(i)
        break
if not found:
    print('-1')

Fixed submission:
N,M=map(int,input().split())
s=[]
c=[]
for i in range(M):
    a,b=map(int,input().split())
    s.append(a)
    c.append(b)
found=False
start=pow(10,N-1)
stop=pow(10,N)
if N==1:
    start=0
for i in range(start,stop):
    i_str=str(i)
    passed=True
    for j in range(M):
        if not i_str[s[j]-1]==str(c[j]):
            passed=False
            break
    if passed:
        found=True
        print(i)
        break
if not found:
    print('-1')
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))
D=[]
for i in range(min(X),max(X)):
    sum=0
    for j in range(len(X)):
        sum += abs(X[j]-i)**2
    D.append(sum)
print(min(D))


Fixed submission:
N=int(input())
X=list(map(int,input().split()))
D=[]
for i in range(1,101):
    sum=0
    for j in range(len(X)):
        sum += abs(X[j]-i)**2
    D.append(sum)
print(min(D))
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
price_list=sorted([int(item) for item in input().split()])
total_m=0
def discount(price_list,tickets_num):
    total_ticket =0
    price_list.sort(reverse=True)

    while total_ticket < tickets_num:
        temp = price_list.pop(0)
        temp_new=temp//2
        price_list.append(temp_new)
        price_list.sort(reverse=True)
        total_ticket+=1
    return price_list

res = discount(price_list,M)
print(sum(res))


Fixed submission:
import heapq as hp
N,M=map(int,input().split())
price_list=sorted([-1*int(item) for item in input().split()])
total_m=0
def discount(price_list,tickets_num):
    total_ticket =0
    hp.heapify(price_list)

    while total_ticket < tickets_num:
        temp = hp.heappop(price_list)
        hp.heappush(price_list,-1*(-1*temp//2))
        total_ticket+=1
    return price_list

res = discount(price_list,M)
print(-1*sum(res))
Buggy python submission (verdict: Runtime Error):
s = 'abcdefghijklmnopqrstuvwxy'
C = input(str())

for i in range(len(s)):
    if s[i] == C:
        print(s[i+1])
        break

Fixed submission:
s = 'abcdefghijklmnopqrstuvwxyz'
C = input(str())

for i in range(len(s)):
    if s[i] == C:
        print(s[i+1])
        break
else:
    print('')

Buggy python submission (verdict: Runtime Error):
s = 'abcdefghijklmnopqrstuvwxy'
C = input(str())

for i in range(len(s)):
    if s[i] == C:
        print(s[i+1])
        break
else:
    print('')
    


Fixed submission:
s = 'abcdefghijklmnopqrstuvwxyz'
C = input(str())

for i in range(len(s)):
    if s[i] == C:
        print(s[i+1])
        break
else:
    print('')
Buggy python submission (verdict: Runtime Error):
x,k = map(int,input().split())

if 500*x >= k:
  print('YES')
  
  else:
    print('NO')
    
    

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

if 500*X >= K:
  print('Yes')
  
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())

a = 0
b = 0

if A <= 10**12 and B <=10**12 and K <= 10**12:
    if A >= K :
        a = A-K
    elif  (A + B) >=K:
        a = 0
        b = B-(K-A)
    elif  (A + B)  < K:
        a = 0
        b = 0
else :
    a = 0
    b = 0

print(a,b,end='')

Fixed submission:
S,T=map(str,input().split())

print(T,S,sep='')
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())

a = 0
b = 0


    if A >= K :
        a = A-K
    elif  (A + B) > K:
        a = 0
        b = B-(K-A)
    elif  (A + B)  < K:
        a = 0
        b = 0


print(a,b,end='')


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

a = 0
b = 0

if A <= 10**12 and B <=10**12 and K <= 10**12:
    if A >= K :
        a = A-K
        b = B
    elif  (A + B) >=K:
        a = 0
        b = B-(K-A)
    elif  (A + B)  < K:
        a = 0
        b = 0
else :
    a = 0
    b = 0

print(a,b,end='')
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b+c=>22:
  print(bust)
  else:
  print(win)
  

Fixed submission:
a,b,c = map(int,input().split())
if a+b+c>=22:
  print("bust")
else:
  print("win")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(a+b+c)
if d >= 22:
  print('bust')
else:
  print('win')

Fixed submission:
a,b,c = map(int,input().split())
if a+b+c>=22:
  print("bust")
else:
  print("win")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(a+b+c)


if d >= 22:
    print('bust')
else:
     print('win')


Fixed submission:
a,b,c = map(int,input().split())
if a+b+c>=22:
  print("bust")
else:
  print("win")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

if a>9 and b>9:
  print(-1)
  else
  print(a*b)
  
  

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

if a>9 or b>9:
  print("-1")
else:
  print(a*b)
Buggy python submission (verdict: Runtime Error):
n=input()

if 30<=n:
    print('Yes')
else :
    print('No')


Fixed submission:
n=int(input())

if 30<=n:
    print('Yes')
else :
    print('No')

Buggy python submission (verdict: Runtime Error):
n=input()

if 30<=n:
    print('Yes')
else :
    print('No')


Fixed submission:
n=int(input())

if 30<=n:
    print('Yes')
else :
    print('No')

Buggy python submission (verdict: Runtime Error):
n=input()

if 30<=n:
    print('Yes')
else :
    print('No')


Fixed submission:
n=int(input())

if 30<=n:
    print('Yes')
else :
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
a = list(map(int, input().split()))

result = 1
for i in a:
    result *= i

if result > pow(10, 18):
    print(-1)
    exit(0)
print(result)

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

for i in a:
    if i == 0:
        print(0)
        exit(0)

result = 1
for i in a:
    result *= i
    if result > pow(10, 18):
        print(-1)
        exit(0)

print(result)
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
count = 0
for i in range(N):
    x, y = map(int, input().split())
    if x^2+y^2 <= D^2:
      count += 1
return count

Fixed submission:
N, D = map(int, input().split())
count = 0
for i in range(N):
    x, y = map(int, input().split())
    if x*x + y*y <= D*D:
      count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
primeN = []
tmp = 2
for i in range(2, n):
    if primeN:
        for j in range(len(primeN)):
            if i % primeN[j] == 0:
                break
            else:
                if j == len(primeN) - 1:
                    primeN.append(i)
    else:
        if n > tmp:
            primeN.append(i)
#print(primeN)

s = 0
for j in primeN:
  k = j
  while n%k==0:
    s+=1
    n = int(n/j)
    k = k*j
print(s)

Fixed submission:
a, b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
s = 1
B = sort(A)
for i in B:
  s = s*i
	if s > 10**18:
    	s = -1
        break
    if s == 0
    	break
print(s)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
s = 1
B = sorted(A)
for i in B:
  s = s*i
  if s > 10**18:
    s = -1
    break
  if s == 0:
    break
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
s = 1
for i in A:
  s = s*i
if s > 10**18:
    s = -1
print(s)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
s = 1
B = sorted(A)
for i in B:
  s = s*i
  if s > 10**18:
    s = -1
    break
  if s == 0:
    break
print(s)
Buggy python submission (verdict: Runtime Error):
import sys
def is_unique(seq):
    return len(seq) == len(set(seq))

N = int(input())
W = []
for i in range(N):
    w.append((input()))
if is_unique(W):
    for i in range(N-1):
        if W[i][-1] != W[i+1][0]:
            print("No")
            sys.exit()
    print("Yes")

else:
    print("No")


Fixed submission:
import sys
def is_unique(seq):
    return len(seq) == len(set(seq))

N = int(input())
W = []
for i in range(N):
    W.append((input()))
if is_unique(W):
    for i in range(N-1):
        if W[i][-1] != W[i+1][0]:
            print("No")
            sys.exit()
    print("Yes")

else:
    print("No")
Buggy python submission (verdict: Runtime Error):
R=int(input())
if R<1200:
  print("ABC")
elsif R<2800:
  print("ARC")
else:
  print("AGC")


Fixed submission:
R=int(input())
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Buggy python submission (verdict: Runtime Error):
R=int(input())
if R<1200:
  print("ABC")
elseif R<2800:
  print("ARC")
else:
  print("AGC")

Fixed submission:
R=int(input())
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")
Buggy python submission (verdict: Runtime Error):
import re
S=input()
if S[0]=="A" and S[2:-1].count("C")==1 and len(re.findall("[A-Z]")):
  print("AC")
else:
  print("WA")


Fixed submission:
import re
S=input()
if S[0]=="A" and S[2:-1].count("C")==1 and len(re.findall("[A-Z]",S))==2:
  print("AC")
else:
  print("WA")
Buggy python submission (verdict: Runtime Error):
n = int(input())
sum=0
for i in range(n):
    sum += int(input())
print(sum-n)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(sum(a)-n)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,raw.input().split())
if a + b == 15:
    print("+")
elif a * b  == 15:
    print("*")
else:
    print("x")

Fixed submission:
a,b = map(int,raw_input().split())
if a + b == 15:
    print("+")
elif a * b  == 15:
    print("*")
else:
    print("x")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a + b == 15:
    print("+")
elif a * b  == 15:
    print("*")
else:
    print("x")

Fixed submission:
a,b = map(int,raw_input().split())
if a + b == 15:
    print("+")
elif a * b  == 15:
    print("*")
else:
    print("x")
Buggy python submission (verdict: Runtime Error):
S = input()
w = int(input())
count=0
str = ""
while count < len(S):
    str += S[count]
    count += w
print str


Fixed submission:
s = raw_input()
w = int(raw_input())

ss = ''

for i in xrange(0, len(s), +w): ss += s[i]

print ss

Buggy python submission (verdict: Runtime Error):
S = input()
w = int(input())
count=0
str = ""
while(count <= len(S)-1):
    str += S[count]
    count += w
print(str)

Fixed submission:
s = raw_input()
w = int(raw_input())

ss = ''

for i in xrange(0, len(s), +w): ss += s[i]

print ss

Buggy python submission (verdict: Runtime Error):
S = input()
w = int(input())
count=0
str = ""
while(count <= len(S)):
    str += S[count]
    count += w
print(str)

Fixed submission:
s = raw_input()
w = int(raw_input())

ss = ''

for i in xrange(0, len(s), +w): ss += s[i]

print ss
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def f(n):
    cnt = 0
    for x in range(1, int(n ** 0.5) + 1):
        for y in range(1, int((n-x**2) ** 0.5) + 1):
            for z in range(1, int((n-x**2-y**2) ** 0.5) + 1):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                    cnt += 1

    return cnt

for i in range(1, N+1):
    print(f(i))


Fixed submission:
n = int(input())

ans = [0 for _ in range(n+1)]

for x in range(1, int(n ** 0.5) + 1):
    for y in range(1, int(n ** 0.5) + 1):
        for z in range(1, int(n ** 0.5) + 1):
            a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if a <= n:
                ans[a] += 1

for i in range(1,n+1):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def f(n):
    cnt = 0
    e = int(n ** 0.5) + 1
    for x in range(1, e):
        for y in range(1, e):
            for z in range(1, e):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                    cnt += 1

    return cnt

for i in range(1, N+1):
    print(f(i))


Fixed submission:
n = int(input())

ans = [0 for _ in range(n+1)]

for x in range(1, int(n ** 0.5) + 1):
    for y in range(1, int(n ** 0.5) + 1):
        for z in range(1, int(n ** 0.5) + 1):
            a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if a <= n:
                ans[a] += 1

for i in range(1,n+1):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def f(n):
    cnt = 0
    for x in range(1, int(N ** 0.5) + 1):
        for y in range(1, int(N ** 0.5) + 1):
            for z in range(1, int(N ** 0.5) + 1):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                    cnt += 1

    return cnt

for i in range(1, N+1):
    print(f(i))


Fixed submission:
n = int(input())

ans = [0 for _ in range(n+1)]

for x in range(1, int(n ** 0.5) + 1):
    for y in range(1, int(n ** 0.5) + 1):
        for z in range(1, int(n ** 0.5) + 1):
            a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if a <= n:
                ans[a] += 1

for i in range(1,n+1):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
ans = 0

for i in range(Q):
    B, C = map(str, input().split())
    A = list(map(lambda x: int(str(x).replace(B, C)), A))
    print(sum(A))



Fixed submission:
N = int(input())
A = list(map(int, input().split()))
s = [0] * (10**5+5)
Q = int(input())
total = sum(A)

for i in A:
    s[i] += 1

for _ in range(Q):
    B, C = map(int, input().split())
    d = s[B]
    s[B] = 0
    s[C] += d
    total += (C-B) * d
    print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

for i in range(Q):
    B, C = map(int, input().split())
    A = [C if i == B else i for i in A]
    print(sum(A))



Fixed submission:
N = int(input())
A = list(map(int, input().split()))
s = [0] * (10**5+5)
Q = int(input())
total = sum(A)

for i in A:
    s[i] += 1

for _ in range(Q):
    B, C = map(int, input().split())
    d = s[B]
    s[B] = 0
    s[C] += d
    total += (C-B) * d
    print(total)
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
lis = list(map(int,input().split(" ")))
N = 1

for i in range(a):
  N *= lis[i]
  
if N > 10**18:
  print(-1)
else:
  print(N)


Fixed submission:
a = int(input())
lis = list(map(int,input().split(" ")))
N = 1

if 0 in lis:
  print(0)
  exit()

for i in range(a):
  N *= lis[i]
  if N > 10**18:
    print(-1)
    exit()

print(N)

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
lis = list(map(int,input().split(" ")))
N = 1

for i in range(a):
  N *= lis[i]
  
if N > 10**18:
  print(-1)
else:
  print(N)


Fixed submission:
a = int(input())
lis = list(map(int,input().split(" ")))
N = 1

if 0 in lis:
  print(0)
  exit()

for i in range(a):
  N *= lis[i]
  if N > 10**18:
    print(-1)
    exit()

print(N)
Buggy python submission (verdict: Runtime Error):
from collections import deque
N,M = list(map(int,input().split(" ")))
AB =  [list(map(int,input().split(" "))) for _ in range(M)]
links = [[] for i in range(M+1)]

for a,b in AB:
  links[a].append(b)
  links[b].append(a)

result = [-1] * (N+1)
q = deque([1])
while q:
  i = q.popleft()
  for j in links[i]:
    if result[j] == -1:
      result[j] = i
      q.append(j)
      
print('Yes')
print('\n'.join(str(i) for i in result[2:]))



Fixed submission:
from collections import deque

N, M = map(int, input().split())
AB = [map(int, input().split()) for _ in range(M)]

links = [[] for _ in range(N + 1)]
for a, b in AB:
    links[a].append(b)
    links[b].append(a)

result = [-1] * (N + 1)
q = deque([1])
while q:
    i = q.popleft()
    for j in links[i]:
        if result[j] == -1:
            result[j] = i
            q.append(j)
print('Yes')
print('\n'.join(str(i) for i in result[2:]))

Buggy python submission (verdict: Runtime Error):
from collections import deque
N,M = list(map(int,input().split(" ")))
AB =  [list(map(int,input().split(" "))) for _ in range(M)]
links = [[] for i in range(M+1)]

for a,b in AB:
  links[a].append(b)
  links[b].append(a)

result = [-1] * (N+1)
q = deque([1])
while q:
  i = q.popleft()
  for j in links[i]:
    if result[j] == -1:
      result[j] = i
      q.append(j)
      
print('Yes')
print('\n'.join(str(i) for i in result[2:]))



Fixed submission:
from collections import deque

N, M = map(int, input().split())
AB = [map(int, input().split()) for _ in range(M)]

links = [[] for _ in range(N + 1)]
for a, b in AB:
    links[a].append(b)
    links[b].append(a)

result = [-1] * (N + 1)
q = deque([1])
while q:
    i = q.popleft()
    for j in links[i]:
        if result[j] == -1:
            result[j] = i
            q.append(j)
print('Yes')
print('\n'.join(str(i) for i in result[2:]))

Buggy python submission (verdict: Runtime Error):
from collections import deque
N,M = list(map(int,input().split(" ")))
AB =  [list(map(int,input().split(" "))) for _ in range(M)]
links = [[] for i in range(M+1)]

for a,b in AB:
  links[a].append(b)
  links[b].append(a)

result = [-1] * (N+1)
q = deque([1])
while q:
  i = q.popleft()
  for j in links[i]:
    if result[j] == -1:
      result[j] = i
      q.append(j)
      
print('Yes')
print('\n'.join(str(i) for i in result[2:]))



Fixed submission:
from collections import deque

N, M = map(int, input().split())
AB = [map(int, input().split()) for _ in range(M)]

links = [[] for _ in range(N + 1)]
for a, b in AB:
    links[a].append(b)
    links[b].append(a)

result = [-1] * (N + 1)
q = deque([1])
while q:
    i = q.popleft()
    for j in links[i]:
        if result[j] == -1:
            result[j] = i
            q.append(j)
print('Yes')
print('\n'.join(str(i) for i in result[2:]))
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
f = "NG"

for i in range(A, B+1):
  i % K == 0:
    f = "OK"
    
print(f)

Fixed submission:
K = int(input())
A, B = map(int, input().split())
f = "NG"

for i in range(A, B + 1):
    if i % K == 0:
        f = "OK"

print(f)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
x = N
x_b = 0

if K == 1:
    x = 0
else:
    while True:
        x_b = x
        x = abs(x-K)
        if abs(x-K) == x_b:
            break

print(min(x_b,x))


Fixed submission:
N, K = map(int, input().split())
a = (N // K) + 1

ans1 = -(N-K*a)
ans2 = N - (K*(N//K))
print(min(ans1,ans2))
Buggy python submission (verdict: Runtime Error):
S = input()

if "A" in S and "B" in S:
  prnt("Yes")
else:
  ptint("No")

Fixed submission:
S = input()

if "A" in S and "B" in S:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

dic ={}

for i in range(N):
    a = input()
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1

l = [j for j, k in dic.items() if k == max(dic.values())]
l.sort()

for a in l:
    print(a)

Fixed submission:
N = int(input())

dic = {}

for _ in range(N):
    a = input()
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1

m = max(dic.values())

for s in sorted(k for k in dic if dic[k] == m):
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = list(map(int, input().split()))

attendance = []

for i in range(1, N+1):
    attendance.append(l.index(i)+1)

print(*attendance)


Fixed submission:
N = int(input())
A = map(int, input().split())
L = [0] * N

for i,val in enumerate(A):
    L[val-1] = i + 1

print(*L)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = list(map(int, input().split()))

attendance = []

for i in range(1, N+1):
    attendance.append(l.index(i)+1)

print(" ".join(map(str, attendance)))


Fixed submission:
N = int(input())
A = map(int, input().split())
L = [0] * N

for i,val in enumerate(A):
    L[val-1] = i + 1

print(*L)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
P = [K]*N

for i in range(Q):
    w = int(input())
    P = list(map(lambda x: x-1, P))
    P[w-1] += 1

for j in P:
    if j > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
N, K, Q = map(int, input().split())
P = [K-Q]*N

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

for j in P:
    if j > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
P = [K]*N

for i in range(Q):
    w = int(input())
    P = list(map(lambda x: x-1, P))
    P[w-1] += 1

for j in P:
    if j > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
N, K, Q = map(int, input().split())
P = [K-Q]*N

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

for j in P:
    if j > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = list(map(int, input().split()))
H_lis = []
H = lis[0]
cnt = 0

for i in lis[1:]:
    if i <= H:
       cnt += 1
       H = i
       H_lis.append(cnt)
    else:
        H_lis.append(cnt)
        cnt = 0
        H = i

print(max(H_lis))

Fixed submission:
N = int(input())
lis = list(map(int, input().split()))
H_lis = []
H = lis[0]
cnt = 0

if N == 1:
    print(0)
    exit()

for i in lis[1:]:
    if i <= H:
       cnt += 1
       H = i
       H_lis.append(cnt)
    else:
        H_lis.append(cnt)
        cnt = 0
        H = i

print(max(H_lis))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

lis = [i for i in range(1, N)]

print(sum(lis))


Fixed submission:
N = int(input())

ans = N * (N - 1) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

lis = [i for i in range(N)]

ans = 0

for i in range(1, N):
    ans += i

print(ans)

Fixed submission:
N = int(input())

ans = N * (N - 1) // 2

print(ans)