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: Time Limit Exceeded

Solution code:
N = int(input())
num_list = list(map(int, input().split()))
for i in num_list:
  count = num_list.count(i)
  if count >= 2:
    print('NO')
    exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
for _ in range(2,n+1):
  if a[_-1] in a[:_-1]:
    print('NO')
    exit()
print('YES')

Submission status: Time Limit Exceeded

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

ans = True
for i in range(n-1):
    for j in range(i+1,n):
        if a[j]==a[i]:
            ans = False
            break
        else:
            continue
if ans==True:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
count = int(input())

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

for i in range(count):
    if (ls.count(ls[i]) > 1):
        print('NO')
        exit(0)

print('YES')

Submission status: Time Limit Exceeded

Solution code:
import itertools
n = int(input())
a = list(map(int,input().split()))
v = itertools.combinations(a,2)
for item in v:
    if item[0] == item[1]:
        print('NO')
        exit()
print('YES')

Submission status: Time Limit Exceeded

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

for v in itertools.combinations(a,2):
    if v[0] == v[1]:
        print('NO')
        exit()
print('YES')

Submission status: Time Limit Exceeded

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

isDiff = True
cache = [0] * n 

for i in range(n) :

    for j in range(n) :
        if i == j :
            continue

        if cache[j] == -1 :
            continue

        if a[i] == a[j] :
            isDiff = False
            break

    cache[i] = -1


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

Submission status: Time Limit Exceeded

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

isDiff = True

for i in range(n) :

    for j in range(n) :
        if i == j :
            continue

        if a[i] == a[j] :
            isDiff = False
            break

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

Submission status: Time Limit Exceeded

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

a = 0
for i in range(len(s)):
    if s.count(s[i]) > 1:
        a = 1
        break

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

Submission status: Time Limit Exceeded

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

count = 0
for i in range(N):
    for j in range(i+1, N):
        if A[i] == A[j]:
            count = count + 1
            print("NO")
            break

if count == 0:
    print("YES")

Submission status: Time Limit Exceeded

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

count = 0
for i in range(N):
    for j in range(i+1, N):
        if A[i] == A[j]:
            count = count + 1

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

Submission status: Time Limit Exceeded

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

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

if count == N:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
d = []
p = 0
for i in range(N):
    if A[i] in d:
        p = 1
        break
    d.append(A[i])
if p == 0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
input()

a=list(map(int, input().split())) #スペース区切りの数字をlistで取得

if int(len([i for i in a if a.count(i) >= 2])) !=0:
    print("NO")
else :
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
cnt = 0
for i in range(n):
	for j in range(n):
		if i != j and a[i] == a[j]:
			cnt += 1
			break
print(["NO","YES"][cnt==0])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num = list(map(int, input().split()))
ans = "YES"
lis = []
for i in num:
  if not i in lis:
    lis.append(i)
  else:
    ans="NO"
    break
    
print(ans)

Submission status: Time Limit Exceeded

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

result = True

# for char in A:
#     if(A.count(char) != 1):
#         result = False
#         break
for i in range(N):
    for j in range(i+1, N):
        # print("A[i]= "+str(A[i])+", A[j]= "+str(A[j]))
        if A[i] == A[j]:
            result = False

if (result == True):
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

result = True

for char in A:
    if(A.count(char) != 1):
        result = False
        break

if (result == True):
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

for i in range(N):
    count=A.count(A[i])
    if count != 1:
        print('NO')
        break

if count == 1:
    print('YES')

Submission status: Time Limit Exceeded

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

counter = 0
for i in range(N):
    for j in range(N):
        if A[i] == A[j]:
            counter += 1

#print(counter)
if counter > N:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
import collections

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

for i in a:
    if i not in s:
        s.appendleft(i)
    else:
        print("NO")
        exit()

print("YES")

Submission status: Time Limit Exceeded

Solution code:
#https://atcoder.jp/contests/abc154/tasks/abc154_c

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

for i in range(n):
    for j in range(n):
        if j<=i:
            continue
        if a[i]==a[j]:
            print("NO")
            exit()

print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
alist = list(map(int,input().split()))
p = 1
for i in range(N-1):
    for j in range(i+1,N):
        if alist[i] == alist[j]:
            p = p*0
            print('NO')
            break
if p == 1:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num = input().split()
 
def check():
  for s in num:
    if(num.count(s) >= 2):
      print("NO")
      return
  print("YES")

check()

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
list=[]
for i in a:
	if i in list:
		print("NO")
		break
	list.append(i)
else:
	print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
countalist = []
for i in a:
  countalist.append(a.count(i))
if max(countalist) >= 2:
  print('NO')
else:
  print('YES')

Submission status: Time Limit Exceeded

Solution code:
import sys
n = int(input())
ls = list(map(int,input().split()))
for i in range(len(ls)):
    if ls.count(ls[i]) > 1:
        print("NO")
        sys.exit()
    else:
        continue
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
ans = 'YES' 
for i in range(N):
    if A.count(A[i]) > 1:
        ans = 'NO'
        break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ls = list(map(int,input().split()))
a = 0
for i in range(len(ls)):
    if ls.count(ls[i]) > 1:
        a += 1
        break
    else:
        continue
if a > 0:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split(" ")))
deta = []
error = False

for i in range(n):
    if n == 0:
        pass
    elif error:
        break
    elif a[i] in deta:
        error = True
        break
    deta.append(a[i])
if error:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split(" ")))
deta=[]
error=False
    
for i in range(n):
    if len(deta)==0:
        pass
    elif error:
        break
    elif a[i] in deta:
        error=True
    deta.append(a[i])
if error:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    for j in range(i+1, n):
        if a[i] == a[j]:
             print("NO")
             exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=input().split()
S=[int(a) for a in A]
n=0
NN=[]
for b in S:
    if not b in NN:
        NN.append(b)
if len(NN)==N:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
s=0
for i in a:
  if i not in b:
    b.append(i)
  else:
    s=s+1
print('YES' if s==0 else 'NO')

Submission status: Time Limit Exceeded

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

cnt=0
for i in range(n-1):
    for j in range(i+1,n):
        if s[i]==s[j]:
            print('NO')
            exit()
        else:
            cnt+=1
if cnt==n*(n-1)//2:            
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = True
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            flag = False
            break
    else:
        continue
    break

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

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

N = input()
A = list(map(int,input().split()))
flag = False
while 1:
    a = A[0]
    A = A[1:]
    if a in A:
        flag = True
        break
    if len(A) == 0:
        break


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

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

N = input()
A = list(map(int,input().split()))
li = []
flag = False
for a in A:
    if a in li:
        flag = True
        break
    else:
        li.append(a)
if flag:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  if a.count(a[i])>=2:
    ans=1
    break
if ans==1:
  print('NO')
else:
  print('YES')

Submission status: Time Limit Exceeded

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()

A = FLI()

flg = False
for a in A:
   if A.count(a) > 1:
      print("NO")
      exit()

print("YES")

Submission status: Time Limit Exceeded

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()

A = FLI()

cnt = Counter(A)
flg = False
for a in A:
   if A.count(a) > 1:
      flg = True

if not flg:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=list(map(int,input().split()))
p=0
for i in range(N-1):
	for j in range(i+1,N):
		if a[i]==a[j]:
			p=1
if p==0:
	print('YES')
else:
	print('NO')

Submission status: Time Limit Exceeded

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

s=0
for i in range(N-1):
    if a[i] in a[i+1:N]:
        s += 1
if s == 0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

s=0
for i in range(N-1):
    for j in range(i+1,N):
        if a[i]==a[j]:
            s += 1
print('YES' if s==0 else 'NO')

Submission status: Time Limit Exceeded

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

s=0
for i in range(N-1):
    for j in range(i+1,N):
        if a[i]==a[j]:
            s += 1
if s == 0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if A.count(a) != 1:
        print("NO")
        exit()

print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
for i in range (N):
  for j in range (i+1,N):
    if A[i]==A[j]:
      print('NO')
      exit()
      
print('YES')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import sys
n =int(input())
a =list(map(int ,input().split()))
for i in range(n):
    for j in range(n):
        if  i !=j:
            if a[i] ==a[j]:
                print("NO")
                sys.exit()
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
num=[]
count=0
x=[]

b=input().split(" ")
for i in range(n):
    x.append(b[i])
for i in range(n):
    if x[i] in num:
        count=1
        break
    else:
        num.append(x[i])
if count==1:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=len(a)
s=0
for i in range(l):
  for j in range(l):
    if i!=j:
      if a[i]!=a[j]:
        s+=1
if s==n*(n-1):
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
import sys
N = int(input())

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

numbers = []
for i in range(N):
    if a[i] not in numbers:
        numbers.append(a[i])
    elif a[i] in numbers:
        print('NO')
        sys.exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
def main():
        num = int(input())
        list_num = list(map(int, input().split()))
        flag = False
        for i,v in enumerate(list_num):
                if v in list_num[i+1:]:
                        flag = True
                        break

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

if __name__ == "__main__":
        main()

Submission status: Time Limit Exceeded

Solution code:
import os

def main():
	num = int(input())
	list_num = list(map(int, input().split()))
	flag = False
	for i,v in enumerate(list_num):
		if v in list_num[i+1:]:
			flag = True
			break

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

if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b =input().split()
count=0
for i in range(a):
    if b.count(b[i])==1:
        count += 1
if count == len(b):
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
#C
#入力
N=int(input())
A=list(map(int,input().split()))

#処理
t=0
for i in range(len(A)):
    if A[i] in A[:i]+A[i+1:]:
        print("NO")
        t=1
        break
if t==0:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = list(map(int,input().split()))
count = 0
for i in range(n):
    if li.count(li[i]) >= 2:
        print("NO")
        break
    else:
        count += 1
if count == n:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N= int(input())

A=list(input().split())

flag=1
for i in range(N-1):
  if A.count(A[i])>1:
    flag=0
if flag==1:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lis = list(input().split())
for i in lis:
    if lis.count(i) > 1:
        print("NO")
        exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lis = list(input().split())
#print(N,lis)
con = 0
jud = 0
for i in lis:
    con +=1
    #print(i)
    for n in lis[con:]:
        if i == n:
            jud += 1
if jud > 0:
    print("NO")
else:
	print("YES")

Submission status: Time Limit Exceeded

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

l=[]
dup=False
for e in A:
    if e in l:
        dup=True
        break
    else:
        l.append(e)

if dup==False:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

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

print("YES")

Submission status: Time Limit Exceeded

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

ans=True
for i in range(n):
	for k in range(i+1,n):
		if a[i]==a[k]:
			ans=False

print("YES" if ans else "NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
flag = False
for i in range(n-1):
    for j in range (i+1,n):
        if a[i] == a[j]:
            flag = True
            break
print('YES' if flag == False else 'NO')

Submission status: Time Limit Exceeded

Solution code:
b = input()
l = list(map(int, input().split()))
plus = 0
for i in range (len(l)-1):
	v = l[0]
	l.pop(0)
	if l.count(v)>0:
		plus += 1
        
if plus > 0:
  	print('NO')
else:
	print('YES')

Submission status: Time Limit Exceeded

Solution code:
b = input()
l = list(map(int, input().split()))
plus = 0
for i in range (len(l)-1):
	if l.count(l[i])>1:
		plus += 1
        
if plus > 0:
  	print('NO')
else:
	print('YES')

Submission status: Time Limit Exceeded

Solution code:
b = input()
l = list(map(int, input().split()))
plus = 0
a = len(l)-1
for i in range (a):
	if l.count(l[i])>1:
		plus += 1
        
if plus > 0:
  	print('NO')
else:
	print('YES')

Submission status: Time Limit Exceeded

Solution code:
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")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))
p = "YES"

for i in range(n):
    if 1 < l.count(l[i]):
        p = "NO"
        break
    
print(p)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))
p = "YES"

for i in range(n):
    for j in range(n-i-1):
        if l[i] == l[i+1+j]:
            p = "NO"
    
print(p)

Submission status: Time Limit Exceeded

Solution code:
import sys

n=int(input())

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

for i in range(len(a)-1):

  if a.count(a[i])>=2:
    print("NO")
    sys.exit()

print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys

n=int(input())

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

for i in range(len(a)-1):
  for j in range(i+1,len(a)):

    if a[i]==a[j]:
      print("NO")
      sys.exit()

print("YES")

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[int(i) for i in input().split(" ")]
memo=[]
for a in A:
    if a in memo:
        print("NO")
        break
    else:
        memo+=[a]
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
n = input().split(" ")
sama = False
if N == len(n):
    i = 0
    for angka in n:
        i += 1
        if angka in n[i:]:
            print("NO")
            sama = True
            break
    if not sama:
        print("YES")
else:
    print("invalid")

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
li = list(map(int,input().split()))
for i in range(len(li)):
    for k in range(len(li)):
        if i > k:
            if li[i] == li[k]:
                print('NO')
                exit()
    if i == len(li) -1:
        print('YES')

Submission status: Time Limit Exceeded

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


for a in A:
    if A.count(a)>1:
        print('NO')
        break
else :
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(input().split())
while A!=[]:
    a = A.pop()
    if a in A:
        print('NO')
        exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(input().split())
while A!=[]:
    a = A.pop()
    if A.count(a) > 0:
        print('NO')
        exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    if A.count(A[i]) > 1:
        print('NO')
        exit()
print('YES')

Submission status: Time Limit Exceeded

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

i = 0
while i < n:
  j = i+1
  while j < n:
    if a_list[i] == a_list[j]:
      print("NO")
      exit()
    j += 1
  i += 1

print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int, input().split()))
for i in b:
    if b.count(i)==1:
        continue
    elif b.count(i)>1:
        print('NO')
        break
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
sum=0
for k in range(0,len(a)):
  if a.count(a[k])>1:
    sum=sum+1
if sum==0:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

flag = True

for b in a:
    if a.count(b) >= 2:
        flag = False
        break


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

Submission status: Time Limit Exceeded

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

flag = True

for b in a:
    if a.count(b) >= 2:
        flag = False


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

Submission status: Time Limit Exceeded

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

flag = True

for i in range(n):
    for j in range(n):
        if i != j and a[i] == a[j]:
            flag = False

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

Submission status: Time Limit Exceeded

Solution code:
numOp = int(input())
intList = list(map(int, input().split()))
mark = False


for i in range(numOp):
    if intList.count(intList[i]) != 1:
        mark = True
        print('NO')
        break
    else:
        mark = False

if not mark:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

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

for i in range(n):
    for j in range(i+1, n):
        if al[i] == al[j]:
            print('NO')
            exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
N=int( input() )
nums=list( map( int, input().split() ) ) 
flag=True
for i in range( N ):
  if nums[ i ] in nums[ i+1: ]:
    flag=False
    break
print("YES") if flag else print( "NO" )

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
lst = []
flug = True
for i in range(n):
    if a[i] in lst:
        flug = False
        break
    lst.append(a[i])
if flug: print("YES")
else: print("NO")

Submission status: Time Limit Exceeded

Solution code:
import sys
sys = sys.stdin.readline

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

for i in range(len(a)):
    for j in range(len(a)):
        if a[i] == a[j]:
            cnt += 1
        else:
            cnt += 0
            
if cnt == n:
	print('YES')
else:
	print('NO')

Submission status: Time Limit Exceeded

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

for i in range(len(a)):
    for j in range(len(a)):
        if a[i] == a[j]:
            cnt += 1
        else:
            cnt += 0
            
if cnt == n:
	print('YES')
else:
	print('NO')

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
line = [int(a) for a in input().split()]

for i in range(num):
    if line[i] in line[i+1:]:
        print('NO')
        break
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
import sys

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

for i in range(0, N, 1):
	for j in range(i + 1, N, 1):
		if A[i] == A[j]:
			print("NO")
			sys.exit(0)

print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys

def binary_search(li, item):
  low = 0
  high = len(li) - 1
  
  while low <= high:
    mid = (low + high) // 2
    guess = li[mid]
    if item == guess:
      return True
    if item < guess:
      high = mid-1
    else:
      low = mid+1
  return False

def main():
  input = sys.stdin.readline
  n = int(input())
  a_li = list(input().split())
  a_li = [int(s) for s in a_li]

  a_li.sort()
  for a in a_li:
    a_li.remove(a)
    if binary_search(a_li, a) == True:
      print("NO")
      sys.exit()
  print("YES")
  
if __name__ == "__main__":
  main()

Submission status: Time Limit Exceeded

Solution code:
import sys

def binary_search(li, item):
  low = 0
  high = len(li) - 1
  
  while low <= high:
    mid = (low + high) // 2
    guess = li[mid]
    if item == guess:
      return True
    if item < guess:
      high = mid-1
    else:
      low = mid+1
  return False

n = int(input())
a_li = list(map(int, input().split()))
a_li.sort()
for a in a_li:
  a_li.remove(a)
  if binary_search(a_li, a) == True:
    print("NO")
    sys.exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
import itertools

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

for i in itertools.combinations(A,2):
    if i[0]==i[1]:
        print("NO")
        break
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
for i in range(n):
  for j in range(i+1, n-i):
    if numbers[i] == numbers[j]:
      print("NO")
      exit()
else:
  print("YES")

Submission status: Time Limit Exceeded

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

count = 0
for i in A:
    for j in A[count+1:]:
        if i == j:
            print("NO")
            break
    else:
        count += 1
        continue
    break
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys
msg = sys.stdin.readlines()
a = []
for x in msg:
  a.append(x.replace('\n', ''))
arra = a[1].split(' ')
dump = []
res = 'YES'
for x in range(int(a[0])):
  if arra[x] in dump:
    res = 'NO'
    break
  dump.append(arra[x])
print(res)

Submission status: Time Limit Exceeded

Solution code:
import sys
msg = sys.stdin.readlines()
a = []
for x in msg:
  a.append(x.replace('\n', ''))
arra = a[1].split(' ')
dump = []
res = 'YES'
for x in range(int(a[0])):
  if arra[x] in dump:
    res = 'NO'
  dump.append(arra[x])
print(res)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
S=[]
ans=0
for x in range(N):
    if A[x] not in S:
        S.append(A[x])
        ans+=1
if ans==N:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int,input().split()))
for a in A:
  if A.count(a) != 1:
    print('NO')
    break
else:
  print('YES')

Submission status: Time Limit Exceeded

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

for i in A:
    C = A.count(i)
    if C > 1:
        flug = True

if flug == True:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

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

    for i in range(n):
        a = A.pop()
        if a in A:
            print('NO')
            return
    print('YES')


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
d=0
for i in range(n):
    if a.count(a[i])>=1.5:
        d=1
        break
if d==0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(N-1):
  for j in range(i+1,N):
    if A[i] == A[j]:
      count = count + 1
  
if count == 0:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))
ls = []
a = 0
for i in l:
    if i not in ls :
        ls.append(i)
        a += 1
    else :
        print('NO')
        break
if a == len(l):
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
result = "YES"
for i in range(N):
    for j in range(N-i-1):
        if(A[i]== A[i+j+1]):
            result = "NO"
print(result)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!

def judge(number):
    info = input()
    info = info.split()
    info_list = []
    for num in info:
        if not num in info_list:
            info_list.append(num)
    
    if number == len(info_list):
        print("YES")
    else:
        print("NO")
    

def main():
    leet_num = int(input())
    judge(leet_num)
    
if __name__ == "__main__":
    main()