Problem:


Score : 300 points

Problem Statement

Given is a sequence of integers A_1, A_2, ..., A_N.
If its elements are pairwise distinct, print YES; otherwise, print NO.

Constraints

2 ≤ N ≤ 200000

1 ≤ A_i ≤ 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A_1 ... A_N

Output

If the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.

Sample Input 1

5
2 6 1 4 5

Sample Output 1

YES

The elements are pairwise distinct.

Sample Input 2

6
4 1 3 1 6 2

Sample Output 2

NO

The second and fourth elements are identical.

Sample Input 3

2
10000000 10000000

Sample Output 3

NO



Sample input:
5
2 6 1 4 5


Sample output:
YES

Submission status: Accepted

Solution code:
def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N=int(input())
A=list(map(int,input().split()))
A=quick_sort(A)
ans="YES"
if(len(A)>1):
    for i in range(len(A)):
        if(A[i-1]==A[i]):
            ans="NO"
            break
        else:
            pass
else:
    pass
print(ans)

Submission status: Accepted

Solution code:
a=int,input()
b=list(map(int,input().split()))
c=set(b)
d=len(b)
e=len(c)
if d==e:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = [int(i) for i in input().split()]
a = sorted(a)
dis = np.array(a[1:]) - np.array(a[:n-1])
if 0 in dis:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
n = int(input())
*l, = map(int, input().split())
def has_duplicates(seq):
    return len(seq) != len(set(seq))
S = has_duplicates(l)
if str(S) == 'False':
  print('YES')
elif str(S) == 'True':
  print('NO')

Submission status: Accepted

Solution code:
n = int(input()) 
li= input().split()
ali = list(set(li))
    
if len(li) - len(ali) == 0:
    print("YES")    
else:
    print("NO")

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
if len(a)==len(set(a)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import collections
n=int(input())
a=list(map(int,input().split()))
b=len(a)
c=collections.Counter(a)
e=len(c.values())
if b==e:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:

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

if len(seq) != len(set(seq)):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:

n = int(input())
num = [int(i) for i in input().split()]
if len(num) != len(set(num)):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N, = map(int, input().split())
X = set(map(int, input().split()))
if len(X) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
S = int(input())
AS = input().split()

uniq = list(filter(lambda x: x != ' ', set(AS)))
if len(uniq) == S:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
def has_no_duplicates(seq):
  return len(seq) == len(set(seq))

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

if has_no_duplicates(A):
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split(' ')))
l.sort()
c=0
for i in range(len(l)-1):
    if(l[i]==l[i+1]):
        c=1 
        break
if(c==0):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
sA = set(A)
if N == len(sA):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
AList = input().split(" ")
BList = set(AList)

if len(AList) == len(BList):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = list(input().split())
def has(s):
    return len(s) != len(set(s))
B = A
B = has(A) 
if B == False:
    print("YES")
    sys.stdout.flush
else:
    print("NO")
    sys.stdout.flush

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split(" ")))
b=a
b.sort()

flag = True
s =0
e =N-1
for i in range(N-1):
    if b[i] == b[i+1]:
        flag = False
        break
        



if flag:
    print("YES")

else:
    print("NO")

Submission status: Accepted

Solution code:
import numpy as np

number = int(input())
numbers = list(map(int, input().split()))

if np.unique(numbers).size == len(numbers):
    ans = "YES"
else:
    ans = "NO"

print(ans)

Submission status: Accepted

Solution code:
import collections

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


num = len(set(A))
if int(num) == int(N):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

n = int(input())
a = np.array(input().split(), dtype='int')

a_sort = np.sort(a)
ans = ''

for i in range(n - 1):
    if a_sort[i] == a_sort[i + 1]:
        ans = 'NO'
        break
    
if ans == 'NO':
    print(ans)
else:
    print('YES')

Submission status: Accepted

Solution code:
n = input()

arr = input().split()


def distinct(arr):
    n = len(arr)
    s = set()
    for i in range(0, n):
        s.add(arr[i])

    return len(s) == len(arr)


if distinct(arr):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys

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

if len(A) == len(set(A)):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = input().split()
b = set(a)
if len(b)<len(a):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())
li = sorted(list(map(int, input().split())))

for i in range(N-1):
    if li[i] == li[i+1]:
        print('NO')
        break
    elif i == N-2:
        print('YES')

Submission status: Accepted

Solution code:
N = input()
A = [x for x in input().split()]
if len(A) == len(set(A)):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n=int(input())  #数値入力 「N」だけの入力のとき
a=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
f = 0
if len(a) != len(set(a)):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = {}
flag = 0

for i in A:
    if (ans.get(i) != None):
        flag = 1
        break
    else:
        ans[i] = 1

if (flag == 0):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a_bef = list(map(int, input().split()))
ans = 'YES'
a_aft = sorted(a_bef)
for i in range(n-1):
   if a_aft[i] == a_aft[i+1]:
      ans = 'NO'
      break
print(ans)

Submission status: Accepted

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

def distinct(arry):
  x = set(arry)
  if len(A) != len(x):
    return False
  return True

if distinct(A):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = map(int, input())
A = list(map(int ,input().split(' ')))
print('YES') if len(set(A))==len(A) else print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

a.sort()

for i in range(n-1):
    if a[i] == a[i+1]:
        print('NO')
        exit()

print('YES')

Submission status: Accepted

Solution code:
def hantei(n,data):
    data.sort()
    for x in range(n-1):
        if data[x] == data[x+1]:
                return "NO"
    return "YES"

n = int(input())
data = [int(x) for x in input().split()]

print(hantei(n,data))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
a=int(input())
li = list(map(int,input().split()))
c = 0
if len(li) != len(set(li)):
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
n = int(input())
a_n = sorted(input().split())
print('YES' if len(set(a_n)) == n else 'NO')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    input()
    A = map(int, input().split())
    sorted_a = sorted(A)
    former = 0
    for a in sorted_a:
        if a == former:
            print("NO")
            return
        else:
            former = a

    print("YES")


main()

Submission status: Accepted

Solution code:
n = int(input())
tmp = input().split()
length = len(tmp)
length2 = len(list(set(tmp)))
if length == length2 :
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
seq = input().split()
 
if len(seq) != len(set(seq)):
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))

Hlen = len(H)


Hsyugou = set(H)
Hhennkann = list(Hsyugou)
Hhennkannlen = len(Hhennkann)




if Hlen ==Hhennkannlen:
    print("YES")

else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
ls = list(map(int, input().split()))

def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    # ここで分割を行う
    left = arr[:mid]
    right = arr[mid:]

    # 再帰的に分割を行う
    left = merge_sort(left)
    right = merge_sort(right)

    # returnが返ってきたら、結合を行い、結合したものを次に渡す
    return merge(left, right)


def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

a = merge_sort(ls)
i = 0
while i < n-1:
    if a[i] == a[i+1]:
        print("NO")
        break
    else:
        i += 1

if i == n-1:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = input().split(" ")
b = set(a)
if len(b)<len(a):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
count = int(input())
number_li = input().split(' ')
number_set = set(number_li)

list_len = len(number_li)
set_len = len(number_set)

if list_len == set_len:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
tmp = 0
flag = True
for i in range(n):
    if a[i] == tmp:
        flag = False
        break
    tmp = a[i]

if flag:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    if len(A) == len(set(A)):
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
List = list(map(int, input().split()))

List.sort()
count = 'YES'
for i in range(N-1):
    if List[i] == List[i+1]:
        count = 'NO'
        
print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
SET_A = set(A)
if len(A)==len(SET_A):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
X = list((int(x) for x in input().split()))
if len(X) == len(set(X)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N=int(input())
A=map(int, input().split())

input_array = []

for x in A:
  input_array.append(x)

set_array = set(input_array)
  
if(len(input_array) == len(set_array)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n=int(input())
List=list(map(int, input().split()))

if len(List) == len(set(List)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans={}
flag=0

for i in A:
    if(ans.get(i)!=None):
        flag=1
        break
    else:
        ans[i]=1
        
if(flag==0):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(input().split())
A = sorted(A)
c = 0
for i in range(N-1):
  if A[i] == A[i+1]:
    c += 1
    break
  else:
    c += 0
if c == 1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
import sys
n = int(sys.stdin.readline())
a = set(map(int, sys.stdin.readline().split()))
if len(a)==n:
  ans = "YES"
else:
  ans = "NO"
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
B = sorted(A)
NO = False
for i in range(0,len(B)-1):
    if B[i+1] - B[i] == 0:
        NO = True
if NO == True:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
import heapq

N = int(input())
A = list(int(x) for x in input().split())
heapq.heapify(A)
com1 = heapq.heappop(A)
ans = True

for _ in range(N-1):
    com2 = heapq.heappop(A)

    if com1 == com2:
        ans = False
        break

    com1 = com2

if ans:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N=int(input())
A = set(list(map(int,input().split())))
if len(A) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
M = list(set(L))
if len(L) == len(M):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = set(a)

if len(a) == len(s):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
def has_duplicates(seq):
    return len(seq) != len(set(seq))

N =input()
A =input().split()
# print(has_duplicates(A))

if has_duplicates(A):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
s=len(a)
t=len(set(a))
if s==t:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split(' ')))

A.sort()
b = 0
flag = False
for a in A:
    if a == b:
        flag=True
        break
    else:
        b = a

if flag:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
old=-1
flag=True
for a in A:
    if a==old:
        flag=False
        break
    old=a
if flag:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
if n == len(set(a)):
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int, input().split()))
a.sort()
c=0
for i in range(n-1):
    if a[i]==a[i+1]:
        c+=1
        break
if c==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a = int(input())
b = input().split()
set_b = set(b)
if len(set_b)==len(b):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
List = list(map(int, input().split()))

def ha(st):
    return len(st) != len(set(st))

if ha(List):
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

if len(set(A))==len(A):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
k = 0
A =[int(a) for a in input().split()]
A.sort()
A = np.array(A)
AC = [0]*n
AC = np.array(AC)
AC[1:] =A[:n-1]
AA = A - AC
if 0 in AA:
    print("NO")
elif A[n-2] == A[n-1]:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

set_A = set(A)


if len(A) == len(set_A):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
inputed = input().split()
MySet = set(inputed)
if len(MySet) == n : print("YES") 
else: print("NO")

Submission status: Accepted

Solution code:
import sys
N = input()
A = input().split()
D = {}
for a in A:
    if a  in D:
        print('NO')
        sys.exit()
    else:
        D[a] = True
print('YES')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int, input().split()))
if len(set(a))==n:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
B = list(set(A))
if len(A) == len(B):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())

L = list(map(int, input().split()))

if len(L) == len(set(L)):
  	print("YES")
else:
  	print("NO")

Submission status: Accepted

Solution code:
n = int(input())
A = input().split(' ')

if len(A) == len(set(A)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import sys
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
b = {}
d = True
for x in a:
  if x in b:
    d = False
    print("NO")
    break
  else:
    b[x] = 1

if d:
  print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(' ')))
s = set(a)

if n == len(s):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = set(A)
if N == len(B):
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

A.sort()
flag = "YES"
for i in range(N-1):
  if A[i] == A[i+1]:
    flag = "NO"
    break

print(flag)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A_set = set(A)

if( len(A) == len(A_set)):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
def has_duplicates(seq):
    return len(seq) != len(set(seq))

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

if has_duplicates(a) == False:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n= int(input())
a=list(map(int,input().split()))
if(n ==len(set(a))):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
s_a = set(a)

if n == len(s_a):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import math
import fractions

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

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans

#a = list(map(int, input().split()))

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

a.sort()

ans = "YES"
for i in range(n-1):
    if(a[i] == a[i+1]):
        ans ="NO"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a =  list(map(int, input().split()))
if len(set(a)) == n:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split(' ')))

    is_break = False
    seen = set()
    for a in A:
        if a not in seen:
            seen.add(a)
        else:
            is_break = True
            break
    
    if is_break:
        print("NO")
    else:
        print("YES")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 文字列の入力
a = int(input())
li = list(map(int, input().split()))
li2 = []

for i in range(a):
    li2.append(li[i])

if len(li2) != len(set(li2)):
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
import collections

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

count = collections.Counter(A)

s = "YES"

for v in count.values():
    if v >= 2:
        s = "NO"
        break

print(s)

Submission status: Accepted

Solution code:
N = input()
a_list = list(map(int, input().split()))

if str(len(list(set(a_list)))) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
flag = 1
A.sort()

for i in range(N-1):
	if A[i] == A[i+1]:
		flag = 0
		break
if flag==0:
	print('NO')
elif flag==1:
	print('YES')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = set(A)
if len(A)==len(B):
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
a= int(input())
l = list(map(int,input().split()))
b  = set(l)
# print(a,b)
if a == len(b):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

if len(a) == len(set(a)):
  print('YES')
  
else:
  print('NO')

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))

count = Counter(A)
memo = []

for v in count.values():
  if v >= 2:
    print("NO")
    exit()
else:
  print("YES")

Submission status: Accepted

Solution code:
l=int(input())
list = list(map(int, input().split()))

def has_duplicates(seq):
    return len(seq) != len(set(seq))

r=has_duplicates(list)

if(str(r)=="False"):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(N: int, A: "List[int]"):
    print(YES if len(set(A)) == len(A) else NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
if len(a) != len(set(a)):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = sorted(list(str(i) for i in input().split()))

for i in range(n-1):
    if a[i]==a[i+1]:
        print("NO")
        break
else:
    print("YES")

Submission status: Accepted

Solution code:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")

Submission status: Accepted

Solution code:
N = int(input())
A = []
A = input().split()
A = [int(i) for i in A]

#print('N = ', N)
#print('A = ', A)

A.sort()
#print('sortA = ', A)

count = 0

for i in range(N-1):
  if A[i] == A[i+1]:
    count += 1
    break

if count > 0:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
n = int(input())
arr = [int(n) for n in input().split()]
_set = set()
for i in range(0, n):
    _set.add(arr[i])
print("YES") if len(_set) == len(arr) else print("NO")

Submission status: Accepted

Solution code:
n = input()
a = list(map(int,input().split()))

if len(a) == len(set(a)):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = input()
A = input().split()
if int(N) == len(set(A)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import collections
n=int(input())
A = list(map(int, input().split()))
c=collections.Counter(A)
if len(c)==len(A):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
num_list = list(map(int, input().split()))
out = "YES" if len(num_list) == len(set(num_list)) else "NO"
print(out)

Submission status: Accepted

Solution code:


n = 0
a = []

def format_input(filename = None):
	global n
	global a
	if filename == None:
		n = list(map(int, input().split())).pop()
		a = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(2, 2 * 10**5)
		a = [rng(1, 10**9) for i in range(n)]

def get_answer():
	answer = "YES"
	sorted_a = sorted(a)

	memo = [0, sorted_a.pop()]
	while answer == "YES" and len(sorted_a) > 0:
		memo[0] = memo[1]
		memo[1] = sorted_a.pop()
		if memo[0] == memo[1]:
			answer = "NO"

	return answer

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

Submission status: Accepted

Solution code:
#154 c
n=int(input())
a=list(map(int,input().split()))
num=set(a)
if len(a)==len(num):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n=int(input())
a=list(input().split())

cnt = set(a)
if n == int(len(cnt)):
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
num = input()
inp = input().split()
len1 = len(inp)
out = set(inp)
len2 = len(out)
if len1 == len2:
   print("YES")
else:
   print("NO")

Submission status: Accepted

Solution code:
n = input()
N = int(n)
a = input().split()
A = list(map(int, a))

b = set(A)
B = list(map(int, b))

if len(A) == len(B):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import collections

N = int(input())
S = list(map(int, input().split()))
C = collections.Counter(S)
X = list(C.values())
Z  =''
for i in range(N):
    if X[i] == 1:
        Z = 'YES'
        continue
    elif X[i] != 1:
        Z = 'NO'
        break
print (Z)

Submission status: Accepted

Solution code:
N = input()
A = input().split()
lists = list(A)
def has_duplicates(seq):
    return len(seq) != len(set(seq))
if str(has_duplicates(lists)) == "False":
     print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

if len(a) == len(set(a)):
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:

# 入力、宣言
intLen=int(input())
intList=sorted(list(map(int,input().split())))

result="YES"

# 処理
# 対象項目と次の項目を比較
for i in range(len(intList)-1):
    if intList[i]==intList[i+1]:
        result="NO"

# 出力
print(result)

Submission status: Accepted

Solution code:
def duplicates(seq):
    return len(seq) != len(set(seq))
n = int(input())
a = list(map(int, input().split()))
if duplicates(a) == False:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
numbers = list(map(int,input().split()))
numbers = set(numbers)
if N == len(numbers):
    print('YES')
else :
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()));
a.sort();


for i in range(n-1):
    if(a[i]==a[i+1]):
        print('NO')
        exit()
print('YES')

Submission status: Accepted

Solution code:
N,A=int(input()),list(map(int,input().split()))
A=sorted(A,key=int)
l=set([])
for i in A:
    if i in l:
        print("NO")
        exit()
    else:
        l.add(i)
print("YES")

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = Counter(map(int, input().split()))
A = A.values()
for a in A:
    if a != 1:
        print("NO")
        exit()
print("YES")

Submission status: Accepted

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

A.sort()

isSame = False

for i in range(N - 1):
  if A[i] == A[i + 1]:
    isSame = True
    break
if isSame:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
# C - Distinct or Not

N = int(input())
A = list(map(int, input().split(' ')))
A.sort()
S = list(set(A))
if len(A) == len(S):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
length = int(input())
unique = len(list(set(input().split())))
#print(length, unique)
if length == unique:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
a = int(input())
b = input().split()
mydict = {}
for i in range(len(b)):
    mydict[b[i]] = 1

if len(mydict) == a:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
t=0
q="YES"
for x in a:
  if t==x:
    q="NO"
    break
  t=x
print(q)

Submission status: Accepted

Solution code:
num = int(input())
l = list(map(int,input().split()))
print('NO') if len(l) != len(set(l)) else print('YES')

Submission status: Accepted

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

if len(A)==len(set(A)):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n=int(input())
*H, = map(int, input().split())
def has_duplicates(seq):
    return len(seq) != len(set(seq))
if has_duplicates(H) == False:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
list_a = list(map(int, input().split()))
set_a = set(list_a)

if len(set_a) == len(list_a):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

if len(set(a)) == n:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
len1 = int(input())
len2 = len(set(input().split(" ")))
if len1 == len2:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = set([int(i) for i in input().split()])

if len(A) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
num = input()
str_list = input().split(" ")
 
yes = True
num_dict = {}
for s in str_list:
	if s in num_dict:
		yes = False
		break
	else:
		num_dict[s] = 1
if yes:
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	a = int(input())
	al = list(IN())
	set_l=set(al)
	if len(set_l) == a:
		print('YES')
	else:
		print('NO')

	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
N = input()

A = input().split()

N = int(N)
a = len(set(A))

if N==a:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
 
 
def main():
  n = int(input())
  x = set(map(int, input().split()))
  length = len(x)
  if n == length:
    print('YES')
  else:
    print('NO')
  
 
if __name__ == '__main__':
  main()