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_list = list(map(int,input().split()))
bool_result = None

for i in range(N):
    for j in range(i+1,N):
        if (A_list[i] == A_list[j]): 
            bool_result = True
            break

if bool_result: print("NO")
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(N):
    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 = [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')
        else:
            C.append('YES')
if 'NO' in C :
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
ans = 'YES'
cheacked = {}

for i in a_list:
    if i in cheacked.keys():
        ans = 'NO'
        break
    else:
        cheacked[i] = 0
        
print(ans)

Submission status: Time Limit Exceeded

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

count = 0
memo = []

for i in range(N):
  if A[i] not in memo:
    count += 1
    memo.append(A[i])
if N == count:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
N = map(int,input())
A = list(map(int,input().split()))
dup = [i for i in set(A) if A.count(i) > 1]
print("NO" if dup else "YES")

Submission status: Time Limit Exceeded

Solution code:
num = input()
inp = input().split()
res = []
final = ""
tem = 0
for i in inp:
   tem = inp.count(i)
   res.append(tem)
   tem = 0
for i in res:
   if i >= 2:
      final = "NO"
      break
   else:
      final = "YES"
print(final)

Submission status: Time Limit Exceeded

Solution code:
import sys
N = int(input())
A = list(input().split())
flag = 0
for i in range(0, N):
    for j in range(0, N):
        if i!=j and A[i] == A[j]:
            flag = 1
if flag == 1:
    print("NO")
    sys.stdout.flush
else:
    print("YES")
    sys.stdout.flush

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 A[j]==A[i] and i!=j:
            flag=False
    
if flag:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

ls = [x for x in set(A) if A.count(x) > 1]

if len(ls)==0:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

    count = 0

    a_count = a.count

    for j in range(1, n):
        for i in range(j):
            if a_count(a[i]) >= 2:
                count += 1
                break

    if count >= 1:
        print('NO')
    else:
        print('YES')

if __name__ == '__main__':
    main()

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[j]
    count = 0
    for i in range(n):
        if a[i] == num:
            count += 1
    if count != 1:
        ans = 'NO'
        break
    count_all += count
    if count_all >= n:
        break

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

Submission status: Time Limit Exceeded

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

i=0
r="YES"

while(i<l):
  j=i+1
  while(j<l):
    if(list[i]==list[j]):
      r="NO"
    j+=1
  i+=1

print(r)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


for i in range(n):
	if a.count(a[i]) > 1 or a.count(a[-i]) > 1:
		print("NO")
		exit()

print("YES")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
li = list(map(int,input().split()))
c = 0

def make_divisors(n):
    yakusuu_array= []
    for i in range(1,n):
        if n % i == 0:
            yakusuu_array.append(i)
    
    return yakusuu_array


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

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

Submission status: Time Limit Exceeded

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

i=0
r="YES"

while(i<l):
  j=i
  while(j<l):
    if(i!=j):
      if(list[i]==list[j]):
        r="NO"
    j+=1
  i+=1

print(r)

Submission status: Time Limit Exceeded

Solution code:
count = int(input())
data = input().split(" ")
point = list()
for a in data:
    b=data.count(a)
    point.append(b)
if max(point)==1:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int,input().split(' ')))
c=0
for i in l:
    c+=l.count(i)
if(c<=len(l)):
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

for i in A:
    if A.count(i) >=2:
        ans = "NO"

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num_list = list(map(int, input().split()))
out = "YES"
for j in range(len(num_list)):
    for k in num_list[j + 1:]:
        out = "NO" if num_list[j] == k else out
print(out)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
l = list(map(int,input().split()))
a = 0
for i in l:
    if l.count(i) > 1:
        a = a+1
print('YES') if a == 0 else print('NO')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
num = list(map(int,input().split()))
for x in num:
    if num.count(x) > 1:
        print("NO")
        break
else:
    print("YES")

Submission status: Time Limit Exceeded

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

check = 'a'

check_3 = 0
for i in range(count):
    check_2 = 0
    for n in range(count):
        if check == number_li[i]:
            check_2 += 1    
        check = number_li[n]
    if check_2 > 1:
        check_3 = 1
        break

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

Submission status: Time Limit Exceeded

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

for i in A:
  c = 0
  for j in A:
    if(j == i):
      c += 1
    if(c > 1):
      print("NO")
      exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
def solve(n, a):
    for i in range(n - 1):
        for j in range(i + 1, n):
            if(a[i] == a[j]):
                return 'NO'

    return 'YES'

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

print(solve(n, a))

Submission status: Time Limit Exceeded

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

i=0
r="YES"

while(i<l):
  j=0
  while(j<l):
    if(i!=j):
      if(list[i]==list[j]):
        r="NO"
    j+=1
  i+=1

print(r)

Submission status: Time Limit Exceeded

Solution code:
num = input()
str_list = input().split(" ")
 
yes = True
 
for index, s in enumerate(str_list):
	if s in str_list[:index]:
		yes = False
		break
if yes:
	print("YES")
else:
	print("NO")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
i=int(input())
x=[int(x) for x in input().split()]
for i in x:
  if x.count(i)>1:
    c=0
    break
  else:
      c=1
if(c==1):
    print("YES")
elif(c==0):
    print("NO")

Submission status: Time Limit Exceeded

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

count = 0

for j in range(1,n):
    for i in range(j):
        if a.count(a[i]) >= 2:
            count += 1
            break

if count >= 1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

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

for i in a:
  c = a.count(i)
  
  if c >=2:
    print("NO")
    exit()
    
print("YES")

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

ans = "YES"

for i in range(len(a)):
  for j in range(i + 1, len(a)):
    if a[i] == a[j]:
      ans = "NO"

print (ans)

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
input()
words = [int(x) for x in input().split(" ")]
save = []
for w in words:
  if w in save:
    print("NO")
    exit()
  save.append(w)
print("YES")

Submission status: Time Limit Exceeded

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

for i in A:
    if A.count(i)>1:
        print('NO')
        exit()
    
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
            break
    else:
        if frg == 1:
            break
if frg == 1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
def solve():
    N = int(input())
    array = list(map(int, input().split()))
    for each in array:
        if array.count(each) > 1:
            print("NO")
            return
    print("YES")

solve()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = True
for i in range(n):
    tmp = a.pop(i)
    if tmp in a:
        flag = False
        break
    a.insert(i, tmp)
if flag:
   print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
N=input()
A=input().split()
if(sorted(set(A), key=A.index)==A):
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

for i in range(n):
    if flag:
        obj = List[i]
        for j in range(i+1, n - i):
            if obj == List[j]:
                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())) 
x=0
for j in range(len(A)):
    for i in range(len(A)):
        if(j!=i):
            if(A[j]==A[i]):
                x+=1
                break
                
if(x==0):
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:


if __name__ == "__main__":
    U = input()
    A = input().split()

    for i in A:
        if A.count(i) > 1:
            ret  = "NO"
            print(ret)
            exit(0)   
    ret = "YES"

    print(ret)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=[int(i) for i in input().split()]
c=[]
for i in range(a-1):
    for j in range(i+1,a):
        if b[i]==b[j]:
            c.append(1)
            break
if len(c)>0:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = input().split()
result = "YES"
for s in S:
    if S.count(s) > 1:
        result = "NO"
        break
print(result)

Submission status: Time Limit Exceeded

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

for i in range(N):
  c = 0
  for j in range(N):
    if(A[i] == A[j]):
      c += 1
    if(c > 1):
      print("NO")
      exit()
print("YES")

Submission status: Time Limit Exceeded

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

print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A =[]

hantei = True
tmp = input().split()

for i in range(N):
  tmp_int = int(tmp[i])
  if tmp_int in A:
    hantei = False
  A.append(tmp_int)
  

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

Submission status: Time Limit Exceeded

Solution code:
def check_all_distinct(A):
  already_seen_chars = list()
  for character in A:
    if character not in already_seen_chars:
      already_seen_chars.append(character)
    else: return "NO"
  return "YES"


if __name__ == "__main__":
  N = int(input())
  A = input().split()
  print(check_all_distinct(A))

Submission status: Time Limit Exceeded

Solution code:
count = 0
flag = 0

def merge(a, left, mid, right):
    global count
    L = [0] * (mid - left + 1)
    R = [0] * (right - mid + 1)

    for i in range(len(L)):
        if i  == len(L) - 1:
            L[i] = float('inf')
        else:
            L[i] = a[left+i]
    
    for i in range(len(R)):
        if i == len(R) - 1:
            R[i] = float('inf')
        else:
            R[i] = a[mid+i]

    i = 0
    j = 0
    for k in range(left, right):
        if L[i] <= R[j]:
            a[k] = L[i]
            i += 1
        else:
            if i != len(L) - 1 and j != len(R) - 1:
                count += len(L) - i - 1
            a[k] = R[j]
            j += 1

def mergeSort(a, left, right):
    if left+1 < right:
        mid = int((left + right) / 2)
        mergeSort(a, left, mid)
        mergeSort(a, mid, right)
        merge(a, left, mid, right)

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

mergeSort(a, 0, n)

for i in range(len(a)-1):
    x = a[i]
    y = a[i+1]

    if x == y:
        flag = 1
        break

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

Submission status: Time Limit Exceeded

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

while(len(A)!=0):
  if A.count(A[0]) >1:
    print("NO")
    exit(0)
  A.pop(0)
  
print("YES")

Submission status: Time Limit Exceeded

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

cnt=len(A) / 2

cnts = 0
isYes = True

for i in A:
    if A.count(i) > 1:
        isYes = False
        break
    else:
        isYes = True
 
    if cnts == cnt:
        isYes = True
        break
    cnts += 1

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

Submission status: Time Limit Exceeded

Solution code:
#At coder 2020/2/9 B

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

ans='YES'
for ii in range(N-1):
    for jj in range(ii+1,N):
        if A[ii]==A[jj]:
            ans='NO'
            break


print(ans)

Submission status: Time Limit Exceeded

Solution code:
input()
words = input().split(" ")
save = []
for w in words:
  if w in save:
    print("NO")
    exit()
  save.append(w)
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

NumArr = [int(num) for num in input().split()]

ans = 'YES'
for num in NumArr:
    matchCount = NumArr.count(num)
    if matchCount > 1:
        ans = 'NO'
        break

print(ans)

Submission status: Time Limit Exceeded

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

check = 0
i = 0
while i < N-1:
    a = numlist[i]
    j = i + 1
    while j < N:
        if a == numlist[j]:
            check = 1
            break
        j = j + 1
    i = i + 1

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
dup = [i for i in set(A) if A.count(i) > 1]
if not dup:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
first_int = int(input())
secound_list = [int(k) for k in input().split()]

for k in range(first_int):
  if secound_list.count(secound_list[k]) >= 2:
    print('NO')
    break
  if k == first_int-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)

    # divisors.sort()
    return divisors

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

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

Submission status: Time Limit Exceeded

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

for i in range(N):
    a = A.pop(0)
    if a in A:
        print("NO")
        break

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
A=[int(i) for i in input().split()]
for i in range(n):
    if A.count(A[i])!=1:
        print('NO')
        break
    elif i==n-1:
        print('YES')

Submission status: Time Limit Exceeded

Solution code:
times=int(input())
nums=[int(i) for i in input().split()]
judge=[]
for i in range(times-1):
    for j in range(i+1,times):
        if nums[i]==nums[j]:
            judge.append(0)
            
        else:
            judge.append(1)
            
if 0 in judge:
    print("NO")

else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
dup = [i for i in set(A) if A.count(i) > 1]
if dup:
  print("NO")
else:
  print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    
    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")
                return
    print("YES")

main()

Submission status: Time Limit Exceeded

Solution code:
#At coder 2020/2/9 B

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

ans='YES'
for ii in range(N-1):
    for jj in range(ii+1,N):
        if A[ii]==A[jj]:
            ans='NO'
            break
    if ans=='NO':
        break


print(ans)

Submission status: Time Limit Exceeded

Solution code:

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

for i in range(n):
    if a.count(a[i]) != 1:
        status = 1
        break
    else:
        pass

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

Submission status: Time Limit Exceeded

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()
    b = [INF]

    for i in range(N):
        if b[bisect_left(b, A[i])] == A[i]:
            print("NO")
            sys.exit()
        else:
            insort_left(b, A[i])

    print("YES")


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
  input()
  list = []
  result = 'YES'
  for value in input().split():
    if value in list:
      result = 'NO'
      break
    else:
      list.append(value)
  
  print(result)

main()

Submission status: Time Limit Exceeded

Solution code:
input()
words = input().split(" ")
for w in words:
  if words.count(w) >= 2:
    print("NO")
    exit()
print("YES")

Submission status: Time Limit Exceeded

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

cnt=len(A)

cnts = 0
isYes = True

for i in A:
    if A.count(i) > 1:
        isYes = False
        break
    else:
        isYes = True
 
    if cnts == cnt:
        isYes = False
        break
    cnts += 1

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = "YES"
S = list()
S.append(A[0])

for i in range(1,N):
    for j in range(len(S)):
        if A[i] == S[j]:
            ans = "NO"
    S.append(A[i])

print(ans)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
S   = input().split()
flag = 0

for  i in S:
    if S.count(i) == 2:
        flag = 1

if flag == 1:
    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-1):
  for j in range(i+1,n):
    if a[i]==a[j]:
      print("NO")
      quit()
print("YES")

Submission status: Time Limit Exceeded

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

for i in s:
  if s.count(i) == 2:
    flag = 1
    break
print("YES") if flag == 0 else print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def Count(n, lis):
    for i in lis:
        if lis.count(i) > 1:
            return 'NO'
    return 'YES'

num = int(input())
l = list(map(int,input().split()))
print(Count(num,l))

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)

    # divisors.sort()
    return divisors

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

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

Submission status: Time Limit Exceeded

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

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):
		for j in range(n):
			if i == j:
				count =count
			elif a[i]==a[j] :
				count+=1
				break
			else:
				count=count
	if count==0:
		print('YES')
	else:
		print('NO')
main()

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int, input().split()))
tester=True
for i in range(n):
    for j in range(i+1,n):  
        if l[i]==l[j]:
            tester=False
            break

if tester==True:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().strip().split()))
flg = 0
for i in range(n):
  for j in range(n):
    if i != j:
      if a[i] == a[j]:
        flg += 1

if flg >= 1:
  print("NO")
else:
  print("YES")

Submission status: Time Limit Exceeded

Solution code:
#At coder 2020/2/9 B

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

ans='YES'
for ii in range(N-1):
    for jj in range(ii+1,N):
        if A[ii]==A[jj]:
            ans='NO'

print(ans)

Submission status: Time Limit Exceeded

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

for j in range(len(A)):
    for i in range(len(A)):
        if(j!=i):
            if(A[j]==A[i]):
                x +=1
                pass
            pass
        pass
    pass

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

A = 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 == 1:
        break

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
LawInput =input().split()
Alist = []
YoN = True

for times in range(N):
    Alist.append(int(LawInput[times]))

for n in range(len(Alist)):
    if Alist.count(Alist[n]) >= 2:
        YoN = False

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

Submission status: Time Limit Exceeded

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

check = 0
i = 0
while i < N-1:
    j = i + 1
    while j < N:
        if numlist[i] == numlist[j]:
            check = 1
            break
        j = j + 1
    i = i + 1

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = input().split()
for el in l:
    if l.count(el) > 1:
        print("NO")
        exit(0)
print("YES")

Submission status: Time Limit Exceeded

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


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
A=list(input().split())
for i in range(n):
    if A.count(A[i])!=1:
        print('NO')
        break
    elif i==n-1:
        print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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


s = 0
for i in range(n):
  if a.count(a[i]) is not 1:
    s+=1
if s == 0:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

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

count = 0

for i in range(n):
    if a.count(a[i]) >= 2:
        count += 1
        break

if count >= 1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import sys
N = int(input())
A = [int(i) for i in input().split()]
for i,a in enumerate(A):
    if a in A[i+1:]:
        print("NO")
        sys.exit(0)
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(0)
print("YES")

Submission status: Time Limit Exceeded

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

sw = 0
for i in range(len(A_list)):
  for j in range(i+1, len(A_list)):
    if A_list[i] == A_list[j]:
      sw = 1
      break
if sw == 1:
  print('NO')
else:
  print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b = input().split()
c = 0
for i in range(len(b)-1):
    for j in range(i+1,len(b)):
        if b[i] == b[j]:
            print('NO')
            c = 1
            break
    if c == 1:
        break

if c == 0:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
numbers_row = input().split(" ")
numbers = []
for i in numbers_row:
  numbers.append(int(i))
  
noBool = "YES"
 
for i, number in enumerate(numbers):
  for j in numbers[i+1:]:
    if j == number:
      noBool = "NO"
      break
print(noBool)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

def answer(N, numb):
    for i in range(N):
        for j in range(N):
            if i <= j:
                continue

            if numb[i] == numb[j]:
                return "NO"

    return "YES"
 
print(answer(N,numb))

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(N):
    if (i == j):
      continue
    if (A[i] == A[j]):
      print("NO")
      exit()
print("YES")