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:
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
			else:
				count=count
	if count==0:
		print('YES')
	else:
		print('NO')
main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = 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
    if flag:
        break

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

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

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

Submission status: Time Limit Exceeded

Solution code:
hoge = int(input())
n = list(map(int,input().split()))
ans = "YES"
count = 0

for i in n :
    
    for j in n :
        if i == j :
            count += 1
    
    if count >= 2 :
        ans = "NO"
    
    count = 0

print(ans)

Submission status: Time Limit Exceeded

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

count = 0
list00 = []
for i in range(0,n):
  if a[i] in list00:
    count = count
  else:
    count = count + 1
    list00.append(a[i])
if count == n:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
import sys

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

As.sort()
for i in range(N):
    for j in range(i + 1, N):
        if As[i] == As[j]:
            print('NO')
            sys.exit(0)
        if As[i] > As[j]:
            break

print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Ai = list(map(int, input().split()))
Distinct = 0
for x in range(N-1):
    if Ai[x] in Ai[x+1:]:
        Distinct += 1

if Distinct == 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 range(0,n-1):
    for j in range(i+1,n):
        if A[i]==A[j]:
            print("NO")
            break
    else:
        continue
    break
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
li=input().split()
Ans=True

for i in range(N):
    for j in range(N):
        if i<=j:
            pass
        else:
            if li[i]==li[j]:
                Ans=False
                break
            else:
                pass

if Ans==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 a:
    if a.count(i)-1:
        print('NO')
        exit()
print('YES')

Submission status: Time Limit Exceeded

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

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def check_all_distinct(A):
  for idx, character in enumerate(A):
    if character in A[idx+1:]: return "NO"
  return "YES"


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

Submission status: Time Limit Exceeded

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

x = "YES"
k = 0
for i in l:
  k += 1
  for j in l[k:]:
    if i == j:
      x = "NO"
      break

print(x)

Submission status: Time Limit Exceeded

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

for nn in range(n - 1, 0, -1):
  t = li.pop(nn)
  if li.count(t) != 0:
    print('NO')
    exit()
print('YES')

Submission status: Time Limit Exceeded

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

def unique(arry):
  for item in arry:
    if arry.count(item) > 1:
      return False
  return True

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
###########　入力
# 整数の入力
N = int(input())
A = input().split()
output = "YES"
isAllUnique = True

for i in range(N):
    for k in range(i+1, N-i):
        if A[i] == A[k]:
            isAllUnique = False
            break

if isAllUnique == False:
    output = "NO"


###########　出力
print(output)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(len(list)):
  n=list[i]
  if(list.count(n)!=1):
    print("NO")
    break
  if(i==len(list)-1):
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
As = [int(num) for num in input().split(' ')]

no_same_val = True

for Ai in As:
	if As.count(Ai) > 1:
		no_same_val=False
      
if no_same_val:
	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==1):
        break

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

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(n):
        if i!=j:
            if l[i]==l[j]:
                tester=False
                break
            
if tester==True:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
def onlya(n , a):

    ans = "YES"

    for i in range(n):
        for w in range(i + 1 , n):
            if a[i] == a[w]:
                return "NO"

    return ans

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(onlya(n , a))

if __name__ == '__main__':
    main()

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):
    for b in A[i+1:]:
        if a==b:
            print("NO")
            sys.exit(0)
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 = [int(i) for i in input().split()]
f = 0
for i in A:
    if A.count(i) > 1:
        f = 1 
        
if f > 0:
    print("NO")
else:
 print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num = list(map(int,input().split()))
count = 0

for i in range(n):
    if num.count(num[i]) > 1:
        print('NO')
        break
    else:
        count += 1
        continue

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 1
i_before = a[0]
for i in a[1:]:
    ans *= (i - i_before)
    i_before=i

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
aa=0
for i in range(n):
    if a.count(a[i])!=1:
        print('NO')
        aa+=1
        break
if aa==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 = False

for i, number in enumerate(numbers):
  for j in numbers[i+1:]:
    if j == number:
      noBool = True
      break

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = input().split()
t = True
new = []
for el in l:
    if el not in new:
        new.append(el)
    else: 
        print("NO")
        exit(0)
print("YES")

Submission status: Time Limit Exceeded

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

for i in range(N):
    for j in range(N):
        if H[i] ==H[j] and i!=j:
            Ans = "NO"
    
print(Ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
LawInput =input().split()
Alist = []
yesCount = 0

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

for n in range(len(Alist)):
    if Alist.count(Alist[n]) >= 2:
        yesCount = yesCount + 1

if yesCount >= 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])!=1:
    c=c+1
if c==0:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(N):
    for j in range(i+1, N):
        if seq[i] == seq[j]:
            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()))

res = "YES"
lt = []
for i in range(n):
    if a[i] in lt:
        res = "NO"
        break
    else:
        lt.append(a[i])
print(res)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

s = input().split(" ")

judge = False

for i in range(N):

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

  if judge == True:
    break

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

Submission status: Time Limit Exceeded

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

du = False
for i in range(n):
    for j in range(n):
        if a[i] == a[j] and i != j:
            du = True
print('YES' if not du else 'NO')

Submission status: Time Limit Exceeded

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

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


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys

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

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

print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = [int(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())
l = input().split()
t = True
new = []
for el in l:
    if el not in new:
        new.append(el)
    else: 
        print("NO")
        t = False
if t:
    print("YES")

Submission status: Time Limit Exceeded

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

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

print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=input().split()
li=[]
a=map(int,input().split())
flag=0

for i in a:
    if i in li:
        print("NO")
        flag=1
        break
    else:
        li.append(i)

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

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
li = input().split()
ans = "YES"
for i in li:
    if li.count(i) > 1:
        ans = "NO"
        break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b = list(map(int, input().split(" ")))
flag = True
for i in b:
  if (b.count(i) >= 2):
    flag = False

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

checklist = {}

for item in alist:
    if alist.count(item) > 1:
        print('NO')
        exit(0)

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")
		exit()

print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys

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

for item in d:
  if d.count(item) > 1:
    print("NO")
    sys.exit()

print("YES")

Submission status: Time Limit Exceeded

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

flag = 1
for i in range(N-1):
  for j in range(i+1,N):
    if A[i] == A[j]:
      flag = 0
      break
  if flag == 0:
    break
if flag == 1:	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):
    for j in range(i + 1, n):
        if(a[i] == a[j]):
            flag = True
            break

    if(flag):
        break

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

Submission status: Time Limit Exceeded

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

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

print(flg)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
list_len = int(input())
integer_list = tuple(map(int, input().split()))
for i in range(list_len - 1):
    if integer_list[i] in integer_list[i+1:]:
        print('NO')
        break
else:
    print('YES')

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()

    for x, y in list(combinations(A, 2)):
        if x == y:
            print("NO")
            sys.exit()

    print("YES")


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

cnt=0
for i in range(n):
    for j in range(i+1,n):
        if l[i] == l[j]:
            cnt += 1
    else:
        continue

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

Submission status: Time Limit Exceeded

Solution code:
_ = input()
_list = input()
 
num_list = _list.split(' ')
 
for num in num_list:
  if num_list.count(num) > 1:
    print('NO')
    break
else:
  print('YES')

Submission status: Time Limit Exceeded

Solution code:
a = int(input())

s = input().split()
d = len(s)

for i in range(d-1):
  for f in range(i+1, d):
    if s[i] == s[f]:
      print("NO")
      break
  else:
    continue
  break
else:
  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")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

for i in range(N):
    for j in range(N):
        if i<=j:
            pass
        else:
            if li[i]==li[j]:
                Ans=False
                break
            else:
                pass

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

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

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

Submission status: Time Limit Exceeded

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

l = []
ans = 'YES'
for i in a:
    if (i in l) != True:
        l.append(i)
    else:
        ans = 'NO'

print(ans)

Submission status: Time Limit Exceeded

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

for i in range(0, 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 = list(map(int, input().split()))
ans = 'YES'
cheacked = []

for i in a_list:
    if i in cheacked:
        ans = 'NO'
        break
    else:
        cheacked.append(i)
        
print(ans)

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
    b.append(a[i])


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()))
b = []
for i in a:
    if i in b:
        print('NO')
        sys.exit()
    else:
        b.append(i)
print('YES')

Submission status: Time Limit Exceeded

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

for i in range(n):
  if a.count(a[i]) > 1:
    print('NO')
    sys.exit()

print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

tmp = ""

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

print("YES")

Submission status: Time Limit Exceeded

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

d = 'YES'

for i in range(n):
  if a[i:].count(a[i]) > 1:
    d = 'NO'
    break

print(d)

Submission status: Time Limit Exceeded

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

answer = 'YES'
for i in range(N):
    c = A.count(A[i])
    if c >= 2:
        answer = 'NO'
        break

print(answer)

Submission status: Time Limit Exceeded

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

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

print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys

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

for i, num in enumerate(As):
    tmp = As.copy()
    del tmp[i]
    if num in tmp:
        print('NO')
        sys.exit(0)

print('YES')

Submission status: Time Limit Exceeded

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

def dup(listOfElems):
    for elem in listOfElems:
            if listOfElems.count(elem) > 1:
                return True
    return False

du = dup(a)
print('YES' if not du else 'NO')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
k = 0
A =input().split()
i = 1
k = 0
for a in A:
    if a in A[i:]:
        k = 1
        break
    else:
        i+=1
        pass
if k == 0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
num=int(input())

nums=input().split()
cnt=0
for i in range(num):
    for f in range(num):
        if i!=f and nums[i]==nums[f]:
            cnt+=1
if cnt==0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

frag = False

for i in range(n):
  for j in range(n):
    if i != j and a[i] == a[j]:
      frag = True
if frag:
  print("NO")
else:
  print("YES")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(e) for e in input().split()]
flag = False
for i in range(0,n):
    for j in range(0,n):
        if i != j and a[i] == a[j]:
            flag = True
            break
if flag:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

result = "YES"
for i in range(0, N-1):
  for j in range(i+1, N):
    if A_list[i] == A_list[j]:
      result = "NO"
      break
  if result == "NO":
    break

print(result)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
a_ = []
flag = 0

for aa in a:
    if aa not in a_:
        a_.append(aa)
    else:
        flag = 1
        break

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

Submission status: Time Limit Exceeded

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

for a in A:
    if not a in check:
        check.append(a)
    else:
        print('NO')
        break
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()

print("YES")

Submission status: Time Limit Exceeded

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

for i in range(n-1) :
    b = a[1:]
    if a[0] in b :
        c = 'NO'
        break
    else :
        a = b.copy()
print(c)

Submission status: Time Limit Exceeded

Solution code:
N,A=int(input()),list(map(int,input().split()))
b=[]
for i in A:
    if i in b:
        print("NO")
        exit()
    b.append(i)
print("YES")

Submission status: Time Limit Exceeded

Solution code:
def onlya(n , a):

    ans = "YES"

    for i in range(n):
        if a.count(a[i]) != 1:
            return "NO"

    return ans

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(onlya(n , a))

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

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

for i in range(len(A)):
    a = A[i]
    for aa in A[i+1:]:
        if aa == a:
            print('NO')
            sys.exit()

print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = input()
lst = input().split()
isTrue = True

for i in lst:
  if lst.count(i) > 1:
    print('NO')
    isTrue = False
    break

if isTrue == True:
  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()))

d = 'YES'

for i in range(n):
  if a.count(a[i]) > 1:
    d = 'NO'
    break

print(d)

Submission status: Time Limit Exceeded

Solution code:
n = input()
nums = list(input().split(' '))
if [x for x in set(nums) if nums.count(x) > 1]:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import math
import itertools
n = int(input())
#n, d = list(input().split())
A = list(map(int, input().split()))
check = [0]
for i in range(n):
    if A[i] in check:
        print("NO")
        exit()
    
    check.append(A[i])

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)):
    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 = list(map(int, input().split()))
already = []
ans = 'YES'
for a in A:
    if a in already:
        ans = 'NO'
        break
    else:
        already.append(a)
print(ans)

Submission status: Time Limit Exceeded

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

ans = 'YES'
for i in range(n):
    for j in range(i+1,n):
        if a[i] == a[j]:
            ans = 'NO'



print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_lis = list(map(int, input().split()))
n_a = []
for a in a_lis:
    if a in n_a:
        print('NO')
        exit()
    n_a.append(a)
print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int, input().split()))
is_yes = True
for i, a_i in enumerate(a):
  for j, a_j in enumerate(a[i+1:]):
    if a_i == a_j:
      is_yes = False
      break
if is_yes:
  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(len(A)-1):
    if A[i+1:].count(A[i]) > 0:
        print ('NO')
        exit (0)
print ('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

checklist = []

for item in alist:
    if item not in checklist:
        checklist.append(item)
    else:
        print('NO')
        exit(0)

print('YES')

Submission status: Time Limit Exceeded

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

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 itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
a = LIST()

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

def hoge(a):
    for i in range(n):
        for j in range(i+1, n):
            if a[i]==a[j]:
                return "NO"
    return "YES"

print(hoge(a))

Submission status: Time Limit Exceeded

Solution code:
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
def worstdata():
    a=0
    return a
#solution:
def comp(x,y):
    dp=[0,max(act[0])]*(N+1) #[i]日目のActivity で得られる最大幸福量
    
    return 0

#input
n,=(pin())
S=list(pin())

c=[]
cond=0
for i in range(len(S)):
    if S[i] in c:
        cond=1
        break
    c.append(S[i])
#print(solution(H,N))
print(["NO","YES"][1-cond])