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: Runtime Error

Solution code:
n = int(input())
x = input()
arr = x.split()
for i in range(0,n):
    for x in range(0,n):
        if arr[i] == arr[x] and i != x:
            print "NO"
            break
print "YES"

Submission status: Runtime Error

Solution code:
n = int(input())
x = input()
arr = x.split()
for i in range(0,n):
        for x in range(0,n):
            if arr[i] == arr[x] and i != x:
                print "NO"
                break
print "YES"

Submission status: Runtime Error

Solution code:
def the_one(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"

t = int(input())

for y in range(0,t):
    n = int(input())
    x = input()
    arr = x.split()
    print(the_one(n, arr))

Submission status: Runtime Error

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

if N != len(set(A)):
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
ps_lst = [list(map(str,input().split())) for _ in range(m)]
ac_count = 0
wa_count = 0

ac_prolst = []
for i in range(len(ps_lst)):
    number = ps_lst[i][0]
    answer = ps_lst[i][1]
    if answer=='AC':
        ac_prolst.append(number)
ac_lst = list(set(ac_prolst))

ps_dic = {}
for i in range(m):
    number = ps_lst[i][0]
    if number in ac_lst:
        tmp_dic = {number: 'WA'}
        ps_dic.update(tmp_dic)

for i in range(m):
    number = ps_lst[i][0]
    answer = ps_lst[i][1]

    if number in ac_lst:
        if answer == 'AC' and ps_dic[number] == 'WA':
            ac_count += 1
            tmp_dic = {number: 'AC'}
            ps_dic.update(tmp_dic)
        elif answer == 'WA' and ps_dic[number] == 'WA':
            wa_count += 1

print('{} {}'.format(ac_count, wa_count))

Submission status: Runtime Error

Solution code:
import pandas as pd
input()
a = pd.Series(list(map(int, input().split())))
print(['NO', 'YES'][a.nunique() == len(a)])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a = []
for ai in A:
    if ai in a:
        print("NO")
        Flag = False
    a.append(ai)

if Flag:
    print("YES")

Submission status: Runtime Error

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

s = set()

for i in arr:
	if i in arr:
    	print("NO")
    	return
 	else:
      s.add(i)
      
print("YES")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
from collections import Counter
B=A.Counter
if B.most_common[0][1] <= 1:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

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

if A.most_common[0][1] <= 1:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

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

def main():
    new_A = sorted(A)

    for i in range(S-1):
        if new_A[i] == new_A[i+1]:
            flag = 1
            break
        else:
            continue
        
    if flag == 0:
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
'''
Sample Input 1 

5
2 6 1 4 5
Sample Output 1 

YES
'''
lens = int(input())
arrs = [int(x) for x in input(),split()]
print(["NO", "YES"][len(arrs) == len(set(arrs))])

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int main() {
    int n;
    cin >> n;
    int a[n];
    rep(i,n)cin >> a[i];
    sort(a,a+n);
    rep(i,n-1)if(a[i] == a[i+1]){
        cout << "NO" << endl;
        return 0;
    }
    cout << "YES" << endl;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if n==len(a_n):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

print('NO' if len(li) > len(set(li)) else 'YES')

Submission status: Runtime Error

Solution code:
n = int(input())
li = map(int,input().split())
print('NO' if len(li)!=len(set(li)) else 'YES')

Submission status: Runtime Error

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

flg = 0
for i in range(1,N):
  if S[i] = S[i-1]:
    flg = 1
    
if flg == 1:
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

Solution code:
N = int(input())
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: Runtime Error

Solution code:
N = int(input())
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: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
def yabaton(A):
  for i in range(0,n-1):
    for j in range(i+1,n):
      if A[i] == A[j]:
        return 'NO'
  return 'YES'
yabaton(A)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(map(int,input().split()))
f=sortedlist(s)
d=set(s)
if(len(s)==len(d)):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + (1+p[i])/2

ans = 0
for i in range(N-K+1):
  diff = S[i+K] - S[i]
  ans = max(ans, diff)
print(ans)

Submission status: Runtime Error

Solution code:
len=input()
#len-1
Narray=sorted(input().split())
n=0
while True
	if not Narray[n] == Narray[n+1]:
    	pass
    elif:
      print("NO")
print("yes")

Submission status: Runtime Error

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" ##ここも
     j=a
     i=a
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if len(set(a)) == n:
  print('YES')
else
  print('NO')

Submission status: Runtime Error

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

A.sort()

for i in range(N - 1):
    if A[i] == A[i + 1]:
        print('NO')
        return

print('YES')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
def main():
    StringN = input();
    listA = input().split();
    lsitA.sort();
#    newlistA = sorted(listA);
#    print(newlistA);

    for i in range(int(StringN)-1):
#        print(newlistA[i]);
#        print(newlistA[i+1]);
        if lsitA[i] == lsitA[i+1]:
            print('No');
#            print (i)
            return 0;
    print('Yes');


main();

Submission status: Runtime Error

Solution code:
def calc_exp(x):
    return (int(x) + 1)/2

NK = input().split()
N, K = int(NK[0]), int(NK[1])
#lis_p = list(map(lambda x: int(x), input().split()))
lis_exp = list(map(calc_exp, input().split()))
dp=0
for i in range(N):
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)

Submission status: Runtime Error

Solution code:
def calc_exp(x:str)->float:
    return (int(x) + 1)/2

NK = input().split()
N, K = int(NK[0]), int(NK[1])
#lis_p = list(map(lambda x: int(x), input().split()))
lis_exp = list(map(calc_exp, input().split()))
dp=0
for i in range(N):
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
p_list = list(map(int, input().split()))
index = 0
value = 0

for i in range(n - k):
    if p_list[i] < p_list[i + k]:
        index = i + 1

for i in range(k):
    value += (1 + p_list[index + i])/ 2 

print(value)

Submission status: Runtime Error

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

for i in A:
  for j in range(N):
    if A[i] == A[j]:
      print("YES")
      break
print("NO")

Submission status: Runtime Error

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

A = []
A = list(map(int, data.split(' ')))

for i in A:
  for j in range(N):
    if A[i] == A[j]:
      print("YES")
      break
print("NO")

Submission status: Runtime Error

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

A = []
A = list(map(int, data.split(' ')))

for i in A:
  for j in range(N):
    if A[i] == A[j]:
      print("YES")
      break
print("NO")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int i,n,p,count=0;
    cin>>n;
    long int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    p=sizeof(a)/sizeof(a[0]);
    sort(a,a+p);
    for(int i=0;i<n;i++)
    {

    if(a[i]==a[i+1])
    {
        count++;
        break;
    }
    }
    if(count!=0)
    {
        cout<<"NO";
    }
    else
    {
        cout<<"YES";
    }
    return 0;
}

Submission status: Runtime Error

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

for i in A:
  for j in range(N):
    if A[i] == A[j]:
      print("YES")
      break
print("NO")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,size,count=0;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    size=sizeof(a)/sizeof(a[0]);
    sort(a,a+size);
    for(int i=0;i<n;i++)
    {

    if(a[i]==a[i+1])
    {
        count++;
        break;
    }
    }
    if(count!=0)
    {
        cout<<"NO";
    }
    else
    {
        cout<<"YES";
    }
    return 0;
}

Submission status: Runtime Error

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

count = 0

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

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb  9 21:51:13 2020

@author: W_Indicate
"""

N = int(input())
#list=[]
#for i in range(N):
#    list.append(int(input()))
list=[]
list = input().split()

s=1
i = 0
j = 1
anser = 1
for x in range(N):
    if list[i] == list[s+j]:
        anser = 0
    else:
        j += 1
        
    s += 1

if anser == 1:
    print("yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
def pairwise_distinct():
    n = int(input())
    k = []
    for i in range(0,n):
        k.append(int(input()))
    if (len(set(k)) == len(k)):
        return "YES"
    else:
        return "NO"

    return k
        
        

print(pairwise_distinct())

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# Input
s = [input() for i in range(2)]
N = int(s[0])
As = sorted(list(s[1].split()))

# Proccess
for i in range(0,N):
	if As[i] == As[i+1]:
		Anser = "No"
		break
	else:
		Anser = "Yes"
		
# Output							
print(Anser)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,size,count=0;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    size=sizeof(a)/sizeof(int);
    sort(a,a+n);
    for(int i=0;i<n;i++)
    {

    if(a[i]==a[i+1])
    {
        count++;
        break;
    }
    }
    if(count!=0)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes";
    }
    return 0;
}

Submission status: Runtime Error

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

# Input
s = [input() for i in range(2)]
N = int(s[0])
As = sorted(list(s[1].split()))

# Proccess
for i in range(N):
	if As[i] == As[i+1]:
		Anser = "No"
		break
	else:
		Anser = "Yes"
		
# Output							
print(Anser)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
d = [int(x) for x in stdin.readline().rstrip().split()]

m = [0] * 1000000000

for i in d:
    m[i] += 1

result = 0
for i in m:
    if (i > 1):
        result += 1

if (result > 0):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
d = [int(x) for x in stdin.readline().rstrip().split()]

m = [0] * 100

for i in d:
    m[i] += 1

result = 0
for i in m:
    if (i > 1):
        result += 1

if (result > 0):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if count = 0:
  print("YES")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
d = [int(x) for x in stdin.readline().rstrip().split()]

m = [0] * 100

for i in d:
    m[i] += 1

for i in m:
    if (i > 1):
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
array = list(map(int, input().strip().split()))
count = 0
for i in range(0, A - 1):
  for j in range(i+1, A):
    if array[i] == array[j]:
      print("NO")
      count = 1

if count = 0:
  print("YES")

Submission status: Runtime Error

Solution code:
[n,k] = [int(i) for i in input().split()]
p = [(int(i)+1)/2 for i in input().split()]

a = []
#print(a)
ans = -1
ruiseki = []
for i in range(n-k+1):
    ruiseki.append(sum(p[i:i+k]))
print(max(ruiseki))

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
flag = 1
ls = [0] * (max(a)+1)
#print(ls)
for i in range(n):
    if ls[a[i]] == 1:
        flag = 0
        print("NO")
        break
    else:
        ls[a[i]] = 1
if flag:
    print("YES")
#print(ls)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s =0

print(n,a)

for f in range(n):
  
  for g in range(n):

    if g != f:
    	if a[f] == a[g]:
      		#print(a[f], a[g])
      		s = s+1
      
if s>0: print("NO")
else: print('YES')

Submission status: Runtime Error

Solution code:
A = int(input())
array = list(map(int, input().strip().split()))
count = 0
for i in range(0, A):
  for j in range(i+1, A):
    if i != j:
      if array[i] == array[j]:
          print("NO")
          count = 1

if count = 0:
  print("YES")

Submission status: Runtime Error

Solution code:
A = int(input())
array = list(map(int, input().strip().split()))
count = 0
for i in range(0, A):
  for j in range(i+1, A):
    if i != j:
      if array[i] < array[j] and array[j] % array[i] == 0:
        or array[j] < array[i] and array[i] % array[j] == 0:
          print("YES")
          count = 1

if count = 0:
  print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#入力
n = int(input())

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

result = 'YES'

#処理
for i in range(n):
    for j in range(n):
        if j == i:
            continue
        else:
            if A[i] == A[j]:
                result = 'NO'
                
                goto .end


label.end
#出力
print(result)

Submission status: Runtime Error

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    c = collections.Counter(A)
    C = max(c.values())
    if C > 1 :
        print('NO')
    else:
        print('YES')
resolve()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np


class CountDigits():
    def __init__(self):
        self.digits_count = np.zeros(10 ** 9, dtype=np.int)
        self.isUnique = True

    def check_unique(self, N, A):
        for i in A:
            self.digits_count[i] += 1
            if self.digits_count[i] > 1:
                self.isUnique = False
                break
        return


N = int(input())
A = [int(i) for i in input().split()]
count_digits = CountDigits()
count_digits.check_unique(N, A)
if count_digits.isUnique:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
arr1 = list(map(int(input().split())))
s = set(arr1)
if len(set)==len(arr1):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
import numpy as np


class CountDigits():
    def __init__(self):
        self.digits_count = np.zeros(10 ** 9, dtype=np.int)
        self.isUnique = True

    def check_unique(self, N, A):
        for i in A:
            self.digits_count[i] += 1
            if self.digits_count[i] > 1:
                self.isUnique = False
                break


N = int(input())
A = [int(i) for i in input().split()]
count_digits = CountDigits()
count_digits.check_unique(N, A)
if count_digits.isUnique:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

import math
from functools import reduce

print('YES' if reduce(math.gcd, A) == 1 else 'NO')

Submission status: Runtime Error

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


x = 0
for i in range(k-1, n):
	s = 0
	tmp = []
	for j in range(i-(k-1), i+1):
		tmp.append(p[j])
		s += p[j]
	if x < s:
		x = s
		y = tmp

ans = 0
for i in y:
	a = 0
	for j in range(1, i+1):
		a += j
	ans += a / i

print(ans)

Submission status: Runtime Error

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[i+1]:
            counter += 1
        else:
            break
if counter == 0:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
p=[input() for i in range(2)]
N=int(p[0])
A_1=list(map(int, p[1].split()))
A_2=list(map(int, p[1].split()))
judge=True
for a in A_1:
    del A_2[0]
    for b in A_2:
        if a==b:
            A_1.pop(a)
            A_2.pop(a)
            judge=False
            break
    else:
        continue
    break
if judge:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
n=int(input())
a=input().split()
def main():
  for i in a:
    if not a.rfind(i)==-1:
      return "NO"
  return "YES"
print(main())

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input(),split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

flag=0
for i in range(N):
	count=0
	for j in range(N):
		if a[i]==a[j] and i!=j:
			count+=1
			print("No")
			flag+=count
			break
		else:
			continue
	if count>=1:
		break
if flag==0:
	print("Yes")

Submission status: Runtime Error

Solution code:
def func():
    return

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

'''
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            print("NO")
            exit()
'''
ans = [0]*(max(a)+1)
for ida in a:
    if ans[ida] > 0:
        print("NO")
        exit()
    ans[ida] += 1

print("YES")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n = int(input())
a = np.array(input().split(), dtype='int')

ans = ''
count_all = 0

for j in range(n):
    num = a[j]
    if len(a[a == num]) != 1:
        ans == 'NO'
        break
    a = np.delete(a, j)

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

Submission status: Runtime Error

Solution code:
def func():
    return

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

'''
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            print("NO")
            exit()
'''
ans = [False]*(max(a)+1)
for ida in a:
    if ans[ida]:
        print("NO")
        exit()
    ans[ida] = True

print("YES")

Submission status: Runtime Error

Solution code:
n_dice, n_choice = map(int, input().split())
dice_list = tuple(map(int, input().split()))
sumofarea_list = [sum(dice_list[i:i+n_choice]) for i in range(n_dice - n_choice + 1)]
print(max(sumofarea_list)/2 + n_choice / 2)

Submission status: Runtime Error

Solution code:
n=int(input())
a=map(int,input.split())
def main():
  for i in range(n-1):
    for m in range(i+1,n-i):
      if a[i]==a[m]:
        return "NO"
  return "YES"
print(main())

Submission status: Runtime Error

Solution code:
import sys
a=int(input())
b=list(map(int,input().split()))
c=[]
for i in range(a):
  c+=str(b[i])
  for i in range(len(c)):
    if i==len(c)-1:
      break
    if int(c[i+1])==b[i]:
      print('YES')
      sys.exit()
print('NO')

Submission status: Runtime Error

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

if has_duplicates(A):
  print('NO')
else:
  print('YES')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys
a=int(input())
b=list(map(int,input().split()))
c=[]
for i in range(a):
  c+=str(b[i])
  for i in range(len(c)):
    if int(c[i+1])==b[i]:
      print('YES')
      sys.exit()
print('NO')

Submission status: Runtime Error

Solution code:
import collections
n=int(input())
A = list(map(int, input().split
c=collections.Counter(A)
if c==len(A):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
def main():

    n = int(input())
    num = [int(i) for i in input().split()]
    if len(num) <= 1:
        return "YES"
    else:
        for i in range(len(num+1)):
            if num[i] == num[i + 1]:
                return "YES"
            else:
                return "NO"
print(main())

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
A = list(map(int, input().split
c=collections.Counter(A)
if c==len(A):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
n=int(input())
A = list(map(int, input().split
c=collections.Counter(A)
if c=len(A):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
N = input()
A = input().split()
if n in A:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
p = [int(i) for i in input().split()]
maxp = 0
for i in range(n - k + 1):
    sump = sum(p[i: i + k])
    if maxp < sump:
        maxp = sump
        j = i
print((maxp + k) / 2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
A = input().split()
if n in A:
  print("YES")
else:
  print("NO")
N = int(input())
A = [int(x) for x in input().split()]

if n in A:
  print("YES")
else:
  print("NO")
提出情報
提出日時

Submission status: Runtime Error

Solution code:
import sys
from pprint import pprint

def solve(n, k, p):
    E = [(1.0 + p_i)/2 for p_i in p]
    # pprint(E)
    
    ans = 0
    for i in range(n - k + 1):
        # print(i+3)
        ans = max(ans, sum([E[i+j] for j in range(k)]))
        # print(i, sum([E[i+j] for j in range(k)]))
    print(ans)

if __name__ == '__main__':
    n, k = map(int, sys.stdin.readline().strip().split(" "))
    p = list(map(int, sys.stdin.readline().strip().split(" ")))
    solve(n, k, p)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
dic = {}
flag = 1
ls = [0] * (max(a)+1)
for i in range(n):
    if ls[a[i]] == 1:
        flag = 0
        print("NO")
        break
    else:
        ls[a[i]] = 1

if flag:
    print("YES")

Submission status: Runtime Error

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

if n in A:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
for i in range(n-k+1):
    tmp=sum(p[i:i+k])
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Submission status: Runtime Error

Solution code:
num = input()
str_list = input.split(" ")
 
yes = True

for index, s in enumerate(str_list):
	if s in str_list[:index]:
		yes = False
		break
if yes:
	print("YES")
else:
	print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
    N = int(input())
    A =[]
     
    hantei = True
    tmp = input().split()
     
    for i in range(N):
      tmp_int = int(tmp[i])
      if tmp_int in A:
        hantei = False
      A.append(tmp_int)
      
     
    if(hantei == True):
      print("YES")
    else:
      print("NO")

Submission status: Runtime Error

Solution code:
N = int(input())
num = []
for _ in range(N):
    res = input()
    if res in num:
        print('NO')
        break
    num.append(res)
else:
    print('NO')