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 = input()
l = list(map(int,input().split()))
answer =[]
for i in range(len(l)):
    for j in range(i+1, len(l)):
        if l[i] == l[j]:
            answer.append("NO")
            break
        else:
            continue
if len(answer)==0:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import hashlib
import math

class BloomFilter:

    def __init__(self, num_item, false_positive):
        assert 0 <= false_positive <= 1
        # Optimal number of bit array size and hash function
        # https://en.wikipedia.org/wiki/Bloom_filter#Optimal_number_of_hash_functions
        log2 = math.log(2)
        logp = math.log(false_positive)
        size = - num_item * logp / (log2 * log2)
        num_hash = size / num_item * log2

        self.size = int(math.ceil(size))
        self.num_hash = int(math.ceil(num_hash))

        self.array = self.BitArray(self.size)
        self.hash_functions = [self.HashFunction(i, self.size)
                               for i in range(self.num_hash)]

    def add(self, item):
        for hash_func in self.hash_functions:
            i = hash_func(item)
            self.array[i] = True

    def __contains__(self, item):
        return self.contains(item)

    def contains(self, item):
        for hash_func in self.hash_functions:
            i = hash_func(item)
            if self.array[i] is False:
                return False
        return True

    class BitArray:

        def __init__(self, length):
            # Allocate an object per a bit for simplicity
            self.array = [False for _ in range(length)]

        def __getitem__(self, index):
            return self.get(index)

        def get(self, index):
            return self.array[index]

        def __setitem__(self, index, bit):
            return self.set(index, bit)

        def set(self, index, bit):
            if bit > 0 or bit is True:
                self.array[index] = True
            else:
                self.array[index] = False

    class HashFunction:

        def __init__(self, seed, maximum):
            self.seed = seed.to_bytes(
                seed.bit_length() // 8 + 1, byteorder='big')
            self.maximum = maximum

        def __call__(self, byte_buffer):
            return self.call(byte_buffer)

        def call(self, byte_buffer):
            # MD5 is enough because I don't want to oneway hash function
            b = hashlib.md5(byte_buffer + self.seed).digest()
            i = int.from_bytes(b, byteorder='big', signed=False)
            return i % self.maximum

N = int(input())
L = list(map(int,input().split()))
bf = BloomFilter(num_item=5 * 10 ** 5, false_positive=0.01)

for i in L:
    I = str(i).encode()
    if I in bf:
        print("NO")
        quit()
    bf.add(I)
print("YES")

Submission status: Time Limit Exceeded

Solution code:
def main():
    a = int(input())
    A = list(map(int, input().split()))
    N = 10000
    L = [[]] * N
    for i in A:
        if i in L[(i + 5555) % N]:
            return "NO"
        L[i % N].append(i)
    return "YES"


if __name__ == "__main__":
    print(main())

Submission status: Time Limit Exceeded

Solution code:
def main():
    a = int(input())
    A = list(map(int, input().split()))
    N = 10000
    L = [[]] * N
    for i in A:
        if i in L[i % N]:
            return "NO"
        L[i % N].append(i)
    return "YES"


if __name__ == "__main__":
    print(main())

Submission status: Time Limit Exceeded

Solution code:
def chk(nums):
  for i in range(n):
    for ii in range(n):
      if i != ii and nums[i] == nums[ii]: return False
  return True
n = int(input())
s = list(map(int, input().split()))
if chk(s) == True: print('YES')
else: print('NO')

Submission status: Time Limit Exceeded

Solution code:
import sys  
n=int(input())
l= input().split()
leng=len(l)
flag="YES"

for i in range(leng):
  #print(i)
  for ii in range(i+1, leng):
    #print(l[i],l[ii])
    if l[i] == l[ii]:
      flag="NO"
      print(flag)
      sys.exit()
    else:
      continue

print(flag)

Submission status: Time Limit Exceeded

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

for i in range(N):
  if listn[i] in listn[i+1:]:
    moji = "NO"
    break
  else:
    continue
print(moji)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

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

flag=False

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

Submission status: Time Limit Exceeded

Solution code:
def lol(n, arr):
    for i in range(0,n):
        for x in range(0,n):
            if arr[i] == arr[x] and i != x:
                return "NO"
    return "YES"

n = int(input())
x = input()
arr = x.split()
print(lol(n, arr))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A_list = list(map(int, input().split(' ')))
for i in range(N):
    A = A_list.pop(0)
    if A in A_list:
        print('NO')
        exit()
    else:
        A_list.append(A)
print('YES')

Submission status: Time Limit Exceeded

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

S = 0
for i in range(N):
    S = S + li.index(li[i])

if S == N*(N-1)/2:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

S = 0
for i in range(N):
    for j in range(N):
        if li[i] == li[j]:
            S = S + 1
        else:
            S = S

if S == N:
    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(len(A)):
  for k in range(i + 1, len(A)):
      if A[i] == A[k]:
        flag = False
        break
if flag:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
x = int(input(""))
l = list()
flag = 0
temp= [int(x) for x in input().split()]
for i in range(0, x):
     
    if temp[i] in l:
        flag = 1
    if temp[i] not in l:
        l.append(temp[i])
if flag == 1:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

def solve(N: int, A: "List[int]"):
    for i in range(0,N):
        if (A[i] in A[i+1:]):
            print(NO)
            return

    print(YES)


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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(n):
    if a_lst.count(a_lst[i])!=1:
        print('NO')
        break
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:

A = []
N = input()
A = input().split()

jod = 0
lengs = len(A)
for i in range(lengs):
    for j in range(i+1,lengs):
        if A[i]==A[j]:
            jod = 1
            break
    if jod == 1:
        break

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

Submission status: Time Limit Exceeded

Solution code:
def contraction(A):
    lengs = len(A)
    for i in range(lengs):
        for j in range(i+1,lengs):
            if A[i]==A[j]:
                return 1
    return 0

A = []
N = input()
A = input().split()

jod = contraction(A)
if jod==1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

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

if count == len(a) :
  print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
dup = [x for x in set(a) if a.count(x) > 1]
if len(dup) == 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[0])>=2:
    print("NO")
    a=1
    break
  else:
    del A[0]

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

Submission status: Time Limit Exceeded

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

a=0
i=-1
j=0
while True:
  i+=1
  if A.count(A[i])>=2:
    print("NO")
    a=1
    break
  else:
    A.remove(A[i])
    j+=1
    i-=1
    if j==N:
      break

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

Submission status: Time Limit Exceeded

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

def hash(a):
    return a%100


def check(A):
    for i in range(len(A)):
        for j in range(i, len(A)):
            if(j+1 < len(A)):
                if(A[i] == A[j+1]):
                    # print("%d=%d"%(A[i], A[j]))
                    flag = True
                    return 'NO'

    return 'YES'

arr = [[] for i in range(100)]

for i in A:
    arr[hash(i)].append(i)

for i in arr:
    flag = False
    if(check(i) == "NO"):
        print("NO")
        flag = True
        break
if(not flag):
    print("YES")

Submission status: Time Limit Exceeded

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

def hash(a):
    return a%10


def check(A):
    for i in range(len(A)):
        for j in range(i, len(A)):
            if(j+1 < len(A)):
                if(A[i] == A[j+1]):
                    # print("%d=%d"%(A[i], A[j]))
                    flag = True
                    return 'NO'

    return 'YES'

arr = [[] for i in range(10)]

for i in A:
    arr[hash(i)].append(i)

for i in arr:
    flag = False
    if(check(i) == "NO"):
        print("NO")
        flag = True
        break
if(not flag):
    print("YES")

Submission status: Time Limit Exceeded

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

flag = False
for i in range(len(A)):
    for j in range(i, len(A)):
        if(j+1 < len(A)):
            if(A[i] == A[j+1]):
                #print("%d=%d"%(A[i], A[j]))
                print("NO")
                flag = True
                break
    if flag:
        break

if not flag:
    print("YES")

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=[]
for i in range(len(A)):
    if A[i] in ans:
        print("NO")
        break
    else:
        ans.append(A[i])
else:
    print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

def main():
    flag = 0
    for i in range(len(A)-1):
        for j in range(i+1, len(A)):
            if A[i] == A[j]:
                flag = 1
                break
            else:
                continue

        if flag == 1:
            break
        else:
            continue

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


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

def main():
    flag = 0
    for i in range(len(A)-1):
        for j in range(i+1, len(A)):
            if A[i] == A[j]:
                flag = 1
                break
            else:
                continue
       

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


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

ans = []

for i in range(a):
    b = lis[i]
    c = ans.count(b)
    if c == 0:
        ans.append(b)

if len(ans) == a:
    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(len(A)):
    for a in A[i+1:]:
        if A[i] == a:
            print('NO')
            flag = True
            break
    if flag:
        break
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
x = [int(x) for x in input().split()]
flag = 0
for i in range(len(x)):
    for j in range(len(x)):
        if i != j:
            if x[i] == x[j]:
                print("NO")
                flag = 1
                break
    if flag == 1:
        break
else:
    print("YES")

Submission status: Time Limit Exceeded

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

if len(a) == len(sorted(set(a),key=a.index)):
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

Flag = True

for i in range(n):
  for j in range(n):
    if i != j and a[i] == a[j]:
      print('NO')
      Flag = False
      break
  if Flag == False:
    break
if Flag:
  print('YES')

Submission status: Time Limit Exceeded

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

for i in A:
	if A.count(i)>1:
		cnt = 1
		break
if cnt == 0:
	print('YES')
else:
	print('NO')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
import math
for i in A[:len(A)]:
	for j in A[A.index(i)+1:]:
		if i == j:
			cnt = 1
			break
if cnt == 0:
	print('YES')
else:
	print('NO')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
n = int(input())
s = list(map(int, input().split()))
tmp = []
for i in s:
    if i in tmp:
        print('NO')
        sys.exit()
    tmp.append(i)
print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for a in range(0, N): 
    for b in range(0, N): 
        if a == b:
            continue
        elif A[a] == A[b]:
            print("NO")
            exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lst = []
for i in input().split():
    if i in lst:
        print('NO')
        break
    else:
        lst.append(i)
        
if len(lst) == N:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lst = [x for x in input().split()]
a = ''

for i in range(N):
    a = lst.pop()
    if a in lst:
        print('NO')
        break
    else:
        continue

if len(lst) == 0:
    print('YES')

Submission status: Time Limit Exceeded

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

n_li = sorted(li)


dup = [x for x in set(li) if li.count(x) > 1]

if not dup:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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


count = 0
li = sorted(li)

l = [x for x in set(li) if li.count(x) > 1]
if len(l) == 0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
list = input().split()
 
int_list = [ int(n) for n in list ]
 
isDist = True
 
for a in range(n):
  x = a+1
  if int_list[a] in int_list[x:]:
    print("NO")
    isDist = False
    break;
 
if isDist is True:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int,input().split()))
i=0
j=0
c="YES"   ##ここ文字列だからくおーてーしょんいるの注意
for i in range(a):
 for j in range(i+1,a):
    if b[i]==b[j]:
     c="NO" ##ここも
     break
print(c)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int,input().split()))
i=0
j=0
c="YES"   ##ここ文字列だからくおーてーしょんいるの注意
for i in range(a):
 for j in range(i+1,a):
    if b[i]==b[j]:
     c="NO" ##ここも
print(c)

Submission status: Time Limit Exceeded

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


count = 0
li = sorted(li)
for i,v in enumerate(li):
    for j in li[i+1:]:
        if v != j:
            pass
        elif v==j:
            count += 1

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

Submission status: Time Limit Exceeded

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

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


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

count = 0

for i in range(a):
    if a-1 == i:
        continue
    for j in li[i+1:]:
        if li[i] == j:
            count += 1
        else:
            pass

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
list = input().split()
 
int_list = [ int(n) for n in list ]
 
isDist = True
 
for a in range(n):
  if int_list.count(int_list[a]) != 1:
    print("NO")
    isDist = False
    break;
 
if isDist is True:
    print("YES")

Submission status: Time Limit Exceeded

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

def main():
    N, *A = map(int,read().split())
    for a in A:
        if A.count(a)==1:
            continue
        else:
            result = 'NO'
            return result
    else:
        result = 'YES'
    return result

if __name__ == '__main__':
    print(main())

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:
import numpy as np

n=int(input())
a=(int(x) for x in input().split())
ai=list(a)
flag=False


for i in range(n-1):
    for j in range(i+1,n):
        if ai[i]==ai[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()))
counter = 0
for val in range(N - 1):
    for i in range(N - val - 1):
        if A[val] == A[val+i+1]:
            counter += 1
            break
    else:
        continue
    break
if counter == 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

for f in range(n):
  ai = a[f]
  for g in range(n):
    if g != f:
        if ai == a[g]:
            s = s+1

if s>0: print("NO")
else: print('YES')

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
p = map(int, input().split())
pList = list(p)

aList = []
ret = "YES"
for i in range(num):
    if pList[i] in aList:
        ret = "NO"
        break
    aList.append(pList[i])

print("{}".format(ret))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = input()
li = S.split(' ')
new = []
judge = 1
for s in li:
  if not s in new:
    new.append(s)
  else:
    judge = 0
    break
if judge==1:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import sys

msg = sys.stdin.readlines()
count = 0

for item in msg:
    item = item.replace('\n','')
    if " " in item:
        x = list(map(int, item.split()))
    else:
        n = int(item)

for i in range(n):
    for j in range(i + 1, n):
        if x[i] == x[j]:
            count += 1

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

Submission status: Time Limit Exceeded

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

int_list = [ int(n) for n in list ]

isDist = True

for a in range(n):
  if int_list.count(int_list[a]) != 1:
    print("NO")
    isDist = False
    break;

if isDist is True:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys
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]:
      print("NO")
      sys.exit()
    else:
      pass
  count1 += 1  
print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

exsit = []

ans = "YES"
for i in a:
  if i in exsit:
    ans = "NO"
    break
  else:
    exsit.append( i )

print( ans )

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=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:
num = int(input())
p = map(int, input().split())
pList = list(p)

ret = "YES"
for i in range(num):
    for j in range(i+1, num):
        if pList[i] == pList[j]:
            ret = "NO"
            break
    if ret == "NO":
        break

print("{}".format(ret))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = "YES"
A.sort()
#print(A)
for i in range(N):
    for j in range(i+1, N):
        if A[i] == A[j]:
            ans = "NO"
            break
        if A[i] > A[j]:
            break
    if ans == "NO":
        break

print(ans)

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()))
judge=True
for a in range(len(A_1)):
    a=A_1[0]
    A_1.remove(a)
    for b in A_1:
        if a==b:
            judge=False
            break
    else:
        continue
    break
if judge:
    print('YES')
else:
    print('NO')

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

main()

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
            print('NO')
            break
        else:
            mm +=1
    nn += 1
if frg != 1:
    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
            break
        else:
            continue
if counter == 0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int, input().split()))
A = 0
while A <= N - 1:
    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()))

ans = "YES"
A.sort()
#print(A)
for i in range(N):
    for j in range(i+1, N):
        if A[i] == A[j]:
            ans = "NO"
        if A[i] > A[j]:
            break

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int, input().split()))
D = N + 1
A = 0
while A <= N - 1:
    if a.count(a[A]) == 1:
        A += 1
    else:
      print('NO')
      break
if A == N:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
p = map(int, input().split())
pList = list(p)

ret = "YES"
for i in range(num):
    for j in range(i+1, num):
        if pList[i] == pList[j]:
            ret = "NO"
            break

print("{}".format(ret))

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

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-i-1):
    if list[i] == list[j+i+1]:
      print("NO")
      sys.exit()
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 ="NO"
        break
print(B)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
aa = input()
l = aa.split()
for i in range(0,n):
    l[i] = int(l[i])
dp = []
dp.append("YES")


for i in range(1,n):
    if dp[i-1] == "NO":
        dp.append("NO")
    count = 0
    for j in range(0,i):
        if l[j] == l[i]:
            count = count+1
    if dp[i-1] == "YES" and count == 0:
        dp.append("YES")
    if dp[i-1] == "YES" and count != 0:
        dp.append("NO")
print(dp[n-1])

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=+1
  i=i+1
if t==0:
  print("YES")  
else:
  print("NO")

Submission status: Time Limit Exceeded

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

    for f in range(n):
      
      for g in range(n):
     
        if g != f:
        	if a[f] == a[g]:
          		s = s+1
          
    if s>0: print("NO")
    else: print('YES')
        
        
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

N = input()
input_line = input()
Ai = input_line.split(" ")
NumAi = np.array(Ai)
Comment = "YES"
N = int(N)
for i in range(N):
  for j in range(i+1,N):
    if(NumAi[i] == NumAi[j]):
      Comment = "NO"
      break
      
print(Comment)

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[i] in A[i+1:]:
        ans = "NO"

print(ans)

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 w==i:
            count+=1
        
    if count>=1:
        break
    
if 0==count:
    print("YES")
    
else :
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
def main():
  input()
  list = input().split()
  result = 'YES'
  
  for i in range(len(list) - 1):
    temp = list.pop(-1)
    if temp in list:
      result = 'NO'
      break
  
  print(result)
    
main()

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
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")