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())
A = [int(x) for x in input().split()]

flag = True

while flag:
    for i in range(N-1):
        for j in range(i+1, N):
            if A[i] == A[j]:
                print('NO')     
                flag = False      
while flag:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
n = int(input())
A = stdin.readline().rstrip().split()
# print(A)
A_tmp = A
A_len = len(A)
# print('A_len = ' + str(A_len))
count = 0
# print('A_tmp = ' + str(A_tmp))
for x in A_tmp:
    # print(str(count) + '...' + str(x))
    A.pop(count)
    count += 1
    
    if(x in A):
        print('NO')
        break
    else:
        A.insert(count - 1, x)
        if count == A_len:
            print('YES')

Submission status: Time Limit Exceeded

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
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")
            sys.exit()
else:
    print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
for i in A:
    A = [j for j in A if j != i]
    if len(A) == N - 1:
        N -= 1
        continue
    else:
        print("NO")
        break
if N == 0:
    print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid -1
        else:
            low = mid + 1

    return None

ans = "YES"
for i in range(N):
    mylist = A[:i]
    mylist.extend(A[i+1:])
    mylist.sort
    if binary_search(mylist, A[i]) != None:
        ans = "NO"

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

c = [0]*n
flag = 0
c[0] = a[0]
for i in range(n):
  for j in range(i):
    if c[j] == a[i]:
      flag = 1
      break
  if flag == 1:
    break
  else:
    c[i] = a[i]

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

Submission status: Time Limit Exceeded

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

#print(n,a)

for f in range(n):
  
  for g in range(n):

    if g != f:
    	if a[f] == a[g]:
      		#print(a[f], a[g])
      		s = s+1
      
if s>0: print("NO")
else: print('YES')

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
N = input()
input_line = input()
Ai = input_line.split(" ")
Comment = "YES"
N = int(N)
for i in range(N):
  for j in range(i+1,N):
    if(Ai[i] == Ai[j]):
      Comment = "NO"
      break
      
print(Comment)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


flag = 0
for i in range(N):
    if flag !=0:
        break
    for j in range(i+1,N):
        # print("i",in_list[i],"j",in_list[j])

        if in_list[i]==in_list[j]:
            print("NO")
            flag =1
            break

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
suuretu = list(map(int,input().split()))
nn = frg = 0

while nn <= n-2:
    mm = nn+1
    while mm <= n-1:
        if suuretu[nn] == suuretu[mm]:
            frg = 1
            break
        else:
            mm +=1
    nn += 1
if frg == 1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
d1 = int(input())
d = input().split()
d2 = [int(x) for x in d]
count=0
for n in range(d1):

    for m in range(n+1,d1):
        if d2[n] == d2[m]:
            count+=1


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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np


class CountDigits():
    def __init__(self):
        self.digits_count = np.zeros(10 ** 9, dtype=np.int8)
        self.isUnique = True

    def check_unique(self, N, A):
        for i in A:
            self.digits_count[i] += 1
            if self.digits_count[i] > 1:
                self.isUnique = False
                break
        return


N = int(input())
A = [int(i) for i in input().split()]
count_digits = CountDigits()
count_digits.check_unique(N, A)
if count_digits.isUnique:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
lists = list(map(int, input().split()))
endflag = 0
for ind, n in enumerate(lists):
  if n in lists[ind + 1 :]:
    endflag = 1
    break
if endflag == 0:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
count=0
mainasu=0
num=int(input())
An=[int(i) for i in input().split()]

for i in An[0:num]:
    mainasu+=1
    for w in An[mainasu:]:
        
        if i==w:
            count=1
            break
    if count>=1:
        break
    
if 0==count:
    print("YES")
    
else :
    print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
i=0
t=0
while(i<=n-2):
  A=a[i]
  if a.count(A)>1:
    t=t+1
  i=i+1
if t==0:
  print("YES")  
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
N = input()
input_line = input()
Ai = input_line.split(" ")
Comment = "YES"
for i in range(int(N)):
  for j in range(i+1,int(N)):
    if(Ai[i] == Ai[j]):
      Comment = "NO"
      break
      
print(Comment)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=input().split()
def main():
  for i in range(n):
    if a.count(a[i])>1:
      return "NO"
  return "YES"
print(main())

Submission status: Time Limit Exceeded

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

num_count = input()
num_lists = input().split()
judge_flg ='YES'
for num_list in num_lists:
    if num_lists.count(num_list) > 1:
        judge_flg = 'NO'
        break
print(judge_flg)

Submission status: Time Limit Exceeded

Solution code:
d1 = int(input())
d = input().split()
d2 = [int(x) for x in d]
count=0
for n in range(d1):

    for m in range(d1):
        if d2[n] == d2[m]:
            if n != m:
                count+=1


if count!=2 :
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

s = input().split(" ")
judge = False

for i in range(N):
  if s[i+1:N].count(s[i]) > 0:
      judge = True

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
h=list(map(int,input().split()))
a = []
b = []
for i in range(0, len(h)):
    if h[i] in a:
        b.append('NO')
        break
    a.append(h[i])
if b != []:
    print(b[0])
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
i=0
t=0
while(i<=n-1):
  A=a[i]
  if a.count(A)>1:
    i=i+1
    t=t+1
  else:
    i=i+1
if t==0:
  print("YES")  
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
for i in A:
    if A.count(i) == 1:
        N -= 1
    else:
        break
if N == 0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = list(map(int, input().split()))
lst2 =[]
maxval2 = 0
flag = 0
maxval = max(lst)
for _ in range(n-1):
  lst.pop(lst.index(maxval))
  maxval2 = max(lst)
  if maxval == maxval2:
    print('NO')
    flag = 1
    break
  maxval = maxval2
if flag == 0:
  print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def buble_sort(list,ans):
    i=len(list)
    while(i>1):
        for j in range(i-1):
            if(list[j]<list[j+1]):
                list[j],list[j+1]=list[j+1],list[j]
            elif(list[j]==list[j+1]):
                ans="NO"
                return ans
            else:
                pass
        i-=1
    return ans

N=int(input())
A=list(map(int,input().split()))
ans="YES"
ans=buble_sort(A,ans)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
d1 = int(input())
d = input().split()
d2 = [int(x) for x in d]
count=0
for n in range(d1):

    for m in range(d1):
        if d2[n] == d2[m]:
            if n != m:
                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()))
flag = False
for i in range(N-1):
    j = i+1
    while(j<N):
        if A[i]==A[j]:
            flag = True
            break
        j += 1
    if flag:
        break
if flag:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
count=0
mainasu=0
num=int(input())
An=[int(i) for i in input().split()]
An_co=An
for i in An[0:num]:
    mainasu+=1
    An_co.pop(0)
    for w in An_co:
        
        if i==w:
            count=1
            break
    
if 0==count:
    print("YES")
    
else :
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
def main():
	n=int(input())
	a=list(map(int, input().split()))
	count=[0]*n
	while sum(count)==0:
		for i in range(n):
			count[i] = a.count(a[i])-1
	if sum(count)==0:
		print('YES')
	else:
		print('NO')
main()

Submission status: Time Limit Exceeded

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

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

l = []
isUnique = True
for i in range(len(A)):
    if A[i] in l:
        isUnique = False
        break
    l.append(A[i])

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
m=min(a)
M=max(a)
t=0
while(m<=M):
  if a.count(m)>1:
    t=t+1
  else:
    m=m+1
if t==0:
  print("YES")  
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
import sys

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

for i in range(N):
    x = A[i]
    for j in range(N-i-1):
        if x == A[i+j+1]:
            print('NO')
            sys.exit()

print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

s = input().split(" ")

judge = False

for i in range(N):

  if s.count(s[i]) > 1:
      judge = True
      break

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

Submission status: Time Limit Exceeded

Solution code:
def merge(array):
    mid = len(array)
    if mid > 1:
        mid = mid // 2
        left = merge(array[:mid])
        right = merge(array[mid:])
        array = []
        while len(left) != 0 and len(right) != 0:
            if left[0] == right[0]:
                print("NO")
                exit()
            elif left[0] < right[0]:
                array.append(left.pop(0))
            else:
                array.append(right.pop(0))
        if len(left) != 0:
            array.extend(left)
        elif len(right) != 0:
            array.extend(right)
    return array

n = int(input())
a = list(map(int, input().split()))
a.sort()
merge(a)
print("YES")

Submission status: Time Limit Exceeded

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

i=0
while(i<n):
  if(a[i] in a[i+1:]):
    print("NO")
    sys.exit()
  i += 1
print("YES")

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
li = list(map(int,input().split()))
c = 0
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)
    return divisors

for i in range(a-1):
    if len(list(set(li))) != len(li):
        c = 1
        break
    for j in range(i+1,a):
        x = make_divisors(li[j]*li[i])
        if len(x) != len(set(x)):
            c = 1
            break
    if c == 1:
        break

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

Submission status: Time Limit Exceeded

Solution code:
p=[input() for i in range(2)]
N=int(p[0])
A_1=list(map(int, p[1].split()))
A_2=list(map(int, p[1].split()))
judge=True
for a in A_1:
    del A_2[0]
    for b in A_2:
        if a==b:
            judge=False
            break
    else:
        continue
    break
if judge:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = []
A = input().split()
ans = 1

for x in range(N):
    for y in range(N):
        if(x == y):
            continue
        if(A[x] == A[y]):
            ans = 0
            break

if(ans == 1):
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

#入力
n = int(input())

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

result = 'YES'

#処理
for i in range(n):
    for j in range(n):
        if j == i:
            continue
        else:
            if A[i] == A[j]:
                result = 'NO'


#出力
print(result)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

flug = True
l = 0

for i in range(n-1):
    for j in range(n-1-l): 
        k = i+j+1
        flug = bool(s[i] == s[k])
        if flug == True:
            break

    if flug == True:
        break
    l += 1



if flug == False:
    print('YES')

elif flug == True:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
List = sorted(list(map(int, input().split())))
for i in range (N):
  for j in range (i+1, N):
    if List[j] == List[i]:
      print("NO")
      break
  else:
    continue
  break
else:
  print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=input().split()
def main():
  for i in range(n-1):
    for m in range(i+1,n-i):
      if a[i]==a[m]:
        return "NO"
  return "YES"
print(main())

Submission status: Time Limit Exceeded

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

ans = "YES"
for i in range(N):
    if A.count(A[i]) >= 2:
        ans = "NO"

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = list(map(int, input().split()))
lst2 = []
flag = 0
for _ in range(max(lst)):
  lst2.append(0)
for i in range(n):
  if lst2[lst[i]-1] == 0:
    lst2[lst[i]-1] += 1
  else:
    print('NO')
    flag = 1
    break
if flag == 0:
  print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
suuretu = list(map(int,input().split()))
nn = frg = 0
for nn in range(0,n-1):
    for mm in range(nn+1,n):
        if suuretu[nn] == suuretu[mm]:
            frg = 1
if frg == 1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
set = int(input())

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

v = 0

for i in range(set):
    for k in range(1 + i, set):
        #print()
        if lis[i] == lis[k]:
            v = 1
            
if v == 0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
import itertools

n = int(input())

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

comblist = list

flag = True

for i in range(0,n):
    for j in range(i+1,n):
        if alist[i] == alist[j]:
            #print(alist[i], alist[j])
            flag = False
            break
        if not flag:
            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 i in range(N):
    for j in range(i+1,N):
        if A[j]==A[i] :
            flag=False
            break
    if not flag:
        break
if flag:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
li = list(map(int,input().split()))
c = 0
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)
    return divisors

for i in range(a-1):
    if len(list(set(li))) != len(li):
        c = 1
        break
    for j in range(i+1,a):
        x = make_divisors(li[j]*li[i])
        if len(x) != len(set(x)):
            c = 1
            break

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

Submission status: Time Limit Exceeded

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

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

ans = ''
count_all = 0

for j in range(n):
    num = a[0]
    if len(a[a == num]) != 1:
        ans = 'NO'
        break
    a = np.delete(a, 0)
    
if ans == 'NO':
    print(ans)
else:
    print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b = input().split()
c = sorted(b)
x = 0
for i in range(a):
    for j in range(a - i - 1):
        if i != j:
            if int(c[i]) == int(c[j]):
                x = x + 1
if x == 0:
    if c[0] == c[1]:
        print("NO")
    else:
        print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    A = list(input().split())
    for i,a_1 in enumerate(A):
        if a_1 in A[i+1:]:
            print("NO")
            return
    print("YES")
    

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

L = []
F = 0

for i in range(N):
  if A[i] not in L:
    L.append(A[i])
  else:
    print('NO')
    F = 1
    break
    
if F == 0:
  print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

    return "YES"

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
m=min(a)
M=max(a)
t=0
while(m<=M):
  if a.count(m)>1:
    t=t+1
  else:
    t=t+0
  m=m+1
if t==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 index, a_item in enumerate(a):
    ab = a[index:].count(a_item)
    if ab >= 2:
        count += 1
        break

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
for j in range(N):
    for i in A:
        A.remove(i)
        if A.count(i) == 0:
            N -= 1
        else:
            print("NO")
            break
if N == 0:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys
a=int(input())
b=list(map(int,input().split()))

for i in range(a):
  for j in range(a):
    if i==j:
      pass
    else:
      
      if b[j]==b[i]:
        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")
		exit()
		
print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = "YES"
for i in range(2 ** N):
    bag = []
    #print("pattern {}: ".format(i), end="")
    for j in range(N):  
        if ((i >> j) & 1): 
            bag.append(A[j])
    if len(bag) > 1:
        if bag[0] in bag[1:]:
            ans = "NO"

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

L = []

for i in range(N):
  if A[i] not in L:
    L.append(A[i])
    if i == N-1:
      print('YES')
  else:
    print('NO')
    break

Submission status: Time Limit Exceeded

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

for idx,i in enumerate(A):
    for j in A[idx+1:]:
        if i==j:
            print('NO')
            exit()
    
print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

fl = "YES"
for i, a in enumerate(A):
  if a in A[i+1:]:
    fl = "NO"
    break

print(fl)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = input().split(" ")
b= []

flag = True
for i in range(N):

    if a[i] in b:
        flag = False
        break
    b.append(a[i])


if flag:
    print("YES")

else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = list(map(int, input().split()))
k = 1
flag = 0
for i in range(n):
  lst2 = list(map(lambda x: x-lst[i], lst))
  lst2.pop(i)
  for j in lst2:
    k *= j
  if k == 0:
    print('NO')
    flag = 1
    break
if flag == 0:
  print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

flag = True
for i in range(0,n-1):
    for j in range(i+1,n):
        if alist[i] == alist[j]:
            #print(alist[i], alist[j])
            flag = False
            break
        if not flag:
            break
if flag:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

s = input().split(" ")

judge = False

for i in range(N):

  if s.count(s[i]) > 1:
      judge = True

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = input().split(" ")
b= [0 for i in range(N)]

flag = True
for i in range(N):

    if a[i] in b:
        flag = False
        break
    b[i] =a[i]


if flag:
    print("YES")

else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ls = list(map(int, input().split()))
i = 0
while i < n:
    if ls.count(ls[i]) == 1:
        i += 1
    else:
        print("NO")
        break

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

Submission status: Time Limit Exceeded

Solution code:
count=0
mainasu=0
num=int(input())
An=[int(i) for i in input().split()]
for i in An:
    mainasu+=1
    
    for w in range(num-mainasu):
        
        if i==An[w+mainasu]:
            count=1
            break
    
if 0==count:
    print("YES")
    
else :
    print("NO")

Submission status: Time Limit Exceeded

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

fl = "YES"
for i, a in enumerate(A):
  if a in A[i+1:]:
    fl = "NO"
    break

print(fl)

Submission status: Time Limit Exceeded

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

while(len(A)!=0):
  buf=[A[0]]
  A.pop(0)
  buf2=list(set(A) & set(buf))
  if len(buf2)!=0:
    print("NO")
    exit(0)
  
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
for j in range(N):
    for i in A:
        A.remove(i)
        if A.count(i) == 0:
            N -= 1
            continue
        else:
            print("NO")
            break
if N == 0:
    print("YES")

Submission status: Time Limit Exceeded

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

def checkIn(a, n):
    return (a[0] in a[1:n])

b = False
while(n > 1):
    if(checkIn(a,n)):
        print("NO")
        b = True
        break
    else:
        pass
    a = a[1:n]
    n = n-1

if(not b):
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
C =[]
for i in A:
    count = 0
    for j in A:
        if i == j:
            count += 1
        if count == 2:
            C.append('NO')
            break
        else:
            C.append('YES')
if 'NO' in C :
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
def func():
    return

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

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

print("YES")

Submission status: Time Limit Exceeded

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

count = 'YES'
for i in range(max(List)):
    List = list(map(lambda x:x-1, List))
    if List.count(0) == 2:
        count = 'NO'

print(count)

Submission status: Time Limit Exceeded

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

def distinct(arry):
  while True:
    if len(arry) == 1:
      return True
    x = arry.pop(0)
    if x in arry:
      return False

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

Submission status: Time Limit Exceeded

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

check_2 = 0

for i in range(count):
    check = number_li[i]
    for n in range(count):
        if i == n:
            continue

        if check == number_li[n]:
            check_2 = 1
            break
    if check_2 == 1:
        break

if check_2 == 1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
S = int(input())
A = input()
z = ''
arr1 = [i for i in A.split(' ')]
for i in range(S):
	for j in range(i+1, S):
		if(arr1[i]==arr1[j]):
			z = 'NO'
			break
if(z=='NO'):
	print(z)
else:
	print('YES')

Submission status: Time Limit Exceeded

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

while(len(A)!=0):
  buf=[A[0]]
  A.pop(0)
  buf2=list(set(A) & set(buf))
  if len(buf2)!=0:
    print("NO")
    exit(0)
  
print("YES")