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:
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  4 17:27:29 2020

@author: Kanaru Sato
"""

N = int(input())
A = input().split()
flag = 0

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

Submission status: Time Limit Exceeded

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

    count = 0
    flag = False

    '''
    for i in A:
        if(A.count(i) > 1):
            flag = True
            break

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

    for i in A:
        for j in A:
            if(i == j):
                count += 1
            if(count > 1):
                flag = True
                break
        count = 0

        if(flag):
            break

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

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

    count = 0
    flag = False

    for i in A:
        if(A.count(i) > 1):
            flag = True
            break

    if(flag):
        print('NO')
    else:
        print('YES')
    '''
    for i in A:
        for j in A:
            if(count == 2):
                flag = True
                break
            if(i == j):
                count += 1
        count = 0

        if(flag):
            break

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

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
    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 = input().split()
num = []

for i in a:
    if i not in num:
        num.append(i)
    else:
        print("NO")
        break
else:
    print("YES")

Submission status: Time Limit Exceeded

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

min_a = min(a)
x = [i for i in range(min_a, max(a)+1)]
for i in range(n):
   if x[a[i]-min_a] == -1:
      print('NO')
      exit()
   else:
      x[a[i]-min_a] = -1

print('YES')

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

res = np.zeros(N)
for i in range(N):
  res[i] = (A==A[i]).sum()

if (res>1).sum() > 0:
  ans = 'NO'
else:
  ans = 'YES'
  
print(str(ans))

Submission status: Time Limit Exceeded

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

flag = True

for i in A:
    if A.count(i) != 1:
        flag = False
        break

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = [int(x) for x in input().split()]

sub = list()
for i in li:
    if i in sub:
        print("NO")
        break
    sub.append(i)
else:
    print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def distinct_or_not(a_list):
    tmp_list = []
    for a in a_list:
        if len(tmp_list) == 0:
            tmp_list.append(a)
        else:
            left = 0
            right = len(tmp_list) - 1
            while left <= right:
                mid = (left + right) // 2
                if tmp_list[mid] == a:
                    return 'NO'
                elif tmp_list[mid] > a:
                    right = mid - 1
                else:
                    left = mid + 1
            tmp_list.insert(right+1, a)
    return 'YES'

n = int(input())
a_list = [int(a) for a in input().split()]

print(distinct_or_not(a_list))

Submission status: Time Limit Exceeded

Solution code:
def distinct_or_not(a_list):
    tmp_list = []
    for a in a_list:
        if a not in tmp_list:
            tmp_list.append(a)
        else:
            return 'NO'
    return 'YES'

n = int(input())
a_list = [int(a) for a in input().split()]

print(distinct_or_not(a_list))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    tmp = []
    is_unique = True
    for i in range(n):
        for j in tmp:
            if j == a[i]:
                is_unique = False
                break
        if not is_unique:
            break
        tmp.append(a[i])
    
    if is_unique:
        print("YES")
    else:
        print("NO")


if __name__=="__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
  N = input()
  A= input().split()
  result = False
  for a in A:
    count = A.count(a)
    if count > 1:
      result = True
  if result:
    print("NO")
  else:
    print("YES")

main()

Submission status: Time Limit Exceeded

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

def main():
    for i in range(len(a_n)):
        for j in range(i):
            if a_n[i] == a_n[j]:
                print('NO')
                return 0
    print('YES')
    return 0

main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Flag = "YES"
Counter = 1

for i in Alist:
  
  for j in range(n - Counter):
    if i == Alist[Counter + j]:
      Flag = "NO"
  Counter = Counter + 1

print(Flag)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(k) for k in input().split()]
b=0
for j in range(n):
    for k in range(n):
        if a[j]==a[k] and j!=k:
            b+=1
            break
if b==0:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
b=0
for j in range(n):
  for k in range(n):
    if a[j]==a[k] and j!=k:
      b+=1
if b==0:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=input().split()
q=[]
f=1
for i in l:
  if i not in q:
    q.append(i)
  else:
    f=0
    break
if f==1:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=input().split()
q=[]
for i in l:
  if i not in q:q.append(i)

if len(l)!=len(q):
  print('NO')
else:
  print('YES')

Submission status: Time Limit Exceeded

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

break_flag = 0
for i in range(len(num_list)):
    if num_list.count(num_list[i]) >= 2:
        break_flag = 1
        break

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans='YES'
for i in range(n):
  for j in range(i+1,n):
    if a[i]==a[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()))

i = 0
ans = 1
while i < N-1:
    for j in range(N-i-1):
        if a[i] == a[i+j+1]:
            ans = 0
            break
    if ans == 0:
        break
    i +=1
    
if ans == 1:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
lis = list(map(int, input().split()))
j = 'YES'
for Nx in range(N):
  for Ax in range(1, N-Nx):
    if lis[Nx] == lis[Nx+Ax]:
      j = 'NO'
      break
    else:
      continue
    break
print(j)

Submission status: Time Limit Exceeded

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

#処理
cout = 0
for i in range(N):
    for j in range(N-i-1):
        if A[i]==A[i+j+1]:
            cout += 1

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

Submission status: Time Limit Exceeded

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

#処理
cout = 0
for i in range(N):
    for j in range(N):
        if i==j:
            break
        else:
            if A[i]==A[j]:
                cout += 1
if cout==0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

duplicate_list = [x for x in set(An) if An.count(x) > 1]

if duplicate_list:
    print('NO')
else:
    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-1):
  if A.count(A[i]) > 1:
    print('NO')
    s = 1
    break
if s == 0:
  print('YES')

Submission status: Time Limit Exceeded

Solution code:
count = int(input())
s = list()
for x in input().split():
    if x in s:
        print("NO")
        break
    else:
        s.append(x)
else:
    print("YES")

Submission status: Time Limit Exceeded

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

flg = True

s = []



for i in a:
    if i in s:
        flg = False
        break

    s.append(i)


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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
L = []
for i in range(N):
  if A[i] in L:
    print('NO')
    break
  L.append(A[i])
else:
  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[i] in A[i+1:]:
    print('NO')
    break
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")
            exit()

print("YES")

Submission status: Time Limit Exceeded

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

same = 0

for i in A:
    for j in A:
        if i==j:
            same += 1

if same == N:
    print('YES')
elif same > N:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=[int(e) for e in input().split()]
flg=0
for i in range(N-1):
    if(flg==0):
        for j in range(i+1,N):
            if(flg==0):
                if a[i]==a[j]:
                    flg=1
                    print("NO")

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

i = 0
flag = 0
while(i<N-1):
  for j in range(1,len(A)):
    if(A[0]==A[j]):
      flag = 1
      break
  if(flag == 1):
    break
  else:
    A.pop(0)
  i += 1
if(flag == 1):
  print("NO")
else:
  print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys
N = int(input())
A = [int(i) for i in input().split()]
flg = 0
for i in range(len(A)-1):
  #print("i:"+str(i))
  for j in range(i+1,len(A)):
    #print("  j:"+str(j))
    if A[i] == A[j]:
      print("NO")
      sys.exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))
s = []
for i in l:
    if (i in s):
        print("NO")
        exit(0)
    s.append(i)
print("YES")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for x in range(n):
    for y in range(n):
        if x != y and list[x] == list[y]:
            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()))

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:
input()
l=input().split()
for i in l:
  if l.count(i)!=1:
    print("NO")
    exit(0)
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
inputA = input()
listA = inputA.split(' ')
count = 0
for num in listA:
    k = listA.count(num)
    if k != 1:
        print('NO')
        break
    else:
        count += 1
if count == N:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
all_list = input().split(' ')

before_list = []

for i in range(N):
  if before_list.count(all_list[i]) == 0:
    before_list.append(all_list[i])
  else:
    print('NO')
    exit()
if len(all_list) == len(before_list):
  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:
flag = True
n = int(input())

a = input().split()

if n != len(a):
    print("error")

start = 0
for i in a:
    start += 1
    for j in a[start:]:
        if i == j:
            flag = False
            break
    
            
if flag:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

def merge(l) :
  length = len(l)
  
  if(length <= 1) :
    return 0, l
  
  flag, left = merge(l[0:int(length/2)])
  if(flag == 1) :
    return 1, l
  flag, right = merge(l[int(length/2):length])
  if(flag == 1) :
    return 1, l
  
  total = []
  while(True) :
    if(len(left) == 0) :
      total.extend(right)
      return 0, total
    if(len(right) == 0) :
      total.extend(left)
      return 0, total
    if(left[0] == right[0]) :
      return 1, l
    if(left[0] < right[0]) :
      total.append(left.pop(0))
    else :
      total.append(right.pop(0))
        
flag, temp = merge(a)
if(flag == 1) :
  print("NO")
else :
  print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = input()
inp = input()
listA = inp.split(' ')
count = 0
for moji in listA:
    youso = listA.count(moji)
    if youso == 1:
        count += 1
    else:
        print('NO')
        break
if count == len(listA):
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
N = input()
inp = input()
listA = inp.split(' ')
out = 'YES'
for k in listA:
    count = 0
    for j in listA:
        if k == j:
            count += 1
            if count >= 2:
                out = 'NO'
                break
print(out)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A = [int(x) for x in input().split()]
flag=False
for i in range(N):
    check=A[i]
    for k in range(N):
        if i!=k and check==A[k]:
            flag=True
            break
    if flag:
        break
if flag:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
line1 = input()
line2 = input()
num_list = line2.split(" ")
flag = 0

for i in range(len(num_list)-1):
    search_num = num_list[0]
    num_list.pop(0)
    if search_num in num_list:
        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()))
a=sorted(a)
for i in a:
    if a.count(i)>1:
        print('NO')
        exit()
        
print('YES')

Submission status: Time Limit Exceeded

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

for i in a:
    if a.count(i)>1:
        print('NO')
        exit()
        
print('YES')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
n=n//2+1
ans="YES"
for i in range(n):
  num=a[i]
  if a.count(num)!=1:
    ans="NO"
    break
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# 自分の
N = int(input())
a_arr = list(map(int, input().split()))

for i in range(N):
    if i==N-1:
        print("YES")
        break
    for j in range(1, N-i):
        if a_arr[i] == a_arr[i+j]:
            print("NO")
            break
    else:
        continue
    break

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b = input().split()
c = 0
for i in b:
    for l in b:
        if i == l:
            c += 1
if c > a:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
num_of_numbers = int(input())

numbers_list = []
flag = True
for num in list(map(int, input().split())):
  if num in numbers_list:
    flag = False
    print("NO")
    break
  else:
    numbers_list.append(num)

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

Submission status: Time Limit Exceeded

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

value=True
for i in range(1,len(li)):
  for j in range(i):
    if li[i]==li[j]:
      value=False
      break
if value:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print("YES")

Submission status: Time Limit Exceeded

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

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

print("YES")

Submission status: Time Limit Exceeded

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

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

print("YES")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
count=0
for i in range(N):
  for h in range(N):
    if A[i]==A[h] and h!=i:
      count+=1
if count==0:
  print("YES")
elif count!=0:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(int(x) for x in input().split())
x = 0

for i in range(n):
    if (a.pop() in a) is True:
        print("NO")
        x = 1
        break

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(int(x) for x in input().split())
x = 0

for i in range(n):
    if (a.pop(0) in a) is True:
        print("NO")
        x = 1
        break

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(int(x) for x in input().split())
x = 0

for i in range(n):
    b = a.pop(0)
    if (b in a) is True:
        print("NO")
        x = 1
        break

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = [""]*N

text = input()
k = 0
for x in text:
    if x == " ":
        k = k+1
    else:
        a[k] = a[k]+x

for i in range(N):
    a[i] = int(a[i])

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

print(output(a))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(int(x) for x in input().split())
x = 0
for i in range(n):
    if a.count(a[0]) != 1:
        print("NO")
        x = 1
        break
    a.pop(0)

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(int(x) for x in input().split())
x = 0
for i in range(n):
    if a.count(a[i]) != 1:
        print("NO")
        x = 1
        break

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
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
      
if flag==0:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

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

l = []
count = 0
for i in A:
    if i not in l:
        l.append(i)
    else:
        count += 1

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

Submission status: Time Limit Exceeded

Solution code:
def is_same(lst):
  n=len(lst)
  for i in range(n-1):
    for j in range(i+1,n):
      if(lst[i]==lst[j]):
        return True
  return False
    

n=int(input())
input_line=[int(x) for x in input().split()]
if(not is_same(input_line)):
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

listA=[]

try:
    listA = list(input().split())
    #listA<-[1,2,2,3,1]
    #print(listA)
    #ここに逐次処理を書けばいいと思う。
except:
    quit();
    #または、quit(),os.exit()をして止める。


for i in listA:
    if listA.count(i) >= 2:
        print('NO')
        quit();

print('YES')

Submission status: Time Limit Exceeded

Solution code:
num = input()
list = list(map(int,input().split()))
flg  = False
for i in list:
  if list.count(i) >= 2:
    flg = True
    break
print("NO") if flg else print("YES")

Submission status: Time Limit Exceeded

Solution code:
num = input()
list = list(map(int,input().split()))
flg  = False
for i in list:
  if list.count(i) >= 2:
  	flg = True
print("NO") if flg else print("YES")

Submission status: Time Limit Exceeded

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

ans = 'YES'

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
from itertools import combinations

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

for ai, aj in combinations(A, 2):
    if ai != aj:
        continue
    else:
        print('NO')
        break
else:
    print('YES')

Submission status: Time Limit Exceeded

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

def d_or_n(N, A):

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

d_or_n(N, A)

Submission status: Time Limit Exceeded

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

C=0

for i in range(N):
	for n in range(N):
	  if A[i]==A[n]:
	  	C=C+1
	  else:
	  	C=C+0

if C==N:
	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):
	if A.count(A[i])==1:
		C=C+0
	else:
		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()))

C=0

for i in range(N-1):
	if A.count(A[i-0])==1:
		C=C+0
	else:
		C=C+1

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

Submission status: Time Limit Exceeded

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


S = 1
for i in range(N-1):
    S = S*( li[i+1] - li[i] )

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 16:01:34 2020

@author: matsui
"""

N=int(input())
A=input().split()

ans='YES'
maxa=int(A[0])
mina=int(A[0])
for i in range(1,N):
    ai=int(A[i])
    if ai<mina:mina=ai
    if ai>maxa:maxa=ai
    if ai>=mina and ai<=maxa:
        if A[i] in A[:i]:
            ans='NO'
            break
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 16:01:34 2020

@author: matsui
"""

N=int(input())
A=input().split()

ans='YES'
for i in range(1,N):
    if A[i] in A[:i]:
        ans='NO'
        break
    
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = input()
l = list(map(int,input().split()))
for i in range(len(l)):
    if not l.count(l[i])== 1:
      print("NO")
      break
    elif i == len(l)-1:
      print("YES")

Submission status: Time Limit Exceeded

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

list=[]
cnt=0
for a in A:
    if a in list:
        print('NO')
        break
    else:
        list.append(a)
        cnt+=1
if cnt==N:
    print('YES')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

X=0
for i in range(N):
    X+=A.count(A[i])

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

Submission status: Time Limit Exceeded

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

cnt = 0

for i in range(n):
    for j in range(n):
        if a[i] == a[j]:
            cnt += 1

if cnt == n:
    print("YES")
elif cnt > n:
    print("NO")