Problem:


Score : 300 points

Problem Statement

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:  

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.

Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.

Find the minimum and maximum possible numbers of different colors of the users.  

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.  

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.  

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red".

If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors.

If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.  

Sample Input 3

20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990

Sample Output 3

1 1

All the users are "green", and thus there is one color.



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
gray=brown=green=cyan=blue=yellow=orange=red=num=0
for i in range(n):
    if 1<=a[i]<=399:
        gray=1
    elif 400<=a[i]<=799:
        brown=1
    elif 800<=a[i]<=1199:
        green=1
    elif 1200<=a[i]<=1599:
        cyan=1
    elif 1600<=a[i]<=1999:
        blue=1
    elif 2000<=a[i]<=2399:
        yellow=1
    elif 2400<=a[i]<=2799:
        orange=1
    elif 2800<=a[i]<=3199:
        red=1
    elif 3200<=a[i]:
        num+=1
total=gray+brown+green+cyan+blue+yellow+orange+red
print(total,total+num)

Submission status: Wrong Answer

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

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9
    rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801]

    for ai in a:
        for k in range(9):
            if rate[k] <= ai < rate[k + 1]:
                colors[k] += 1
                break

    count = 0

    for i in range(8):
        if colors[i] > 0:
            count += 1

    print(count, count + colors[8])

Submission status: Wrong Answer

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

i = 0
color = 0
T = list(filter(lambda x:x>=3200,A))
A = list(filter(lambda x:x<3200,A))
while(len(A)>0):
    for R in range(0,2801,400):
        if A[i] >= R and A[i] < R+400:
            A = list(filter(lambda x:x>=R+400,A))
            i=-1
            color+=1
            break
    i+=1
    
min_color = color
max_color = color+len(T)

if min_color==0 and len(T)>0: min_color = 1
    
print(min_color,max_color)

Submission status: Wrong Answer

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

i = 0
color = 0
T = list(filter(lambda x:x>=3200,A))
A = list(filter(lambda x:x<3200,A))
while(len(A)>0):
    for R in range(0,2801,400):
        if A[i] >= R and A[i] < R+400:
            A = list(filter(lambda x:x>=R+400,A))
            i=-1
            color+=1
            break
    i+=1
    
min_color = color
max_color = color+len(T)

if min_color==0 and len(T)>0: min_color = 1
if max_color>8: max_color = 8
    
print(min_color,max_color)

Submission status: Wrong Answer

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

i = 0
color = 0
T = list(filter(lambda x:x>=3200,A))
while(len(T)<len(A)):
    for R in range(0,2801,400):
        if A[i] >= R and A[i] < R+400:
            A = list(filter(lambda x:x>=R+400,A))
            i=-1
            color+=1
            break
    i+=1
    
min_color = color
max_color = color+len(T)

if min_color==0 and len(T)>0: min_color = 1
if max_color>8: max_color = 8
    
print(min_color,max_color)

Submission status: Wrong Answer

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

for i in range(len(a)):
    if 1 <=  a[i] <= 399:
        l[0] = l[0] + 1
    elif 400 <=  a[i] <= 799:
        l[1] = l[1] + 1
    elif 800 <=  a[i] <= 1199:
        l[2] = l[2] + 1
    elif 1200 <=  a[i] <= 1599:
        l[3] = l[3] + 1
    elif 1600 <=  a[i] <= 1999:
        l[4] = l[4] + 1
    elif 2000 <=  a[i] <= 2399:
        l[5] = l[5] + 1
    elif 2400 <=  a[i] <= 2799:
        l[6] = l[6] + 1
    elif 2800 <=  a[i] <= 3199:
        l[7] = l[7] + 1
    else:
        l[8] = l[8] + 1
        
 
       
tokurei = 0        
for i in range(7):
    tokurei = tokurei + l[i]

if tokurei == 0:
    print('1 ' + str(l[8]) )
else:
    flag = 0
    for i in range(8):
        if l[i] > 0:
            flag = flag + 1
    print(str(flag) + ' ' + str(flag + l[8]))

Submission status: Wrong Answer

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

for i in range(len(a)):
    if 1 <=  a[i] <= 399:
        l[0] = l[0] + 1
    elif 400 <=  a[i] <= 799:
        l[1] = l[1] + 1
    elif 800 <=  a[i] <= 1199:
        l[2] = l[2] + 1
    elif 1200 <=  a[i] <= 1599:
        l[3] = l[3] + 1
    elif 1600 <=  a[i] <= 1999:
        l[4] = l[4] + 1
    elif 2000 <=  a[i] <= 2399:
        l[5] = l[5] + 1
    elif 2400 <=  a[i] <= 2799:
        l[6] = l[6] + 1
    elif 2800 <=  a[i] <= 3199:
        l[7] = l[7] + 1
    else:
        l[8] = l[8] + 1
print(l)        
tokurei = 0        
for i in range(7):
    tokurei = tokurei + l[i]

if tokurei == 0:
    print('1 ' + str(l[8]) )
else:
    flag = 0
    for i in range(8):
        if l[i] > 0:
            flag = flag + 1
    print(str(flag) + ' ' + str(flag + l[8]))

Submission status: Wrong Answer

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

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

rate = [0 for _ in range(8)]
xx = 0

for x in a:
    if x<400:
        rate[0] += 1
    elif 400<=x and x<800:
        rate[1] += 1
    elif 800<=x and x<1200:
        rate[2] += 1
    elif 1200<=x and x<1600:
        rate[3] += 1
    elif 1600<=x and x<2000:
        rate[4] += 1
    elif 2000<=x and x<2400:
        rate[5] += 1
    elif 2400<=x and x<2800:
        rate[6] += 1
    elif 2800<=x and x<3200:
        rate[7] += 1
    else:
        xx += 1

cnt = 0
for r in rate:
    if r>0:
        cnt += 1
if xx==0:
    print(str(cnt)+" "+str(cnt))
else:
    if cnt<2:
        print("1 "+str(min(xx+cnt,8)))
    else:
        print(str(cnt)+" "+str(min(xx+cnt,8)))

Submission status: Wrong Answer

Solution code:
input();a=[0]*9
for x in input().split():
    x=int(x)
    if x>3599:x=3200
    a[x//400]+=1
b=sum([1 if x else 0 for x in a[:8]])
print([1,b][b>0],[8,b+a[8]][8-b>a[8]])

Submission status: Wrong Answer

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

for i in range(n):
    b.append(a[i]//400)
for i in range(13):
    if b.count(i) >=1:
        if i<= 7:
            countmax +=1
            countmin +=1
        else:
            countmax += b.count(i)
print(countmin,countmax)

Submission status: Wrong Answer

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

for i in range(n):
    b.append(a[i]//400)
for i in range(1,13):
    if b.count(i) >=1:
        if i<= 7:
            countmax +=1
            countmin +=1
        else:
            countmax += b.count(i)
print(countmin,countmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
S,red = set([]),0
for i in range(N):
    rank = A[i]//400
    if rank < 8:
        S.add(rank)
    else:
        red += 1
print(max(1,len(S)),min(8,len(S)+red))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
S,red = set([]),0
for i in range(N):
    rank = A[i]//400
    if rank < 8:
        S.add(rank)
    else:
        red += 1
print(len(S),min(8,len(S)+red))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
S,red = set([]),0
for i in range(N):
    rank = A[i]//400
    if rank < 8:
        S.add(rank)
    else:
        red += 1
print(len(S),min(N,len(S)+red))

Submission status: Wrong Answer

Solution code:
N=int(input())
t,n=[],0
for s in list(map(int,input().split())):
    for i in range(8):
        if 0+400*i<=s<=399+400*i:
            t.append(i)
            break
    else:
        n+=1
l=len(set(t))
if l==0:
    l+=1
print(str(l)+" "+str(l+n))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(4800//400 + 1)]
for i in a:
    b[i//400] += 1;
t = 0
ans = 0
for i in range(4800//400):
    if b[i] > 0:
        if i < 3200//400:
            ans+=1
        else:
            t+=b[i]
if ans > 0:
    print(ans,t+ans)
else:
    print(1,t)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(lambda x : int(x) // 400, input().split()))
over3200 = sum(list(map(lambda x: 1 if x >= 8 else 0, a)))

count = 0
for i in range(8):
    if i in a:
        count += 1
        
print(max(1, count), min(8, count+over3200))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0] * 8
b = 0
for x in input().split():
    x = int(x)
    if x >= 3200: b += 1
    else: a[x//400] += 1
m = 0
for x in a:
    if x > 0: m += 1
print(m, m + b)

Submission status: Wrong Answer

Solution code:
n=int(input())
mark=[i for i in range(0,3200,400)]
mark.append(99999999999999)
def color(x):
    for i in range(9):
        if mark[i]<=x<mark[i+1]:
            return i     
score=list(map(int,input().split()))
set=set()
special=0
for x in score:
    if x<3200:
        set.add(color(x))
    else:
        special+=1
        
print(max(len(set),1),min(8,len(set)+special))

Submission status: Wrong Answer

Solution code:
n=int(input())
mark=[i for i in range(0,3200,400)]
mark.append(99999999999999)
def color(x):
    for i in range(9):
        if mark[i]<=x<mark[i+1]:
            return i     
score=list(map(int,input().split()))
set=set([])
special=0
for x in score:
    if x<3200:
        set.add(color(x))
    else:
        special+=1
        
print(max(len(set),1),min(8,len(set)+special))

Submission status: Wrong Answer

Solution code:
n=int(input())
mark=[i for i in range(0,3200,400)]
mark.append(99999999999999)
check=[0]*9
def color(x):
    for i in range(9):
        if mark[i]<=x<mark[i+1]:
            return i     
score=list(map(int,input().split()))
count=0
for x in score:
    if x<3200 and check[color(x)]==0:
        check[color(x)]=1
        count+=1
    elif x>=3200:
        check[8]+=1
print(max(count,1),min(8,count+check[8]))

Submission status: Wrong Answer

Solution code:
n=int(input())
mark=[i for i in range(0,3200,400)]
mark.append(99999999999999)
check=[0]*9
def color(x):
    for i in range(len(mark)):
        if mark[i]<=x<mark[i+1]:
            return i
        
score=list(map(int,input().split()))
count=0
for x in score:
    if x<3200 and check[color(x)]==0:
        check[color(x)]=1
        count+=1
    elif x>=3200:
        check[8]+=1

print(max(count,1),min(8,count+check[8]))

Submission status: Wrong Answer

Solution code:
n=int(input())
mark=[i for i in range(0,3200,400)]
mark.append(99999999999999)
check=[0]*9
def color(x):
    for i in range(len(mark)):
        if mark[i]<=x<mark[i+1]:
            return i
        
score=list(map(int,input().split()))
count=0
for x in score:
    if x<3200 and check[color(x)]==0:
        check[color(x)]=1
        count+=1
    elif x>=3200:
        check[8]+=1

def minimum(count):
    return max(count,1)
def maximum(check,count):
    if count+check[8]>=8:
        return 8
    return count+check[8] 
print(minimum(count),maximum(check,count))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
x,y = set(),0
for i in a:
	num = (i-i%400)//400
	if num>=8:
		num = 8
		y += 1
	x.add(num)
if len(x) != 1:
	if 8 in x:
		x.remove(8)
	print(len(x),len(x)+y)
else:
	print(1,1)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
x,y = set(),0
for i in a:
	num = (i-i%400)//400
	if num>=8:
		y += 1
	x.add(min(num,8))
if len(x) != 1:
	if 8 in x:
		x.remove(8)
	print(len(x),len(x)+y)
else:
	print(1,1)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())

colordict = defaultdict(int)
n = 0
for a in map(int, input().split()):
    if a < 400:
        colordict[0] += 1
    elif a < 800:
        colordict[1] += 1
    elif a < 1200:
        colordict[2] += 1
    elif a < 1600:
        colordict[3] += 1
    elif a < 2400:
        colordict[4] += 1
    elif a < 2000:
        colordict[5] += 1
    elif a < 2800:
        colordict[6] += 1
    elif a < 3200:
        colordict[7] += 1
    else:
        n += 1

c = len(colordict.keys())

# 最大値
maxC = min(c + n, 7)

# 最小値
minC = c if c >= 0 else 1
print(minC, maxC)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
cnt=[0]*9
ans=0
for i in l:
    if i>3199:
        i=3200
    cnt[i//400]+=1
for p in range(8):
    i=cnt[p]
    if i!=0:
        ans+=i
print(ans if ans!=0 else 1,ans+cnt[-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[0,0,0,0,0,0,0,0]
f=0
for i in range(n):
  if a[i]//400<8:
    c[a[i]//400]=1
  else:
    f+=1
ans=0
for i in c:
  ans+=i
print(max(1,ans),min(ans+f,8))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[0,0,0,0,0,0,0,0]
f=0
for i in a:
  if i//400<8:
    c[i//400]=1
  else:
    f+=1
ans=0
for i in c:
  ans+=i
print(max(1,ans),min(ans+f,8))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[0,0,0,0,0,0,0,0]
f=0
for i in a:
  if i//400<8:
    c[i//400]=1
  else:
    f+=1
ans=0
for i in c:
  ans+=i
print(ans,min(ans+f,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate = [0 for i in range(9)]
ans = 0

for i in range(n):
    if 1<=a[i] and a[i]<=399:
        rate[0] = 1
    elif 400<=a[i] and a[i]<=799:
        rate[1] = 1
    elif 800<=a[i] and a[i]<=1199:
        rate[2] = 1
    elif 1200<=a[i] and a[i]<=1599:
        rate[3] = 1
    elif 1600<=a[i] and a[i]<=1999:
        rate[4] = 1
    elif 2000<=a[i] and a[i]<=2399:
        rate[5] = 1
    elif 2400<=a[i] and a[i]<=2799:
        rate[6] = 1
    elif 2800<=a[i] and a[i]<=3199:
        rate[7] = 1
    else:
        rate[8] += 1

for i in range(len(rate)-1):
    if rate[i] == 1:
        ans += 1
print('{0} {1}'.format(ans,ans+rate[8]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate = [0 for i in range(9)]
mn,mx = 0,0

for i in range(n):
    if 1<=a[i] and a[i]<=399:
        rate[0] = 1
    elif 400<=a[i] and a[i]<=799:
        rate[1] = 1
    elif 800<=a[i] and a[i]<=1199:
        rate[2] = 1
    elif 1200<=a[i] and a[i]<=1599:
        rate[3] = 1
    elif 1600<=a[i] and a[i]<=1999:
        rate[4] = 1
    elif 2000<=a[i] and a[i]<=2399:
        rate[5] = 1
    elif 2400<=a[i] and a[i]<=2799:
        rate[6] = 1
    elif 2800<=a[i] and a[i]<=3199:
        rate[7] = 1
    else:
        rate[8] += 1
print(rate)

for i in range(len(rate)-1):
    if rate[i] == 1:
        mn += 1
print('{0} {1}'.format(mn,mn+rate[8]))

Submission status: Wrong Answer

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

ans=0
over=0
for rate in a:
	if rate<3200:
		num[int(rate/400)]=True
	else:
		over+=1
for flag in num:
	if flag:
		ans+=1

print(max(ans,1),end="")
print(" ",end="")
print(min(ans+over,8))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
num=[0 for i in range(14)]
for rate in a:
	num[int(rate/400)]+=1

ans=0
for i in range(8):
	if num[i]>0:
		ans+=1
over=0
for i in range(8,14):
	over+=num[i]
print(max(ans,1),end="")
print(" ",end="")
print(min(ans+over,8))

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
lis = []
cou = 0
li = list(map(int,input().split()))
for i in range(n):
    if li[i] >= 3200:
        cou += 1
    else:
        if math.floor(li[i] // 400) not in lis:
            lis.append(li[i] // 400)
if len(lis) == 0:
    print(1,min(len(lis) + cou,8))
else:
    print(len(lis),min(8,len(lis) + cou))

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
lis = []
cou = 0
li = list(map(int,input().split()))
for i in range(n):
    if li[i] >= 3200:
        cou += 1
    else:
        if math.floor(li[i] / 400) not in lis:
            lis.append(li[i] // 400)
if len(lis) == 0:
    print(1,min(len(lis) + cou,8))
else:
    print(len(lis),min(8,len(lis) + cou))

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
lis = []
cou = 0
ans = 0
li = list(map(int,input().split()))
for i in range(n):
    if li[i] >= 3200:
        cou += 1
    else:
        if math.floor(li[i] / 400) not in lis:
            ans += 1
print(ans,min(8,ans + cou))

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
lis = []
cou = 0
li = list(map(int,input().split()))
for i in range(n):
    if li[i] >= 3200:
        cou += 1
    else:
        if math.floor(li[i] / 400) not in lis:
            lis.append(li[i] // 400)
print(len(lis),min(8,len(lis) + cou))

Submission status: Wrong Answer

Solution code:
n = int(input())
lis = []
cou = 0
li = list(map(int,input().split()))
for i in range(n):
    if li[i] >= 3200:
        cou += 1
    else:
        if (li[i] // 400) not in lis:
            lis.append(li[i] // 400)
print(len(lis),min(8,len(lis) + cou))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=set()
fr=0
for i in a:
  x=i//400
  if(x<8):s.add(x)
  else:fr+=1
ki=len(s)
ma=min(ki+fr,8)
mi=max(ki,1)
print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=set()
fr=0
for i in a:
  x=i//400
  if(x<8):s.add(x)
  else:fr+=1
ki=len(s)
print(min(ki+fr,8))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[int(i)//400 for i in input().split()]
s=set()
r=0
for i in range(N):
    if a[i]==7:
        r+=1
    else:
        s.add(a[i])
print("{0} {1}".format(min([1,len(s)]),len(s)+r))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0 for i in range(9)]
for i in range(n):
	if a[i]<=399:
		color[0] += 1
	elif a[i]<=799:
		color[1] += 1
	elif a[i]<=1199:
		color[2] += 1
	elif a[i]<=1599:
		color[3] += 1
	elif a[i]<=1999:
		color[4] += 1
	elif a[i]<=2399:
		color[5] += 1
	elif a[i]<=2799:
		color[6] += 1
	elif a[i]<=3199:
		color[7] += 1
	else:
		color[8] += 1
counter = 0
for i in range(8):
	if color[i] != 0:
		counter += 1
if color[8] == 0:
	print(counter,counter)
else:
	if counter == 0:
		if color[8] >= 8:
			print('1 8')
		else:
			print('1 {0}'.format(color[8]))
	else:
		if color[8] + counter >= 8:
			print('{0} 8'.format(counter))
		else:
			print(counter,color[8]+counter)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
ash=0
brown=0
green=0
lightblue=0
blue=0
yellow=0
orange=0
red=0
ans=0
for i in a:
    if i<=399:
        if ash==0:
            ash+=1
    elif 400<=i<=799:
        if brown==0:
            brown+=1
    elif 800<=i<=1199:
        if green==0:
            green+=1
    elif 1200<=lightblue<=1599:
        if lightblue==0:
            lightblue+=1
    elif 1600<=i<=1999:
        if blue==0:
            blue+=1
    elif 2000<=i<=2399:
        if yellow==0:
            yellow+=1
    elif 2400<=i<=2799:
        if orange==0:
            orange+=1
    elif 2800<=i<=3199:
        if red==0:
            red+=1
    else:
        ans+=1
v=ash+brown+green+lightblue+blue+yellow+orange+red
if v==0:
    print(1,ans)
else:
    print(v,v+ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
ash=0
brown=0
green=0
lightblue=0
blue=0
yellow=0
orange=0
red=0
ans=0
for i in a:
    if i<=399:
        if ash==0:
            ash+=1
    elif 400<=i<=799:
        if brown==0:
            brown+=1
    elif 800<=i<=1199:
        if green==0:
            green+=1
    elif 1200<=i<=1599:
        if lightblue==0:
            lightblue+=1
    elif 1600<=i<=1999:
        if blue==0:
            blue+=1
    elif 2000<=i<=2399:
        if yellow==0:
            yellow+=1
    elif 2400<=i<=2799:
        if orange==0:
            orange+=1
    elif 2800<=i<=3199:
        if red==0:
            red+=1
    else:
        ans+=1
v=ash+brown+green+lightblue+blue+yellow+orange+red
print(v,v+ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
ash=0
brown=0
green=0
lightblue=0
blue=0
yellow=0
orange=0
red=0
ans=0
for i in a:
    if i<=399:
        if ash==0:
            ash+=1
    elif 400<=i<=799:
        if brown==0:
            brown+=1
    elif 800<=i<=1199:
        if green==0:
            green+=1
    elif 1200<=lightblue<=1599:
        if lightblue==0:
            lightblue+=1
    elif 1600<=i<=1999:
        if blue==0:
            blue+=1
    elif 2000<=i<=2399:
        if yellow==0:
            yellow+=1
    elif 2400<=i<=2799:
        if orange==0:
            orange+=1
    elif 2800<=i<=3199:
        if red==0:
            red+=1
    else:
        ans+=1
v=ash+brown+green+lightblue+blue+yellow+orange+red
print(v,v+ans)

Submission status: Wrong Answer

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

dic = {'gray':0,'brown':0,'green':0,'light blue':0,'blue':0,'yellow':0,'orange':0,'red':0,'more':0}
for a in A:
    if 399 >= a >= 1 :
        dic['gray'] += 1
    elif 799 >= a >= 400:
        dic['brown'] += 1
    elif 1199 >= a >= 800:
        dic['green'] += 1
    elif 1599 >= a >= 1200:
        dic['light blue'] += 1
    elif 1999 >= a >= 1600:
        dic['blue'] += 1
    elif 2399 >= a >= 2000:
        dic['yellow'] += 1
    elif 2799 >= a >= 2400:
        dic['orange'] += 1
    elif 3199 >= a >= 2800:
        dic['red'] += 1
    else:
        dic['more'] += 1
        
cnt = 0        
for i in dic.keys():
    if dic[i] != 0:
        cnt += 1
if dic['more'] != 0 and cnt != 0:
    cnt -= 1

c_max = cnt + dic['more']
c_min = cnt

print(c_min,c_max)

Submission status: Wrong Answer

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

dic = {'gray':0,'brown':0,'green':0,'light blue':0,'blue':0,'yellow':0,'orange':0,'red':0,'more':0}
for a in A:
    if 399 >= a >= 1 :
        dic['gray'] += 1
    elif 799 >= a >= 400:
        dic['brown'] += 1
    elif 1199 >= a >= 800:
        dic['green'] += 1
    elif 1599 >= a >= 1200:
        dic['light blue'] += 1
    elif 1999 >= a >= 1600:
        dic['blue'] += 1
    elif 2399 >= a >= 2000:
        dic['yellow'] += 1
    elif 2799 >= a >= 2400:
        dic['orange'] += 1
    elif 3199 >= a >= 2800:
        dic['red'] += 1
    else:
        dic['more'] += 1
        
cnt = 0        
for i in dic.keys():
    if dic[i] != 0:
        cnt += 1
if dic['more'] != 0:
    cnt -= 1

c_max = cnt + dic['more']
c_min = cnt

print(c_min,c_max)

Submission status: Wrong Answer

Solution code:
import math
n=input()
a= [min(math.floor(int(i)//400),8) for i in input().split()]
a7= len(set([i for i in a if i<=7]))
a8= len([i for i in a if i==8])
print(a7,a7+a8)

Submission status: Wrong Answer

Solution code:
n = int(input())
col = [0] * 9
a = list(map(int, input().split()))
mi = 0
for i in a:
    if i < 400:
        col[0] += 1
    elif i < 800:
        col[1] += 1
    elif i < 1200:
        col[2] += 1
    elif i < 1600:
        col[3] += 1
    elif i < 2000:
        col[4] += 1
    elif i < 2400:
        col[5] += 1
    elif i < 2800:
        col[6] += 1
    elif i < 3200:
        col[7] += 1
    else:
        col[8] += 1
for h in col[:-1]:
    mi += 1 if h else 0
print(max(mi, 1), min(8, mi + col[-1]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=[]
anything=0
for i in range(n):
    if 1<=a[i]<=399:
        ans.append(1)
    elif 400<=a[i]<=799:
        ans.append(2)
    elif 800<=a[i]<=1199:
        ans.append(3)
    elif 1200<=a[i]<=1599:
        ans.append(4)
    elif 1600<=a[i]<=1999:
        ans.append(5)
    elif 2000<=a[i]<=2399:
        ans.append(6)
    elif 2400<=a[i]<=2799:
        ans.append(7)
    elif 2800<=a[i]<=3199:
        ans.append(8)
    elif 3200<=a[i]:
        anything+=1
ans_i=list(set(ans))
min_i=len(ans_i)
max_i=len(ans_i)+anything
print(min_i,max_i)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=[]
anything=0
for i in range(n):
    if a[i]<=399:
        ans.append(1)
    elif 400<=a[i]<=799:
        ans.append(2)
    elif 800<=a[i]<=1199:
        ans.append(3)
    elif 1200<=a[i]<=1599:
        ans.append(4)
    elif 1600<=a[i]<=1999:
        ans.append(5)
    elif 2000<=a[i]<=2399:
        ans.append(6)
    elif 2400<=a[i]<=2799:
        ans.append(7)
    elif 2800<=a[i]<=3199:
        ans.append(8)
    elif 3200<=a[i]:
        anything+=1
ans_i=list(set(ans))
min_i=len(ans_i)
max_i=len(ans_i)+anything
print(min_i,max_i)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
ash=0
brown=0
green=0
lightblue=0
blue=0
yellow=0
orange=0
red=0
anything=0
for i in range(n):
    if a[i]<=399:
        ash+=1
    elif 400<=a[i]<=799:
        brown+=1
    elif 800<=a[i]<=1199:
        green+=1
    elif 1200<=a[i]<=1599:
        lightblue+=1
    elif 1600<=a[i]<=1999:
        blue+=1
    elif 2000<=a[i]<=2399:
        yellow+=1
    elif 2400<=a[i]<=2799:
        orange+=1
    elif 2800<=a[i]<=3199:
        red+=1
    elif 3200<=a[i]:
        anything+=1
minn=ash+brown+green+lightblue+blue+yellow+orange+red
max_i=ash+brown+green+lightblue+blue+yellow+orange+red+anything
print(minn,max_i)

Submission status: Wrong Answer

Solution code:
def solve():
    n = int(input())
    A = list(map(int, input().split(" ")))
    colors = [False] * 8
    meta = 0
    for a in A:
        if 1 <= a <= 399:
            colors[0] = True
        elif 400 <= a <= 799:
            colors[1] = True
        elif 800 <= a <= 1199:
            colors[2] = True
        elif 1200 <= a <= 1599:
            colors[3] = True
        elif 1600 <= a <= 1999:
            colors[4] = True
        elif 2000 <= a <= 2399:
            colors[5] = True
        elif 2400 <= a <= 2799:
            colors[6] = True
        elif 2800 <= a <= 3199:
            colors[7] = True
        else:
            meta += 1

    cnt = 0
    for c in colors:
        if c == True:
            cnt += 1

    print(cnt, cnt + meta)


solve()

Submission status: Wrong Answer

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

free = 0
arr = [0] * 8

for i in a:
	limit = 400
	while (limit <= 3200):
		if i < limit:
			arr[(limit // 400)-1] +=  1
			break
		else:
			limit += 400

	if limit== 3600:
		free += 1

color =  0
for i in arr:
	if i > 0:
		color += 1


print(str(max(1,color)) + " " + str(min(color + free,8)))

Submission status: Wrong Answer

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

free = 0
arr = [0] * 8

for i in a:
	limit = 400
	while (limit <= 3200):
		if i < limit:
			arr[(limit // 400)-1] +=  1
			break
		else:
			limit += 400

	if limit== 3600:
		free += 1

color =  0
for i in arr:
	if i > 0:
		color += 1


print(str(color) + " " + str(min(color + free,8)))

Submission status: Wrong Answer

Solution code:
def c_ColorfulLeaderboard(N, A):
    from collections import defaultdict
    color = defaultdict(int)
    other = 0  # レート3200以上の選手の数
    for a in A:
        if 1 <= a <= 399:
            color['gray'] += 1
        elif 400 <= a <= 799:
            color['brown'] += 1
        elif 800 <= a <= 1199:
            color['green'] += 1
        elif 1200 <= a <= 1599:
            color['skyblue'] += 1
        elif 1600 <= a <= 1999:
            color['blue'] += 1
        elif 2000 <= a <= 2399:
            color['yellow'] += 1
        elif 2400 <= a <= 2799:
            color['orange'] += 1
        elif 2800 <= a <= 3199:
            color['red'] += 1
        elif 3200 <= a:
            other += 1
    # => 2 2,3 5,1 1
    return '{} {}'.format(max(1, len(color)), min(len(color) + other, 8))

N=int(input())
A=[int(i) for i in input().split()]
print(c_ColorfulLeaderboard(N, A))

Submission status: Wrong Answer

Solution code:
def c_ColorfulLeaderboard(N, A):
    from collections import defaultdict
    color = defaultdict(int)
    other = 0  # レート3200以上の選手の数
    for a in A:
        if 1 <= a <= 399:
            color['gray'] += 1
        elif 400 <= a <= 799:
            color['brown'] += 1
        elif 800 <= a <= 1199:
            color['green'] += 1
        elif 1200 <= a <= 1599:
            color['skyblue'] += 1
        elif 1600 <= a <= 1999:
            color['blue'] += 1
        elif 2000 <= a <= 2399:
            color['yellow'] += 1
        elif 2400 <= a <= 2799:
            color['orange'] += 1
        elif 2800 <= a <= 3199:
            color['red'] += 1
        elif 3200 <= a:
            other += 1
    if len(color) == 0:
        if other >= 1:
            minimum = 1
    else:
        minimum = len(color)
    maximum = min(len(color) + other, 8)
    return '{} {}'.format(minimum, maximum)

N=int(input())
A=[int(i) for i in input().split()]
print(c_ColorfulLeaderboard(N, A))

Submission status: Wrong Answer

Solution code:
def c_ColorfulLeaderboard(N, A):
    from collections import defaultdict
    color = defaultdict(int)
    other = 0  # レート3200以上の選手の数
    for a in A:
        if 1 <= a <= 399:
            color['gray'] += 1
        elif 400 <= a <= 799:
            color['brown'] += 1
        elif 800 <= a <= 1199:
            color['green'] += 1
        elif 1200 <= a <= 1599:
            color['skyblue'] += 1
        elif 1600 <= a <= 1999:
            color['blue'] += 1
        elif 2000 <= a <= 2399:
            color['yellow'] += 1
        elif 2400 <= a <= 2799:
            color['orange'] += 1
        elif 2800 <= a <= 3199:
            color['red'] += 1
        elif 3200 <= a:
            other += 1
    return '{} {}'.format(len(color), min(len(color) + other, 8))

N=int(input())
A=[int(i) for i in input().split()]
print(c_ColorfulLeaderboard(N, A))

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
xs = list(map(int, input().split()))

min_cnt = Counter()
max_cnt = Counter()

rename = -1
for x in xs:
    if x >= 3200:
        max_cnt[rename] +=1
        rename -= 1
    else:
        max_cnt[x//400] += 1
        min_cnt[x//400] += 1

print(len(min_cnt), len(max_cnt))