TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N= int(input())

A=sorted(list(input().split()))

print(A)

flag=1
for i in range(N-1):
  if A.count(A[i])>1:
    flag=0
    break
if flag==1:
  print('YES')
else:
  print('NO')


N= int(input())

A=sorted(list(input().split()))
flag=1
for i in range(N-1):
  if A[i]==A[i+1]:
    flag=0
    break
if flag==1:
  print('YES')
else:
  print('NO')




Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
l = int(input())
s_nums = input().split(" ")
nums = []
for i in range(len(s_nums)):
  if s_nums[i] not in nums:
    nums.append(s_nums[i])

if len(s_nums)==l:
  print("NO")
else:
  print("YES")

l = int(input())
s_nums = set(input().split(" "))
if len(s_nums)==l:
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = input()
A = list(map(int, input().split()))
if len(A) == len(set(A)):
  print('Yes')
else:
  print('No')

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

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
a = [int(x) for x in input().split()]

result = True

a.sort()

for i in range(len(a)-1):
    if a[i] == a[i+1]:
        result = False
        break

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

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

result = True

a.sort()

for i in range(len(a)-1):
    if a[i] == a[i+1]:
        result = False
        break

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

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
s=int(input())
t=list(map(int,input().split()))
t.sort()
a=0
for i in range(len(t)-1):
  if t[i]==t[i+1]:
    a+=1
    break
if a==1:
  print('No')
else:
  print('Yes')

s=int(input())
t=list(map(int,input().split()))
t.sort()
u=set(t)
if len(t)!=len(u):
  print('No')
else:
  print('Yes')

s=int(input())
t=list(map(int,input().split()))
t.sort()
a=0
for i in range(len(t)-1):
  if t[i]==t[i+1]:
    a=1
    break
if a==1:
  print('No')
else:
  print('Yes')

s=int(input())
t=list(map(int,input().split()))
t.sort()
u=set(t)
a=len(t)
b=len(u)
if a!=b:
  print('Yes')
else:
  print('No')

s=int(input())
t=list(map(int,input().split()))
t.sort()
u=set(t)
a=len(t)
b=len(u)
if a!=b:
  print('No')
else:
  print('Yes')

s=int(input())
t=list(map(int,input().split()))
t.sort()
a=0
for i in range(len(t)-1):
  if t[i]==t[i+1]:
    a=1
    break
if a==1:
  print('NO')
else:
  print('YES')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
a_list = list(map(int, input().split()))
ans = 'Yes'
cheacked = []

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

n = int(input())
a_list = list(map(int, input().split()))
ans = 'YES'
cheacked = {}

for i in a_list:
    if i in cheacked.keys():
        ans = 'NO'
        break
    else:
        cheacked[i] = 0
        
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N=int(input())
ls=[int(s) for s in input().split()]
s=set(ls)
if len(s)==N:
  print('Yes')
else:
  print('No')

N=int(input())
ls=[int(s) for s in input().split()]
s=set(ls)
if len(s)==N:
  print('YES')
else:
  print('NO')

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N=int(input())
A=list(map(int,input().split()))
A=quick_sort(A)
ans="Yes"
if(len(A)>1):
    for i in range(len(A)):
        if(A[i-1]==A[i]):
            ans="NO"
            break
        else:
            pass
else:
    pass
print(ans)

def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N=int(input())
A=list(map(int,input().split()))
A=quick_sort(A)
ans="Yes"
if(len(A)>1):
    for i in range(len(A)):
        if(A[i-1]==A[i]):
            ans="NO"
            break
        else:
            pass
else:
    pass
print(ans)

def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N=int(input())
A=list(map(int,input().split()))
A=quick_sort(A)
ans="Yes"
for i in range(len(A)):
    if(A[i-1]==A[i]):
        ans="NO"
        break
    else:
        pass
print(ans)

def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N=int(input())
A=list(map(int,input().split()))
A=quick_sort(A)
ans="YES"
if(len(A)>1):
    for i in range(len(A)):
        if(A[i-1]==A[i]):
            ans="NO"
            break
        else:
            pass
else:
    pass
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n=int(input())
a=map(int,input().split())
if len(a)==list(set(a)):
  print("Yes")
else:
  print("No")

def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
a=n1()

print("YES" if len(a)==len(list(set(a))) else "NO")

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
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'

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

N = int(input())
An = list(map(int, input().split()))
Bn = sorted(An)

y = -1
count = 0
for x in Bn:
    if x == y:
        count += 1
    y = x

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
import sys
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")
        sys.exit()

print("Yes")


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

print("YES")


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
i=input;print(['YES','NO'][int(i())==len(set(i().split()))])

i=input;print(['NO','YES'][int(i())==len(set(i().split()))])

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = sorted(input().split())

if A == sorted(list(set(A))):
    print("Yes")
else:
    print("No")

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

if A == sorted(list(set(A))):
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
from collections import Counter


n = int(input())
ai = list(map(int, input().split()))
c = max(Counter(ai).values())

# Calculating if the input is pairwise distinct or not
if c > 1:
    print('No')
else:
    print('Yes')


from collections import Counter


intNums = int(input())
intList = list(map(int, input().split()))
c = max(Counter(intList).values())

# Calculating if the input is pairwise distinct or not
if c > 1:
    print('NO')
else:
    print('YES')

# Check out my Youtube channel! https://www.youtube.com/channel/UCMOKVyAbTZOpKikTrX5dy_A


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
Aset = set(A)
if len(A) == len(Aset):
    print("Yes")
else:
    print("No")

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

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
B = set(A)
if len(A)==len(B):
  print('Yes')
else:
  print('No')

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
a = set(input().split())

print('YES' if len(s) == n else 'NO')

n = int(input())
a = set(input().split())

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

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N=input()
A = list(map(int, input().split()))
A_set = set(A)

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

N=input()
A = list(map(int, input().split()))
A_set = set(A)

if len(A)==len(A_set):
  print('YES')
else:
  print('NO')

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

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

n = int(input())
a = [int(i) for i in input().split()]
a1 =  set(a)
if len(a) != len(a1):
    print('NO')
else:
    print('YES')

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
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')

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

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
A = [int(x) for x in input().split()]

judge = True
if len(A) != len(set(A)):
    judge = False
if judge == True:
    print('Yes')
else:
    print('No')

n = int(input())
A = [int(x) for x in input().split()]

judge = True
if len(A) != len(set(A)):
    judge = False

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

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
function Main(input) {
	var str = input;
	var ans = "YES";
	str = str.split("\n");
	var l = str[1].split(" "); 
	loop:
	for(var j =0;j< l.length-1;j++){	
 		for(var i =1; i<l.length;i++){
 			 if(l[j]===l[i]){
	 			ans = "NO";
	 			break loop;
 			}	 	
 		}
	} 	
	console.log(ans);
}
 //*おまじない
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        print('NO')
        exit()
print('YES')


Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):

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

if flag:
    print('YES')

from collections import Counter
N=int(input())
flag=True
inList=list(map(int,input().split()))

c=Counter(inList)
cv=list(c.values())
for i in cv:
    if i!=1:
        print('NO')
        flag=False
        break
if flag:
    print('YES')

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
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)


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'

N = int(input())
P = list(map(int, input().split()))
count = 1
for i in range(1, N):
  if P[i] <= min(P[0:i]):
    count += 1
print(count)


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)


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)


N = int(input())
A = list(map(int,input().split()))
A.sort()
def yabaton(a):
  n = len(a)
  for i in range(n-1):
    if a[i] != a[i+1]:
      return 'NO'
  return 'YES'

N = int(input())
A = list(map(int,input().split()))
A.sort()
def yabaton(a):
  n = len(a)
  for i in range(n-1):
    if a[i] != a[i+1]:
      return 'NO'
  return 'YES'
yabaton(A)

N = int(input())
A = list(map(int,input().split()))
def yabaton(A):
  n = len(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)


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)


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'


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

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)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))

h = {}
ans = 'Yes'
for i in range(N):
    a = h.get(A[i], 0)
    if a != 0:
        ans = 'No'
        break
    h[A[i]] = A[i]
print(ans)

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

h = {}
ans = 'YES'
for i in range(N):
    a = h.get(A[i], 0)
    if a != 0:
        ans = 'NO'
        break
    h[A[i]] = A[i]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
import sys

def main():

    

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

if __name__ == '__main__':
    main()


import sys

def main():

    

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

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
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")
      quit()
print("Yes")

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

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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
an = list(map(int, input().split()))

def distinct_or_not(an):
    an_dict = {}
    for a in an:
        if a in an_dict:
            return False
        else:
            an_dict[a] = 1
    return True
  
if distinct_or_not(an):
    print('Yes')
else:
    print('No')

n = int(input())
an = list(map(int, input().split()))
 
def distinct_or_not(an):
    an_dict = {}
    for a in an:
        if a in an_dict:
            return False
        else:
            an_dict[a] = 1
    return True
  
if distinct_or_not(an):
    print('YES')
else:
    print('NO')

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
li = list(map(int,input().split()))

li0 = sorted(li)

print(li)
print(li0)

j = 0
for i in range(n):
  if li0[i-1]==li0[i]:
    j = 1

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

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

li0 = sorted(li)

j = 0
for i in range(n):
  if li0[i-1]==li0[i]:
    j = 1

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


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
m = list(map(int,input().split()))
m.sort()
for i in range(n):
  if m[i] == m[i+1]:
    print('NO')
    exit()
    
print('YES')

n = int(input())
m = list(map(int,input().split()))
m.sort()
for i in range(n-1):
  if m[i] == m[i+1]:
    print('NO')
    exit()
    
print('YES')

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))

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


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

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


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = input()
a = list(map(int, input().split()))
b = len(list(map(int, input().split())))
s = set(a)
if len(a) == len(s):
    print('YES')
else:
    print('NO')

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

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    tmp = {}
    is_unique = True
    for i in range(n):
        if not a[i] in tmp:
            is_unique = False
            break
        tmp[a[i]] = a[i]
    
    if is_unique:
        print("YES")
    else:
        print("NO")


if __name__=="__main__":
    main()


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


if __name__=="__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))

B = set(A)

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

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

B = set(A)

if len(A) == len(B):
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
from collections import Counter
N=int(input())
A=list(map(int, input().split()))
count=0
B=Counter(A)
for i in B.values():
	if i!=1:
		count+=1
		break
if count==1:
	print('No')
else:
	print('Yes')

from collections import Counter
N=int(input())
A=list(map(int, input().split()))
B=Counter(A)
if len(A)==len(B):
	print('Yes')
else:
	print('No')

from collections import Counter
N=int(input())
A=list(map(int, input().split()))
B=Counter(A)
print(len(A))
print(len(B))
if len(A)==len(B):
	print('YES')
else:
	print('NO')

from collections import Counter
N=int(input())
A=list(map(int, input().split()))
count=0
B=Counter(A)
for i in B.values():
	if i!=1:
		count+=1
if count==0:
	print('Yes')
else:
	print('No')

from collections import Counter
N=int(input())
A=list(map(int, input().split()))
B=Counter(A)
if len(A)==len(B):
	print('YES')
else:
	print('NO')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
import sys
N = int(input())
list = list(map(int, input().split()))
  
for i in range(N):
  for j in range(N):
    if list[i] == list[j]:
      print("NO")
      sys.exit()
print("YES")

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



if ((len(list)) == (len(set(list)))) == True:
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
j = True

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

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

if len(A) == len(set(A)):
    print("YES")
else:
    print("NO")


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
# coding: utf-8

import collections

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

if len(collections.Counter(a_list))==len(a_list):
    print("Yes")
else:
    print("No")

# coding: utf-8

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

if len(a_list)==len(set(a_list)):
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
#154
N = int(input())
A = [int(input()) for i in range(N)]
A_set = set(A)
if(len(A)==len(A_set)):
    print('YES')
else:
    print('NO')

#154
N = int(input())
A = map(int,input().split())
A_set = set(A)
if(len(A)==len(A_set)):
    print('YES')
else:
    print('NO')

#154
N = int(input())
A = list(map(int,input().split()))
A_set = set(A)
if(len(A)==len(A_set)):
    print('YES')
else:
    print('NO')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
a=map(int,input().split())
A=list(map(int,input().split()))
T=set(A)
if len(A)==len(T):
  print("Yes")
else:
  print("No")

a=input()
A=list(map(int,input().split()))
T=set(A)
if len(A)==len(T):
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
A = list(map(int, input().split()))
s = set()

for a in A:
    if a in s:
        print('No')
        break
    s.add(a)
else:
    print('Yes')

n = int(input())
A = list(map(int, input().split()))
s = set()

for a in A:
    if a in s:
        print('NO')
        break
    s.add(a)
else:
    print('YES')

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = input()
A = list(map(int, input().split()))

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

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

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
r = 0
n = int(input())
a = sorted(list(map(int, input().split())))
for i in range(n - 1):
  if a[i] ==  a[i + 1]:
    r = 1
if r == 1:
  print("No")
else:
  print("Yes")

r = 0
n = int(input())
a = sorted(list(map(int, input().split())))
for i in range(n - 1):
  if a[i] ==  a[i + 1]:
    r = 1
if r == 1:
  print("NO")
else:
  print("YES")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
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")
        exit(0)

print("Yes")

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

if len(a) == len(a_set):
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
integers = list(map(int,input().split()))

def has_duplicates(seq):
    if len(seq) != len(set(seq)):
        return 'YES'
    else:
        return 'NO'

print(has_duplicates(integers))


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

def has_duplicates(seq):
    if len(seq) != len(set(seq)):
        return 'NO'
    else:
        return 'YES'

print(has_duplicates(integers))


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
    print("NO")


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

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
_list = input()

num_list = _list.split(' ')

for num in num_list:
  if num_list.count(num) > 1:
    print('No')
    break
else:
  print('Yes') 

_ = input()
_list = input()

num_list = _list.split(' ')

for num in num_list:
  if num_list.count(num) > 1:
    print('No')
    break
else:
  print('Yes') 

import collections

_ = input()
_list = input()
 
num_list = _list.split(' ')
 
c = collections.Counter(num_list)
if c.most_common()[0][1] > 1:
  print('NO')
else:
  print('YES')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
A = list(map(int,input().split()))
print("Yes") if len(A) == len(set(A)) else print("No")

n = int(input())
A = list(map(int,input().split()))
print("YES") if len(A) == len(set(A)) else print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
S = list(set(A))
if len(A) == len(S):
  return "YES"
else:
  return "NO"

N = int(input())
A = list(map(int, input().split()))
S = list(set(A))

if len(A) == len(S):
  print("YES")
else:
  print("NO")

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = int(input())
A = [int(e) for e in input().split()]

if length(set(A)) == length(A):
  print("YES")
else:
  print("NO")

n = int(input())
A = [int(e) for e in input().split()]

if len(set(A)) == len(A):
  print("YES")
else:
  print("NO")


Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n = input()
a_list = list(map(int, input().split()))
a_set = set(a)

if len(a_list) == len(a_set):
  print("YES")
else:
  print("NO")

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

if len(a_list) == len(a_set):
  print("YES")
else:
  print("NO")

n = input()
a_list = list(map(int, input().split()))
a_set = set(a_list)

if len(a_list) == len(a_set):
  print("YES")
else:
  print("NO")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
print(A)
if N==len(A):
    print('YES')
else:
    print('NO')

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

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
def main(n, a):
    if len(set(a)) == n:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    map(n, a)


def main(n, a):
    if len(set(a)) == n:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

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

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


# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

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

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


# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()] 

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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
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")

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

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
import collections
N = int(input())
A = list(input().split())
l = collections.Counter(A)
if len(l) == len(A):
    print("Yes")
else:
    print("No")

import collections
N = int(input())
A = list(input().split())
l = collections.Counter(A)
if N == len(l):
    print("Yes")
elif N != len(l):
    print("No")

import collections
N = int(input())
A = list(input().split())
l = collections.Counter(A)
if N == len(l):
    print("Yes")
elif N != len(l):
    print("No")

import collections
N = int(input())
A = list(map(int, input().split()))
l = collections.Counter(A)
if N == len(l):
    print("Yes")
elif N != len(l):
    print("No")

import collections
N = int(input())
A = list(input().split())
l = collections.Counter(A)
if N == len(l):
    print("Yes")
elif N == len(l):
    print("No")

import collections
N = int(input())
A = list(map(int, input().split()))
l = collections.Counter(A)
if N == len(l):
    print("YES")
elif N != len(l):
    print("NO")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
if len(list(set(a)))==len(a):
    print("Yes")
else:print("No")


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

if len(set(a))==len(a):
    print("Yes")
elif len(set(a))!=len(a):
    print("No")



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



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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if A[i] == A[i+1]:
        f = 1
        break
        
if f > 0:
    print("NO")
else:
    print("YES")



N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    # if A.count(i) > 1:
    if A[i] == A[i+1]:
        f = 1
        break
        
if f > 0:
    print("NO")
else:
 print("YES")
    


N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if i != len(A)-1:
        if A[i] == A[i+1]:
            f = 1
            break
        
if f > 0:
    print("NO")
else:
    print("YES")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):

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

A = sorted(A)

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

print("Yes")
    
    



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

A = sorted(A)

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

print("YES")
    

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
s = input()
a = map(int, input().lower().split())

if int(s) == len(set(a)):
  print("YESS")
else:
  print("NO")


s = input()
a = map(int, input().lower().split())
 
if int(s) == len(set(a)):
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
f=1
for i in range(n-1):
	if l[i]==l[i+1]:
      f=0
      break
if f:
	print("YES")
else:
	print("NO")

n=int(input())
l=list(map(int,input().split()))
f=1
for i in range(n-1):
	if l[i]==l[i+1]:
        f=0
        break
if f:
	print("YES")
else:
	print("NO")


n=int(input())
l=list(map(int,input().split()))
if len(set(l))==n:
    print("YES")
else:
    print("NO")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
s=input()
t=list(map(int,input().split()))
u=len(t)
v=len(set(t))

if u == v:
  print("Yes")
else:
  print("No")

s=input()
t=list(map(int,input().split()))
u=len(t)
v=len(set(t))

if u == v:
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
n=int(input())
a=[int(x) for x in input().split()]

if len(a) != set(a):
    print("NO")
else:
    print("YES")


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

if len(a) != len(set(a)):
    print("NO")
else:
    print("YES")


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print `YES`; otherwise, print `NO`.

Submission attempts (in order):
N=int(input())
num=list(map(int,input().split()))
#print(num)
num.sort()
ans=0
for i in range(N-1):
    if num[i]==num[i+1]:
        ans=1
        break
if ans==0:
    print("Yes")
if ans==1:
    print("No")

N=int(input())
num=list(map(int,input().split()))
#print(num)
num.sort()
ans=0
for i in range(N-1):
    if num[i]==num[i+1]:
        ans=1
        break
if ans==0:
    print("YES")
if ans==1:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: We have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.  We will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.

Submission attempts (in order):
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')

import math

n,k = input().split()
p = input().split()

n = int(n)
k = int(k)
#p = [int(s) for s in p]

#print(p)

ex =0
ext = []
ext2 = []
for f in range(n):
    pi = int(p[f])
    xs =(pi+1)/2
    ext.append(xs)

ext2.append(ext[0])
for i in range(1,n):
    ext2.append(ext2[i-1]+ext[i])

ex = ext2[k-1]
for j in range(1,n-k+1):
    ext3 =ext2[j+k-1]-ext2[j-1]
    if ext3 > ex: ex = ext3

print('{:.12f}'.format(ex))

Verdicts: Runtime Error

Accepted
Problem: We have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.  We will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.

Submission attempts (in order):
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))

em = 0
exp = []
for i in range(n-k+1):
  temp = sum(p[i:i+k])
  if em <= temp:
    em = temp
    exp = p[i:i+k]

    
print(sum([(pi + 1) / 2 for pi in exp]))

import numpy as np
n, k = list(map(int, input().split()))
dice = list(map(int, input().split()))
sort_dice = sorted(dice, reverse=True)[:k]

sort_p = 1. / np.array(sort_dice)
sort = np.array([sum([j+1 for j in range(i)]) for i in sort_dice])
print(np.sum(sort_p * sort))

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

expect = [(pi+1) / 2 for pi in p]

em = 0
for i in range(n-k+1):
  em = max(em, sum(expect[i:i+k]))

print(em)

n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
exp = [sum([(pi + 1) / 2 for pi in p[i:i+k]]) for i in range(n-k+1)]
print(max(exp))

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

def expect(p):
  return (p + 1) / 2

l = [0 for i in range(n+1)]
for i in range(1, n+1):
  l[i] = expect(p[i-1]) + l[i-1]

ans = 0
for i in range(k, n+1):
  ans = max(ans, l[i] - l[i-k])
print("{:.12f}".format(ans))

Verdicts: Time Limit Exceeded

Wrong Answer

Time Limit Exceeded

Time Limit Exceeded

Accepted
Problem: We have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.  We will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.

Submission attempts (in order):
N, K = map(int, input().split())
p = list(map(int, input().split()))
 
now = sum(p[:K])
saidai = now
for i in range(K, N):
  now -= p[i-K]
  now += p[i+K]
  if now > saidai:
    saidai = now

print('{:.12f}'.format((saidai + K)/2))

N, K = map(int, input().split())
p = list(map(int, input().split()))
 
now = sum(p[:K])
saidai = now
for i in range(K, N):
  now -= p[i-K]
  now += p[i]
  if now > saidai:
    saidai = now
 
print('{:.12f}'.format((saidai + K)/2))

Verdicts: Runtime Error

Accepted
Problem: We have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.  We will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.

Submission attempts (in order):

def Main(N, K, P):
    wa = sum(P[:K])
    max_sum = wa
    max_sum_ind = 0
    for i in range(N-K-1):
        wa = wa - P[i] + P[i+K]
        if(wa > max_sum):
            max_sum = wa
            max_sum_ind = i
    ans = 0
    for i in range(max_sum_ind+1, max_sum_ind+K+1):
        ans += (P[i]+1)/2
    return ans

def main():
    N, K = map(int, input().split())
    P = list(map(int, input().split()))
    print("{:.12f}".format(Main(N, K, P)))

if __name__ == '__main__':
    main()


def Main(N, K, P):
    wa = sum(P[:K])
    max_sum = wa
    max_sum_ind = 0
    for i in range(N-K):
        wa = wa - P[i] + P[i+K]
        if(wa > max_sum):
            max_sum = wa
            max_sum_ind = i
    ans = 0
    if max_sum_ind == 0:
        for i in range(K):
            ans += (P[i]+1)/2
    else:
        for i in range(max_sum_ind+1, max_sum_ind+K+1):
            ans += (P[i]+1)/2
    return ans

def main():
    N, K = map(int, input().split())
    P = list(map(int, input().split()))
    print("{:.12f}".format(Main(N, K, P)))

if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
Problem: We have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.  We will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.

Submission attempts (in order):
n,k = map(int, input().split())
p = list(map(int, input().split()))
for i in range(n):
    p[i] = (p[i] + 1)/2
ans = 0
tmp = 0
for i in range(k):
    tmp += p[i]
for i in range(1,n - k + 1):
    tmp = tmp - p[i - 1] + p[i + k - 1]
    if ans < tmp:
        ans = tmp
print("{:.10f}".format(ans))


n,k = map(int, input().split())
p = list(map(int, input().split()))
for i in range(n):
    p[i] = (p[i] + 1)/2
ans = 0
tmp = 0
for i in range(k):
    tmp += p[i]
    ans += p[i]
for i in range(1,n - k + 1):
    tmp = tmp - p[i - 1] + p[i + k - 1]
    if ans < tmp:
        ans = tmp
print("{:.12f}".format(ans))


Verdicts: Wrong Answer

Accepted
Problem: We have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.  We will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.

Submission attempts (in order):
n, k = map(int, input().split())
p = [(int(i)+1.0)/2.0 for i in input().split()]
ans = 0
tmp = p[:k]
for i in range(k,n):
    tmp += p[i]-p[i-k]
    ans = max(ans, tmp)
print('{:.12f}'.format(ans))


n, k = map(int, input().split())
p = [(int(i)+1.0)/2.0 for i in input().split()]
ans = tmp = 0
for i in range(n-k):
    tmp += p[i]-p[i+k]
    ans = max(ans, tmp)
print('{:.12f}'.format(ans))


n, k = map(int, input().split())
p = [(int(i)+1.0)/2.0 for i in input().split()]
ans = tmp = sum(p[:k])
for i in range(k,n):
    tmp += p[i]-p[i-k]
    ans = max(ans, tmp)
print('{:.12f}'.format(ans))


Verdicts: Runtime Error

Wrong Answer

Accepted