Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,M=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]
    B=[list(map(int,input().split())) for i in range(M)]

    for i in A:
        valmin=10**5
        cnt=0
        for j in B:
            if abs(i[0]-j[0])+abs(i[1]-j[1])<valmin:
                valmin=abs(i[0]-j[0])+abs(i[1]-j[1])
                ans=cnt+1
            cnt+=1
        print(ans)





resolve()

Fixed submission:
A,B=map(int,input().split())
#print(sorted(B)[0])
print((A+B)%24)

Buggy python submission (verdict: Runtime Error):
A,B=map(str,input().split())
#print(sorted(B)[0])
print((A+B)%24)

Fixed submission:
A,B=map(int,input().split())
#print(sorted(B)[0])
print((A+B)%24)
Buggy python submission (verdict: Runtime Error):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,M=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]
    B=[list(map(int,input().split())) for i in range(M)]

    for i in A:
        valmin=10**5
        cnt=0
        for j in B:
            if abs(i[0]-j[0])+abs(i[1]-j[1])<valmin:
                valmin=abs(i[0]-j[0])+abs(i[1]-j[1])
                ans=cnt+1
            cnt+=1
        print(ans)





resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,M=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]
    B=[list(map(int,input().split())) for i in range(M)]

    for i in A:
        valmin=10**5
        cnt=0
        l=[]
        for j in B:
            l.append(abs(i[0]-j[0])+abs(i[1]-j[1]))
        print(l.index(min(l))+1)





resolve()

Buggy python submission (verdict: Runtime Error):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,M=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]
    B=[list(map(int,input().split())) for i in range(M)]

    for i in A:
        valmin=10**5
        cnt=0
        for j in B:
            if abs(i[0]-j[0])+abs(i[1]-j[1])<valmin:
                valmin=abs(i[0]-j[0])+abs(i[1]-j[1])
                ans=cnt+1
            cnt+=1
        print(ans)





resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,M=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]
    B=[list(map(int,input().split())) for i in range(M)]

    for i in A:
        valmin=10**5
        cnt=0
        l=[]
        for j in B:
            l.append(abs(i[0]-j[0])+abs(i[1]-j[1]))
        print(l.index(min(l))+1)





resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    N=int(input())
    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: # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n//i)

        # divisors.sort() # ソートしたけりゃして
        return divisors
    l=make_divisors(N)
    ls=len(l)
    l1=l[-1]
    l2=l[-2]

    if len(l)%2==0:
        print(max(len(str(l1)),len(str(l2))))
    else:
        print(len(str(l1)))
        

resolve()

Fixed submission:
def resolve():
    N=int(input())
    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: # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n//i)

        # divisors.sort() # ソートしたけりゃして
        return divisors
    l=make_divisors(N)
    ls=len(l)
    l1=l[-1]
    try:
        l2=l[-2]
    except:
        pass

    if len(l)%2==0:
        print(max(len(str(l1)),len(str(l2))))
    else:
        print(len(str(l1)))
        

resolve()
Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
from collections import Counter, deque
# from copy import copy, deepcopy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
# from operator import xor
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():
    def main():
        X=int(input())
        d=deque([1,0,-1])
        now=2
        while True:
            for i in range(3**(now-1)):
                dd=d.popleft()
                if dd==X:
                    return now
                else:
                    d.append(dd+now)
                    d.append(dd)
                    d.append(dd-now)
            now+=1
    print(main()-1)






resolve()

Fixed submission:
def resolve():

    X=int(input())
    cnt=1
    while True:
        val=cnt*(cnt+1)//2
        if val>=X:
            print(cnt)
            break
        else:
            cnt += 1


resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
from collections import Counter, deque
# from copy import copy, deepcopy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
# from operator import xor
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():
    X=int(input())
    d=deque([[0,0]])

    while True:
        dd=d.popleft()
        if dd[0]==X:
            print(dd[1])
            break
        else:
            d.append([dd[1]+1+dd[0],dd[1]+1])
            d.append([dd[0],dd[1]+1])
            d.append([-(dd[1]+1)+dd[0],dd[1]+1])






resolve()

Fixed submission:
def resolve():

    X=int(input())
    cnt=1
    while True:
        val=cnt*(cnt+1)//2
        if val>=X:
            print(cnt)
            break
        else:
            cnt += 1


resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    N,M=map(int,input().split())
    A=[list(map(int,input().split())) for i in range(N)]
    B=[list(map(int,input().split())) for i in range(M)]

    for i in A:
        valmin=10**5
        cnt=0
        for j in B:
            if abs(i[0]-j[0])+abs(i[1]-j[1])<valmin:
                valmin=abs(i[0]-j[0])+abs(i[1]-j[1])
                ans=cnt+1
            cnt+=1
        print(ans)
        
 resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,M=map(int,input().split())
    A=np.array([[_ for _ in input()] for _ in range(N)])
    B=np.array([[_ for _ in input()] for _ in range(M)])

    #print(A[1:3][1:3])
    def main():
        for i in range(N-M+1):
            for j in range(N-M+1):
                if (A[i:i + M, j:j + M] == B).all():
                    return 'Yes'
                elif i==N-M and j==N-M:
                    return 'No'
    print(main())

resolve()
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():

    N = int(input())
    A = list(map(int, input().split()))

    AA = Counter(A)
    ans = 0
    val = 0
    for k, v in AA.items():
        if v % 2 == 0:
            ans += 1
        else:
            val += 1
    if ans % 2 !=0:
        ans -= 1
    print(val+ans)


resolve()

Fixed submission:
from collections import Counter, deque, OrderedDict
# from copy import copy, deepcopy
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import statistics # Pythonのみ
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():

    N = int(input())
    A = list(map(int, input().split()))

    AA = Counter(A)
    ans = 0
    val = 0
    for k, v in AA.items():
        if v % 2 == 0:
            ans += 1
        else:
            val += 1
    if ans % 2 !=0:
        ans -= 1
    print(val+ans)


resolve()
Buggy python submission (verdict: Time Limit Exceeded):
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    N=int(input())
    A, B = [0] * N, [0] * N
    for i in range(N):
        A[i], B[i] = map(int, input().split())
    
    ans=0
    for i in reversed(range(N)):
        cnt=0
        p,mod=divmod(A[i],B[i])
        if mod==0:
            continue
        else:
            cnt+=B[i]-mod
            for j in range(i):
                A[j]+=cnt
        ans+=cnt
    print(ans)







resolve()

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    N=int(input())
    A, B = [0] * N, [0] * N
    for i in range(N):
        A[i], B[i] = map(int, input().split())

    ans=0
    cnt=0
    for i in reversed(range(N)):
        p,mod=divmod(A[i]+cnt,B[i])
        if mod==0:
            continue
        else:
            cnt+=B[i]-mod
    print(cnt)







resolve()
Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
from collections import Counter, deque
# from copy import copy, deepcopy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
# from operator import xor
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():

    def main():
        S=str(input())
        d=deque(['dream','dreamer','erase','eraser'])
        long=5

        while long<len(S)*2:
            dd = d.popleft()
            long=len(dd)
            if dd==S:
                return 'YES'

            else:
                d.extend([dd+'dream',dd+'dreamer',dd+'erase',dd+'eraser'])

        return 'NO'
    print(main())





resolve()

Fixed submission:
def resolve():

    S=str(input())[::-1]
    flag='YES'
    i=0

    while i<len(S):
        if S[i:i+5]=='maerd' or S[i:i+5]=='esare':
            i+=5
            continue
        if S[i:i+6]=='resare':
            i+=6
            continue
        if S[i:i+7]=='remaerd':
            i+=7
        else:
            flag='NO'
            break

    print(flag)









resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    a, b, x = map(int, input().split())

    cnt = 0
    for i in range(a, b + 1):
        if i % x == 0:
            cnt += 1

    print(cnt)


resolve()


Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    a, b, x = map(int, input().split())

    print(b//x-(a-1)//x)


resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, a, b = map(int, input().split())
    S = str(input())
    A, B = [0] * N, [0] * N
    for i in range(N):
        if S[i] == 'a':
            A[i] = 1
        elif S[i] == 'b':
            B[i] = 1
    from itertools import accumulate

    AA = [0] + A
    AA = list(accumulate(AA))  # 累積和を格納したリスト作成
    BB = [0] + B
    BB = list(accumulate(BB))  # 累積和を格納したリスト作成

    for i in range(N):
        if S[i] == 'a':
            if AA[i + 1] + BB[i + 1] - 1 < a + b:
                print('Yes')
            else:
                print('No')
                for j in range(i + 1, N + 1):
                    AA[j] -= 1
        elif S[i] == 'b':
            if AA[i + 1] + BB[i + 1] - 1 < a + b and BB[i + 1] - 1 < b:
                print('Yes')
            else:
                print('No')
                for j in range(i + 1, N + 1):
                    BB[j] -= 1

        else:
            print('No')


resolve()

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, a, b = map(int, input().split())
    S = str(input())
    cnta=0
    cntb=0

    for i in range(N):
        if S[i] == 'a':
            if cnta + cntb < a + b:
                print('Yes')
                cnta+=1
            else:
                print('No')
        elif S[i] == 'b':
            if cnta + cntb < a + b and cntb < b:
                print('Yes')
                cntb+=1
            else:
                print('No')

        else:
            print('No')


resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():

    N=int(input())
    A=list(map(int,input().split()))
    ls=[0]*N
    for i in range(N):
        ls[i]=(i,A[i]-1)
    cnt=0
    for (s,t) in ls:
        if (t,s) in ls:
            cnt+=1
    print(cnt//2)



resolve()

Fixed submission:
def resolve():

    N=int(input())
    A=list(map(int,input().split()))
    cnt=0
    for i in range(N):
        if A[A[i]-1]==i+1:
            cnt+=1
    print(cnt//2)



resolve()

Buggy python submission (verdict: Time Limit Exceeded):

def resolve():

    N=int(input())
    A=list(map(int,input().split()))
    ls=[]
    for i in range(N):
        ls.append((i,A[i]-1))
    cnt=0
    for (s,t) in ls:
        if (t,s) in ls:
            cnt+=1
    print(cnt//2)



resolve()

Fixed submission:
def resolve():

    N=int(input())
    A=list(map(int,input().split()))
    cnt=0
    for i in range(N):
        if A[A[i]-1]==i+1:
            cnt+=1
    print(cnt//2)



resolve()
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    a=list(input())
    K=int(input())
    for i in range(len(a)):
        val=123-ord(a[i])
        if val<=K:
            a[i]='a'
            K-=val
        if i==len(a)-1 and K>0:
            a[-1]=chr(ord(a[-1])+K)
    print(''.join(a))



resolve()

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    a = list(input())
    K = int(input())
    for i in range(len(a)):
        if a[i]=='a' and i!=len(a)-1:
            continue
        else:
            val = 123 - ord(a[i])
            if val <= K:
                a[i] = 'a'
                K -= val
            if i == len(a) - 1 and K > 0:
                a[-1] = chr(ord(a[-1]) + K % 26)
    print(''.join(a))


resolve()
Buggy python submission (verdict: Runtime Error):
n = list(input())
m = sum(n)
if m % 9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = list(input())
x = 0
for i in range(len(n)):
    x += int(n[i])
if x % 9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0] * 12
for i in range(11,0,-1):
    m = n // 26 ** i
    a[i] = m
    n -= m * (26 ** i)
a[0] = n
for i in range(11, - 1, - 1):
    if a[i] == 0:
        a.pop(i)
    else:
        break
b = "abcdefghijklmnopqrstuvwxyz"
c = []
for i in range(len(a)):
    if a[i] == 0:
        a[i] = 26
        a[i + 1] -= 1
    c.append(b[a[i] - 1])
c.reverse()
print(*c, sep="")

Fixed submission:
n = int(input())
a = [0] * 12
for i in range(11,0,-1):
    m = n // 26 ** i
    a[i] = m
    n -= m * (26 ** i)
a[0] = n
for i in range(11, - 1, - 1):
    if a[i] == 0:
        a.pop(i)
    else:
        break
b = "abcdefghijklmnopqrstuvwxyz"
c = []
for i in range(len(a)):
    if i == len(a) - 1 and a[i] == 0:
        break
    elif i != len(a) - 1 and a[i] == 0:
        a[i] = 26
        a[i + 1] -= 1
    elif i != len(a) - 1 and a[i] == - 1:
        a[i] = 25
        a[i + 1] -= 1
    c.append(b[a[i] - 1])
c.reverse()
print(*c, sep="")
Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
m = max(1, n - b)
c = 0
for i in range(n, m, - 1):
    d = (a * i) // b - a * (i // b)
    if d >= c:
        c = d
print(c)

Fixed submission:
a, b, n = map(int, input().split())
if n <= b - 1:
    print((a * n) // b - a * (n // b))
else:
    print((a * (b - 1)) // b - a * ((b - 1) // b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
c = 0
for i in range(n):
    s = input()
    if s not in l:
        l.append(s)
        c += 1
print(c)

Fixed submission:
n = int(input())
l = [input() for _ in range(n)]
a = set(l)
print(len(a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
print(a.count(1))
b = []
for i in range(2, n + 1):
    if i not in b:
        print(a.count(i))
        b.append(i)
    else:
        print(0)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
b = [0] * n
for i in a:
    b[i - 1] += 1
for i in b:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import math

import math
from functools import reduce

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

k = int(input())
c = 0
for i in range(k):
    for j in range(k):
        for l in range(k):
            c += gcd(i + 1, j + 1, l + 1)
print(c)

Fixed submission:
import math

m = int(input())
a = (m * (m + 1)) // 2
b = 0
c = 0
for i in range(m):
    for j in range(i + 1, m):
        b += math.gcd(i + 1, j + 1)
for i in range(m):
    for j in range(i + 1, m):
        l = math.gcd(i + 1, j + 1)
        for k in range(j + 1, m):
            c += math.gcd(l, k + 1)
print(a + b * 6 + c * 6)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
r = list()
for i in range(n):
    if s[i] == "R":
        r.append(i)
b = list()
for i in range(n):
    if s[i] == "B":
        b.append(i)
g = list()
for i in range(n):
    if s[i] == "G":
        g.append(i)
a = len(r) * len(b) * len(g)
for i in r:
    for j in b:
        k = abs(i - j)
        if i + k in g:
            a -= 1
        if i - k in g:
            a -= 1
        if j + k in g:
            a -= 1
        if j - k in g:
            a -= 1
        if (i + j) / 2 in g:
            a -= 1
print(a)

Fixed submission:
n = int(input())
s = input()
r = set()
g = set()
b = set()
for i in range(n):
    if s[i] == "R":
        r.add(i)
    if s[i] == "G":
        g.add(i)
    if s[i] == "B":
        b.add(i)
a = len(r) * len(b) * len(g)
for i in r:
    for j in b:
        k = abs(i - j)
        if i + k in g:
            a -= 1
        if i - k in g:
            a -= 1
        if j + k in g:
            a -= 1
        if j - k in g:
            a -= 1
        if (i + j) / 2 in g:
            a -= 1
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
c = 0
for i in range(n):
    for j in range(i, n):
        if s[i] == s[j]:
            continue
        for k in range(j, n):
            if s[i] == s[k] or s[j] == s[k]:
                continue
            elif (j + 1) - (i + 1) != (k + 1) - (j + 1):
                c += 1
print(c)

Fixed submission:
n = int(input())
s = input()
r = set()
g = set()
b = set()
for i in range(n):
    if s[i] == "R":
        r.add(i)
    if s[i] == "G":
        g.add(i)
    if s[i] == "B":
        b.add(i)
a = len(r) * len(b) * len(g)
for i in r:
    for j in b:
        k = abs(i - j)
        if i + k in g:
            a -= 1
        if i - k in g:
            a -= 1
        if j + k in g:
            a -= 1
        if j - k in g:
            a -= 1
        if (i + j) / 2 in g:
            a -= 1
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
c = 0
for i in range(n):
    for j in range(i, n):
        for k in range(j, n):
            if s[i] != s[j] and s[j] != s[k] and s[i] != s[k] and (j + 1) - (i + 1) != (k + 1) - (j + 1):
                c += 1
print(c)


Fixed submission:
n = int(input())
s = input()
r = set()
g = set()
b = set()
for i in range(n):
    if s[i] == "R":
        r.add(i)
    if s[i] == "G":
        g.add(i)
    if s[i] == "B":
        b.add(i)
a = len(r) * len(b) * len(g)
for i in r:
    for j in b:
        k = abs(i - j)
        if i + k in g:
            a -= 1
        if i - k in g:
            a -= 1
        if j + k in g:
            a -= 1
        if j - k in g:
            a -= 1
        if (i + j) / 2 in g:
            a -= 1
print(a)
Buggy python submission (verdict: Runtime Error):
l = input()
print(l/3 ** 3)

Fixed submission:
l = int(input())
print((l/3) ** 3)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
b = {}
c = set()
for i in a:
    if i not in b:
        b[i] = 1
    else:
        b[i] += 1
        c.add(i)
for i in range(n):
    b[a[i]] -= 1
    x = 0
    for j in c:
        x += (b[j] * (b[j] - 1)) // 2
    print(x)
    b[a[i]] += 1

Fixed submission:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    b = {}
    c = set()
    for i in a:
        if i not in b:
            b[i] = 1
        else:
            b[i] += 1
            c.add(i)
    d = 0
    for i in c:
        d += (b[i] * (b[i] - 1)) // 2
    for i in range(n):
        e = d - ((b[a[i]] * (b[a[i]] - 1)) // 2) + (((b[a[i]] - 1) * (b[a[i]] - 2)) // 2)
        print(e)

main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
b = set(a)
for i in range(n):
    c = a[: i] + a[i + 1 :]
    d = 0
    for j in b:
        e = c.count(j)
        d += (e * (e - 1)) // 2
    print(d)

Fixed submission:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    b = {}
    c = set()
    for i in a:
        if i not in b:
            b[i] = 1
        else:
            b[i] += 1
            c.add(i)
    d = 0
    for i in c:
        d += (b[i] * (b[i] - 1)) // 2
    for i in range(n):
        e = d - ((b[a[i]] * (b[a[i]] - 1)) // 2) + (((b[a[i]] - 1) * (b[a[i]] - 2)) // 2)
        print(e)

main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
x = 0
for i in a:
    b = a.pop(0)
    if b in a:
        x += 1
        break
if x == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
n = int(input())
a = input().split()
d = dict()
for i in a:
    d[i] = 0
if len(d) == len(a):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
for i in range(k):
    h.remove(max(h))
print(sum(h))

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
h.sort(reverse = True)
del h[0:k]
print(sum(h))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split();print("YNeos"[n>m::2])

Fixed submission:
n,m=map(int,input().split());print("YNeos"[n>m::2])