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: Wrong Answer

Solution code:
N = int(input())

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

a = set(A)

if len(A) == len(a):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split(" ")))
    numbers = []
    answer = "Yes"
    for a in A:
        if not a in numbers:
            numbers.append(a)
        else:
            answer = "No"
            break
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if len(A) == len(set(A)):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

bef=A[0]
for i in range(1,n):
       if A[i]==bef:
              print("NO")
              exit()
print("YES")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
if(len(a) == len(set(a))):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if len(num)==len(set(num)):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

arrset = set(arr)

if len(arr) == len(arrset):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    A = list(map(int, args[1].split()))
    A.sort()
    p = A[0]
    for a in A[1:]:
        if a == p:
            return 'NO'

    return 'YES'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
A = Counter(map(int, input().split()))
A = A.values()
for a in A:
    if a != 1:
        print("NO")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
b=input()
a=[int(x) for x in input().split()]
if a==list(set(a)):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

s = set(A)
if len(s) == N:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
s = list(set(A))
if len(A) == len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
s = list(set(a))
if a == s:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import copy
n = int(input())
a = list(map(int, input().split()))
l1 = copy.copy(a)
l1 = list(set(l1))
a.sort()
if a == l1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

flag = False
for i in range(n-1):
    for j in range(n-1):
        if a[i] == a[j]:
            Flag = True
            break
    if flag:
        break

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

Submission status: Wrong Answer

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

for i in range(len(A)-1):
    if A[i]==A[i+1]:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

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

a = set(A)

if len(A) == len(a):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

b = set(a)
if len(a)==len(b):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

len_a = len(a)
set_a = len(set(a))

if len_a == set_a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = set()
n = input()
for i in map(int,input().split()):
  if i in s:
    print("YES")
    exit(0)
  else:
    s.add(i)
print("NO")

Submission status: Wrong Answer

Solution code:
import collections

N = int(input())

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

C = collections.Counter(A)
if C.most_common()[0][1] == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
a1 =  set(a)
if len(a) != len(a1):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

s=set(a)

if len(s)==n:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

if len(set(a)) == n:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N=int(input())
a=set(list(map(int,input().split())))
if len(a)==N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:


N=int(input())
A=[int(i) for i in input().split()]
if len(A)==len(set(A)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if len(a) == n:
  print('Yes')

else:
  print('No')

Submission status: Wrong Answer

Solution code:
import collections

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

c=collections.Counter(a)

ans=True
for i,m in c.items():
    if m>1:
        ans=False
        break
if ans:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
setA = set(A)
print("Yes" if len(setA)==len(A) else "No")

Submission status: Wrong Answer

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

if len(A) == len(B):
    ans = 'YES'
else:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

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

def has_duplicates(seq):
    return len(seq) != len(set(seq))

if has_duplicates(lst)==True:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
a = na()
a.sort()

diff = True
for i in range(n-1):
    if a[i] == a[i+1]:
        diff = False
if diff:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

a.sort()

ans="Yes"
for i in range(n-1):
    if a[i]==a[i+1]:
        ans="No"
        break
print(ans)

Submission status: Wrong Answer

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

for i in a:
    if i in aa:
        print('N0')
        exit()
    else:
        aa.append(i)

print('YES')

Submission status: Wrong Answer

Solution code:
def main():

    N = int(input())
    A = list(map(int, input().split()))
    if len(A) == len(set(A)):
        return 'YES'
    return 'No'

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

Submission status: Wrong Answer

Solution code:
n = int(input())
s = set(map(int,input().split()))
print('YNeos'[n!=len(s)::2])

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    vn = vk = vn_k = 1
    for i in range(1, n+1):
        vn = vn * i % modp
        if i == k:
            vk = vn
        if i == n-k:
            vn_k = vn
    return vn * get_inv(vk, modp) * get_inv(vn_k, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

def main():
    input()
    A = lmis()
    if len(A) == len(set(A)):
        print('Yes')
    else:
        print('No')



main()

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
A.sort()
sA = list(set(A))
if A == sA:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
a = [int(i) for i in input().split()]
a1 = set(a)

if len(a) == len(a1):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
if len(set(a)) == n:
    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):
  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 = int(input())
a = list(map(int, input().split()))

for i in range(n):
    if a.count(a[i]) == 1:
        continue
    else:
        print('NO')
        exit()

print('YES')

Submission status: Time Limit Exceeded

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

cnt = 0

for i in range(1, N):
    x = A[0:i]
    y = A[i:N]
    
    for _x in x:
        if _x in y:
            cnt += 1
        
if cnt > 0:
    result = 'NO'
else:
    result = 'YES'
        
print(result)

Submission status: Time Limit Exceeded

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

for i in range(num):
    for j in range(i+1, num):
        if table[i] == table[j]:
            count += 1
        else:
            continue
if count == 0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = list(map(int,input().split()))
ans = 0
for i in range(len(lst)):
    if (lst.count(lst[i]) != 1):
        ans = 1

if (ans == 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):
  if a.count(a[i])!=1:
    flag=1
if flag==0:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
s=int(input())
# b=input()
# c=[]
# for i in range(b):
#     c.append(a[i])
a = list(map(int,input().split()))
#b = list(map(int,input().split()))
count=0
for i in range(s):
    for k in range(s):
        if  a[i]==a[k]:
            count+=1

if count<=s:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
m = input()
N = list(map(int, input().split(' ')))
# m = int(input())
# k = int(input())
c = 0
N.sort()
for i in N:
    
    if N.count(i) > 1:
        c = 1
        break
if c == 0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
m = input()
N = list(map(int, input().split(' ')))
# m = int(input())
# k = int(input())
c = 0
for i in N:
    
    if N.count(i) > 1:
        c = 1
        break
if c == 0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

check = True
for i in range(N):
  if A.count(A[i]) > 1:
    check = False
    
print("YES" if check else "NO")

Submission status: Time Limit Exceeded

Solution code:
import collections
N=int(input())
A=list(map(int,input().split()))
c = collections.Counter(A)
for i in range(N):
  if list(c.values())[i]>1:
    print('NO')
    exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [int(i) for i in input().split()]
for i, left in enumerate(s[0:-1]):
	for right in s[i+1:]:
		if left == right:
			print('NO')
			exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
def main():
  N = int(input())
  A = list(input().split())
  A.sort()
  c = []
  for a in A:
    if a in c: return "NO"
    c.append(a)
  return "YES"

print(main())

Submission status: Time Limit Exceeded

Solution code:
def main():
  N = int(input())
  A = list(input().split())
  D = list(set(A))
  for d in D:
    if A.count(d) >= 2: return "NO"
  return "YES"

print(main())

Submission status: Time Limit Exceeded

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

def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

if len(A)==len(get_unique_list(A)):
    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(i+1,n):
        if A[i]==A[j]:
            cnt+=1
            break

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

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(i+1,n):
        if A[i]==A[j]:
            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()))
jud = []
a.sort()
ans = "YES"
for i in range(n):
  if(a[i] in jud):
    ans = "NO"
    break
  else:
    jud.append(a[i])
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)
print("NO" if has_duplicates2(a) else "YES")

Submission status: Time Limit Exceeded

Solution code:
import sys

n=int(input())
a=input().split()
for i in range(n-1):
  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:
N=int(input())
Alist=list(map(int,input().split()))
cnt=0
for i in range(len(Alist)):
  a=Alist.count(Alist[i])
  if a>=2:
    cnt=1
    break
b="YES"*(cnt*(-1)+1)+"NO"*cnt
print(b)

Submission status: Time Limit Exceeded

Solution code:
number = int(input())
score = list(map(int,input().split()))
cancel = 0
for i in range(number):
    if score.count(score[i]) != 1:
        cancel = 1
        break
if cancel == 1:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
table=sorted(list(map(int,input().split())))
for i in range(n):
    for j in range(n):
        if (table[i]==table[j]) and (i!=j) :
            print("NO")
            exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
table=list(map(int,input().split()))
for i in range(n):
    for j in range(n):
        if (table[i]==table[j]) and (i!=j) :
            print("NO")
            exit()
print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
Ans = "YES"
List = []

for e in A:
    if e in List:
        Ans = "NO"
        break
    else:
        List.append(e)

print(Ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
sq = list(map(int, input().split()))
for _ in range(n):
    c = sq.pop()
    if c in sq:
        print('NO')
        exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
# abc154_c.py
# https://atcoder.jp/contests/abc154/tasks/abc154_c

# C - Distinct or Not /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 300点

# 問題文
# 整数列 A1,A2,...,ANが与えられます。 
# この整数列のどの 2つの要素も互いに異なるならば YES を、そうでないなら NO を出力してください。

# 制約
#     2≤N≤200000
#     1≤Ai≤109
#     入力は全て整数

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# A1 ... AN

# 出力
# 整数列のどの 2つの要素も互いに異なるならば YES を、そうでないなら NO を出力せよ。

# 入力例 1
# 5
# 2 6 1 4 5

# 出力例 1
# YES

# どの 2つの要素も互いに異なります。

# 入力例 2
# 6
# 4 1 3 1 6 2

# 出力例 2
# NO

# 2番目の要素と 4番目の要素が同じです。

# 入力例 3
# 2
# 10000000 10000000

# 出力例 3
# NO


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    N = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = 'YES'
    for i in range(N-1):
        for j in range(i+1, N):
            if values[i] == values[j]:
                result = 'NO'

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['5', '2 6 1 4 5']
        lines_export = ['YES']
    if pattern == 2:
        lines_input = ['6', '4 1 3 1 6 2']
        lines_export = ['NO']
    if pattern == 3:
        lines_input = ['2', '10000000 10000000']
        lines_export = ['NO']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

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
  else:
    continue
  break

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
if any(a[i] in a[:i] or a[i] in a[i+2:] for i in range(n)):
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

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

    else:
        a.append(A[i])
        if i==N-1:print('YES')

Submission status: Time Limit Exceeded

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

b = np.array(b)

len_b = len(b)

flag = 0

for i in range(len_b):
    for j in range(len_b):
        if i==j:
            None
        elif b[i] != b[j]:
            None
        else:
            flag = 1
            break

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

Submission status: Time Limit Exceeded

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

len_b = len(b)

flag = 0

for i in range(len_b):
    for j in range(len_b):
        if i==j:
            None
        elif b[i] != b[j]:
            None
        else:
            flag = 1
            break

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

Submission status: Time Limit Exceeded

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

len_b = len(b)

flag = 0

for i in range(len_b):
    for j in range(len_b):
        if i==j:
            None
        elif b[i] != b[j]:
            #print("YES")
            None
        else:
            flag = 1
            #print("NO")
if flag == 0:
    print('YES')
elif flag ==1:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
import sys

N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  for j in range(N):
    if(i!=j and 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()))

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

for i in range(n):
    for j in range(n):
        if i == j:
            pass
        else:
            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()))
b=[]
flag=True
for i in range(n):
  if a[i] in b:
    flag=False
    break
  else:
    b.append(a[i])
if flag:
  print("YES")
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
import sys
an = list(map(int, sys.stdin.readline().split()))

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split(' ')))
answer = True
for i in range(len(A)):
    if A.count(A[i]) > 1:
        answer = False
if answer:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = [x for x in input().split()]
ans = 0
for i in range(n):
  if  lis.count(lis[i]) >= 2:
    ans += 1
    break

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

Submission status: Time Limit Exceeded

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

for i in range(n):
  if  lis.count(lis[i]) >= 2:
    print("NO")
    exit()

print("YES")

Submission status: Time Limit Exceeded

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

for p in range(n):
    i = p + 1
    while i < n:
        if a[p] == a[i]:
            y = False
            break
        i += 1
        
if y:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

for p in range(n):
    for i in range(n):
        if p == i:
            pass
        elif a[p] == a[i]:
            y = False
        else:
            pass
        
if y:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
class Node:
    def __init__(self):
        self.label = None
        self.left = None
        self.right = None

    def searchORinsert(self,num):
        #もしなければ、新しいノードを作る
        if self.label==None:
            self.label=num
            
            return 1

        elif  self.label>num:
                if self.left!=None:
                    return((self.left).searchORinsert(num))
                else :
                    self.left=Node()
                    return((self.left).searchORinsert(num))
                



        elif  self.label<num:
                if self.right!=None:
                    return((self.right).searchORinsert(num))
                else :
                    self.right=Node()
                   
                    return((self.right).searchORinsert(num))

                
    #あったら、警告する

        else :
            return 0






N =int(input())


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


No=Node()
f=1
for i in l:
    
    if No.searchORinsert(i)!=1:
        f=0
        break


if f!=0:
        print("YES")

else:
        print("NO")

Submission status: Time Limit Exceeded

Solution code:
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N = II()
    A = LI()
    ans = 0

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


if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
flag=True
inList=list(map(int,input().split()))
for i in range(len(inList)):
    for j in range(i+1,len(inList)):
        if inList[j]==inList[i]:
            print('NO')
            flag=False
            break
    if not flag:
        break

if flag:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
flag=True
inList=list(map(int,input().split()))
List=[]
for a in inList:
    for numbers in List:
        if numbers==a:
            print('NO')
            flag=False
            break
    if flag:
        List.append(a)
    else:
        break

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import collections
N=int(input())
A=list(map(int,input().split()))
tmp=[x for x in set(A) if A.count(x) > 1]
if len(tmp)==0:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

count_list = []
for a in A_list:
    count = 0
    for i in range(N):
        if a == A_list[i]:
            count += 1
    count_list.append(count)

if max(count_list) == 1:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

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

a=True
for i in range(N):
    b=A[0]
    A.remove(b)
    if (b in A)==True:
        print("NO")
        a=False
        break
if a==True:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    A = list(map(int, input().split()))
    for i in range(N):
        for j in range(i+1, N):
            if A[i] == A[j]:
                print("NO")
                exit()
    print("YES")


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(0,int(n)):
  if(b[i] in b[i+1:]):
    print("NO")
    exit()
print("YES")