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

Solution code:
N=int(input())
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
orange=0
red=0
qq=0
minimo=0
maximo=0
qtdCores=0
while N>0:
    a=int(input())
    if a>=1 and a<=399:
        gray+=1
    elif a>=400 and a<=799:
        brown+=1
    elif a>=800 and a<=1199:
        green+=1
    elif a>=1200 and a<=1599:
        cyan+=1
    elif a>=1600 and a<=1999:
        blue+=1
    elif a>=2000 and a<=2399:
        yellow+=1
    elif a>=2400 and a<=2799:
        orange+=1
    elif a>=2800 and a<=3199:
        red+=1
    else:
        qq+=1
    N=N-1
if gray>0:
    qtdCores+=1
if brown>0:
    qtdCores+=1
if green > 0:
    qtdCores+=1
if cyan > 0:
    qtdCores+=1
if blue>0:
    qtdCores+=1
if yellow > 0:
    qtdCores+=1
if orange > 0:
    qtdCores+=1
if red > 0:
    qtdCores+=1
if qq==0:
    minimo=qtdCores
    maximo=qtdCores
else:
    minimo=qtdCores
    maximo=qtdCores+qq
print(minimo,maximo)

Submission status: Runtime Error

Solution code:
Nc = input()
N = int(Nc)
cor = ''
c = map(int,input().split())
l = list(c)
l2 = []
l3 = []
maxL = 0


for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int:
        if  1 <= num <= 399:
            cor = 'cinzento'
            l2.append(cor)
        elif 400 <= num <= 799:
            cor = 'castanho'
            l2.append(cor)
        elif 800 <= num <= 1199:
            cor = 'verde'
            l2.append(cor)
        elif 1200 <= num <= 1599:
            cor = 'ciano'
            l2.append(cor)
        elif 1600 <= num <= 1999:
            cor = 'azul'
            l2.append(cor)
        elif 2000 <= num <= 2399:
            cor = 'amarelo'
            l2.append(cor)
        elif 2400 <= num <= 2799:
            cor = 'laranja'
            l2.append(cor)
        elif 2800 <= num <= 3199:
            cor = 'vermelho'
            l2.append(cor)
        else:
            cor = input()
            maxL = maxL+1
        
print(l2)
for color in l2:
    if color not in l3 :
        l3.append(color)
        maxL = maxL+ 1
print(len(l3), maxL)

Submission status: Runtime Error

Solution code:
li=[0]*8
o=0
n,*a=map(int,open(0).read().split())
for i in a:
  if i>=3200:
    o+=1  
  else:
    li[i//400]=1

#全員3200以上==(sum(li)==0)> 1,min(o,8)
#全員3200未満==(o==0)> sum(li),min(sum(li)+o,8)
#それ以外>sum(li)
if sum(li)==0:
  print(1,min(o,8))
else:
  print(sum(li),min(sum(li)+o,8)

Submission status: Runtime Error

Solution code:
n,*a=map(int,open(0).read().split())
""" 
1 399：灰色 
400 799：茶色
800 1199：緑色
1200 1599：水色 
1600 1999：青色 
2000 2399：黄色 
2400 2799：橙色
2800 3199：赤色
"""
if n=1:
  print(1,1)
  exit()

li=[False]*8
over3200=0
for i in a:
  if i>=3200:
    over3200+=1
  else:
    li[(i//400)]=True
    
k=sum(li)
print(k,k+over3200)

Submission status: Runtime Error

Solution code:
color = [0 for i in range(8)]

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

p = 0
for a in al:
    if a < 3200:
        color[a//400] = 1
    else:
        p += 1
print(max(sum(color), 1))
print(min(sum(color) + p))

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 8
for p in a:
    if p >= 3200: color[8] += 1
    else: color[p // 400] += 1
small = len([c for c in color[0:8] if c > 0])
big = small + color[8]
if not small: small += 1
print(small, big)

Submission status: Runtime Error

Solution code:
N = int(input())
L = [0 for i in range(9)]
S = list(map(int, input().split()))
for i in range(N):
  L[S[i] // 400] += 1
Z, M, m = 0, 0, 0
for i in range(8):
  if L[i] == 0:
    Z += 1
  else:
    M += 1
    m += 1
M += min(Z, L[8])
print(m, M)

Submission status: Runtime Error

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))

c = [0] * 9
for i in a:
    if i >= 3200:
        c[8] += 1
    else:
        for j in range(9):
            if 400 * j <= i < 400 * j + 399:
                c[j] += 1

if c[8] > 0:
    resmin = len([i for i in c[:8] if i > 0])
    if resmin == 0:
        resmin = 1
    resmax = resmin + c[8] % (8 - resmin)
    print(str(resmin) + ' ' + str(resmax))
else:
    res = len([i for i in c if i > 0])
    print(str(res) + ' ' + str(res))

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int,input().split()))
col = [0]*8
wild = 0
for i in a:
    if i//400 <= 7:
        col[i//400] = 1
    else:
        wild += 1
minimum = max(1,sum(col))
maximum = min(sum(col)+wild)
print(minimum,maximum)

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(9)]
for i in range(N):
    num[a[i]//400] += 1

if num[-1] == 0:
    num = [i for i in num if i != 0]
    print(len(num),len(num))
else:
    n = num.pop(-1)
    num2 = [i for i in num if i != 0]
    print(len(num2),min(8,len(num2)+n))

Submission status: Runtime Error

Solution code:
n=int(input())
a=sorted(list(map(int,input().split())))
c=[0]*8
k=-1
for i in range(n):
    if a[i]<400:
        c[0]=1
    elif a[i]<800:
        c[1]=1
    elif a[i]<1200:
        c[2]=1
    elif a[i]<1600:
        c[3]=1
    elif a[i]<2000:
        c[4]=1
    elif a[i]<2400:
        c[5]=1
    elif a[i]<2800:
        c[6]=1
    elif a[i]<3200:
        c[7]=1
    else:
        k=i
        break

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if k==-1:
    w
    print(d)
else:
    print(min(8,d+(n-k)))

Submission status: Runtime Error

Solution code:
n=int(input())
a=sorted(list(map(int,input().split())))
c=[0]*8
k=-1
for i in range(n):
    if a[i]<400:
        c[0]=1
    elif a[i]<800:
        c[1]=1
    elif a[i]<1200:
        c[2]=1
    elif a[i]<1600:
        c[3]=1
    elif a[i]<2000:
        c[4]=1
    elif a[i]<2400:
        c[5]=1
    elif a[i]<2800:
        c[6]=1
    elif a[i]<3200:
        c[7]=1
    else:
        k=i
        break

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if d==0:
    w
    print(1, end=" ")
else:
    print(d, end=" ")

if k==-1:
    print(d)
else:
    print(min(8,d+(n-k)))

Submission status: Runtime Error

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

l = [0] * 9

for i in range(n):
    s = min(a[i] // 400, 9)
    l[s] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

M = min(9, l[-1] + m)
print(m, M)

Submission status: Runtime Error

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

l = [0] * 9

for i in range(n):
    l[a[i] // 400] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

M = min(9, l[-1] + m)
print(m, M)

Submission status: Runtime Error

Solution code:
#ABC64C
n = int(input())
a = list(map(int,input().split()))
c = set()
d = 0
fot i in a:
    c = a  // 400:
    if c < 8:
        b.add(c)
    else:
        d += 1:
print(len(b) len(b)+d)

Submission status: Runtime Error

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

def CheckColor(a):
    global free_count
    if 1 <= 0 a and a <= 399:
        return 'gray'
    elif 400 <= a and a <= 799:
        return 'blown'
    elif 800 <= a and a <= 1199:
        return 'green'
    elif 1200 <= a and a <= 1599:
        return 'water'
    elif 1600 <= a and a <= 1999:
        return 'blue'
    elif 2000 <= a and a <= 2399:
        return 'yellow'
    elif 2400 <= a and a <= 2799:
        return 'orange'
    elif 2800 <= a and a <= 3199:
        return 'red'
    else:
        free_count += 1
        return 'free'

def Max(L):
    global gree_count
    max_num = min_num + free_count
    if max_num > 7:
        return 7        
    else:
        return max_num

def Min(L):
    global min_num
    if 'free' in ans_set:
        min_num = len(L) - 1
    else:
        min_num = len(L)
    return min_num


ans_list = []
count = 0
min_num = 0
free_count = 0

for a in A:
    ans_list.append(CheckColor(a))

ans_set = set(ans_list)

print(Min(ans_set), Max(ans_set))

Submission status: Runtime Error

Solution code:
N = int(input())
color = [0]*8
free = 0
for _ in range(N):
    a  = int(input())
    if 1<=a<=399:
        color[0] = 1
    elif 400<=a<=799:
        color += 1
    elif 800<=a<=1199:
        color += 1
    elif 1200<=a<=1599:
        color += 1
    elif 1600<=a<=1999:
        color += 1
    elif 2000<=a<=2399:
        color += 1
    elif 2400<=a<=2799:
        color += 1
    elif 2800<=a<=3199:
        color += 1
    else:
        free += 1
maxcolor = sum(color)+free
mincolor = sum(color)
print(mincolor,maxcolor)

Submission status: Runtime Error

Solution code:
N = int(input())
color = [0]*8
free = 0
for _ in range(N):
    a  = int(input())
    if 1<=a<=399:
        color[0] = 1
    elif 400<=a<=799:
        color += 1
    elif 800<=a<=1199:
        color += 1
    elif 1200<=a<=1599:
        color += 1
    elif 1600<=a<=1999:
        color += 1
    elif 2000<=a<=2399:
        color += 1
    elif 2400<=a<=2799:
        color += 1
    elif 2800<=a<=3199:
        color += 1
    else:
        free += 1
maxcolor = sum(color)+free
mincolor = sum(color)
print(mincolor,maxcolorx)

Submission status: Runtime Error

Solution code:
N = int(input())

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

color = [0] * 8

a = 400 
free = 0
    
for i in range(0,N):
    if rate[i] < a:
        color[0] = 1
    elif a <= rate[i] < 2*a:
        color[1] = 1
    elif 2*a <= rate[i] < 3*a:
        color[2] = 1
    elif 3*a <= rate[i] < 4*a:
        color[3] = 1
    elif 4*a <= rate[i] < 5*a:
        color[4] = 1
    elif 5*a <= rate[i] < 6*a:
        color[5] = 1
    elif 6*a <= rate[i] < 7*a:
        color[6] = 1
    elif 7*a <= rate[i] < 8*a:
        color[7] = 1
    elif 8*a <= rate[i]:
        free += 1
        

min_color = 0
max_color = 0

min_color = color.count(1)
max_color = min_color + color[8]

print( max(min_color,1), max_color)

Submission status: Runtime Error

Solution code:
N = int(input())

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

color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] = 1
        elif a <= rate[i] < 2*a:
            color[1] = 1
        elif 2*a <= rate[i] < 3*a:
            color[2] = 1
        elif 3*a <= rate[i] < 4*a:
            color[3] = 1
        elif 4*a <= rate[i] < 5*a:
            color[4] = 1
        elif 5*a <= rate[i] < 6*a:
            color[5] = 1
        elif 6*a <= rate[i] < 7*a:
            color[6] = 1
        elif 7*a <= rate[i] < 8*a:
            color[7] = 1

min_color = 0
max_color = 0


min_color = color.count(1)
max_color = min_color + color[8]
if max_color > = 8:
    max_color = 8

print(min_color,max_color)

Submission status: Runtime Error

Solution code:
#Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
L = [0 for i in range(9)]
for i in range(N):
    L[a[i]//400] = L[a[i]//400] + 1
n = 0
for i in range(8):
    if L[i] > 0:
        n = n + 1
nmin = n
nmax = n + L[8]
if nmax > 9:
    nmax = 9
print(str(nmin)+" "+str(nmax))

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0 for _ in range(9)]
for a in map(int,input().split()):
  A[a//400]+=1
rate_num = 8-A[:-1].count(0)
print(rate_num, min(8,rate_num+A[-1]))

Submission status: Runtime Error

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

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

print(str(min_ans)+' '+str(min_ans+count)

Submission status: Runtime Error

Solution code:
n=input()
l=list(map(int,input().split()))
col=[False for i in range(8)]
val=0
count=0
for i in range(n):
  m=l[i]
  if m<400:
    col[0]=True
  elif m<800:
    col[1]=True
  elif m<1200:
    col[2]=True
  elif m<1600:
    col[3]=True
  elif m<2000:
    col[4]=True
  elif m<2400:
    col[5]=True
  elif m<2800:
    col[6]=True
  elif m<3200:
    col[7]=True
  else:
    val+=1
for i in range(8):
  if col[i]:
    count+=1
print(count,min(8,count+val))

Submission status: Runtime Error

Solution code:
N = int(input())
an = list(map(int, input().split()))
over_cnt = 0
colors = []
for a in an:
    rate = a // 400
    if rate >= 8:
        over_cnt += 1
    elif rate not in colors:
        colors.append(rate)

min = len(colors)
max = min(len(colors) + over_cnt, 8)
print(min, max)

Submission status: Runtime Error

Solution code:
N=int(input())
A=sorted(list(map(int,input().split())))
A=[i//400 for i in A]

Colors=[0,0,0,0,0,0,0,0,0]
for i in A:
    Colors[i]+=1

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

print(Count,Count+Colors[-1])

Submission status: Runtime Error

Solution code:

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

def get_color(point):
    color = ''
    if 400 > point:
        color = 'grey'
    elif 800 > point:
        color = 'brown'
    elif 1200 > point:
        color = 'green'
    elif 1600 > point:
        color = 'light blue'
    elif 2000 > point:
        color = 'blue'
    elif 2400 > point:
        color = 'yellow'
    elif 2800 > point:
        color = 'orange'
    elif 3200 > point:
        color = 'red'
    else:
        color = 'free'
    return color
dict = {}
for i in range(N):
    color = get_color(a[i])
    if color not in dict.keys():
        dict[color] = 1
    else:
        dict[color] += 1

min_cnt = 0
max_cnt = 0
if 'free' not in dict.keys():
    min_cnt = max_cnt = len(dict.keys())
else:
    min_cnt = len(dict.keys())-1
    max_cnt = min(8, min_cnt + len(dict['free']))

print(min_cnt, max_cnt)

Submission status: Runtime Error

Solution code:
n = int(input())

colors = [0] * 12
for i in list(map(int, input().split())):
    colors[i//400] += 1

ans = 8 - colors[:8].count(0)
free = sum(colors[8:])

print(max(1, ans), max(1, ans + free))

Submission status: Runtime Error

Solution code:
import os

n = int(input())
alist = [int(i) for i in input().split()]

set = set()
arfa = 0

for a in alist:
    if a<=399:
        set.add(1)
    elif a<=799:
        set.add(2)
    elif a<=1199:
        set.add(3)
    elif a<=1599:
        set.add(4)
    elif a<=1999:
        set.add(5)
    elif a<=2399:
        set.add(6)
    elif a<=2799:
        set.add(7)
    elif a<=3199:
        set.add(8)
    else:
        arfa += 1
max = len(set)+arfa

if len(set)==0:
    min = 1
else:
    min = len(set)

if len(set)+arfa>8:
    print(min,end = " ")
    print(8)
else:
    print(len(min,end = " "))
    print(max)

Submission status: Runtime Error

Solution code:
import os

n = int(input())
alist = [int(i) for i in input().split()]

set = set()
arfa = 0

for a in alist:
    if a<=399:
        set.add(1)
    elif a<=799:
        set.add(2)
    elif a<=1199:
        set.add(3)
    elif a<=1599:
        set.add(4)
    elif a<=1999:
        set.add(5)
    elif a<=2399:
        set.add(6)
    elif a<=2799:
        set.add(7)
    elif a<=3199:
        set.add(8)
    else:
        arfa += 1
max = len(set)+arfa

if len(set)==0:
    min = 1
else:
    min = len(set)

if len(set)+arfa>8:
    print(min,end = " ")
    print(8)
else:
    print(len(min,end = " ")
    print(max)

Submission status: Runtime Error

Solution code:
n = int(input())
list_a = list(map(int, input().split()))
num_rank = [0 for _ in range(9)]
for one_a in list_a:
  temp_rank = one_a // 400
  num_rank[temp_rank] += 1
if len([i for i in num_rank[:-1] if i > 0]) > 0:
  min_color = len([i for i in num_rank[:-1] if i > 0])
else:
  min_color = 1
max_color = len([i for i in num_rank[:-1] if i > 0]) + num_rank[-1]
print("{} {}".format(min_color, max_color))

Submission status: Runtime Error

Solution code:
n = int(input())
list_a = list(map(int, input().split()))
num_rank = [0 for _ in range(9)]
for one_a in list_a:
  temp_rank = one_a // 400
  num_rank[temp_rank] += 1

min_color = len([i for i in num_rank[:-1] if i > 0])
max_color = len([i for i in num_rank[:-1] if i > 0]) + num_rank[-1]
print("{} {}".format(min_color, max_color))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
col = [0] * 9
for i in A:
  r = i//400
  if r > 9:
    r = 8
  col[r] += 1

ans = 0
for i in col[:8]:
  if i > 0:
    ans += 1

print(ans, ans + col[-1])

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
col = [0] * 9
for i in A:
  col[i // 400] += 1

ans = 0
for i in col[:8]:
  if i > 0:
    ans += 1

print(ans, ans + col[-1])

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*9
tourist = 0

for i in a:
    if i // 400 == 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

minrate = sum(li[:8])
maxrate = 0
if minrate + tourist > 8:
    maxrate = 8
else:
    maxrate = minrate + tourist

print(minrate, maxrate)

Submission status: Runtime Error

Solution code:
N=input()
N=int(N)
a=input()
a=a.split()
score=[0]*8
legend=0
inrank=0
a=[int(item) for item in a]
for i in range(N):
    p=int(a[i]/400)
    if p >= 8:
        legend+=1
    else:
        score[p]=1
inrank=score.count(1)
if legend!=0:
    if inrank==0:
        t_max=legend
        t_min=0
    else:
        t_max=inrank+legend
        t_min=inrank
print(str(t_min)+" "+str(t_max))

Submission status: Runtime Error

Solution code:
n = int(input());l = [0]*9
for i in map(int, input().split()):l[i//400]+=1
mn = len(list(filter(lambda x:x>0, l[:8])))
print(mn, min(8, mn+l[8]))

Submission status: Runtime Error

Solution code:
import collections

N = int(input())
a = list(map(int, input().split()))
if (len(a) != N or N > 100 or N < 1 or max(a) > 4800 or min(a < 1)):
    exit()

sort = sorted(a, key=int)

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min
max = 8 if max > 8 else max

print(min, max)

Submission status: Runtime Error

Solution code:
import collections

N = int(input())
a = list(map(int, input().split()))
if (len(a) != N or N > 100 or N < 1 or max(a) > 4800 or min(a < 1):
    exit()

sort=sorted(a, key=int)

for i in range(N):
    sort[i]=sort[i] // 400

normal=[i for i in sort if i < 8]
incredible=[i for i in sort if i >= 8]

min=len(collections.Counter(normal))
max=len(collections.Counter(normal)) + len(incredible)

min=1 if min < 1 else min
max=8 if max > 8 else max

print(min, max)

Submission status: Runtime Error

Solution code:
n,*a = map(int,open(0).read().split())
b = filter(lambda x:x < 3200,a)
c = len(set([i//400 for i in b]))
print(c or 1,end=" ")
print(c + n-len(b))

Submission status: Runtime Error

Solution code:
n,*a = map(int,open(0).read().split())
b = filter(lambda x:x < 3200,a)
c = set([i//400 for i in b])
print(c or 1,end=" ")
print(c + n-len(b))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
C = [a//400 for a in A if s<3200]
m = len(set(C))
print(max(1,m),m+N-len(C))

Submission status: Runtime Error

Solution code:
N = int(input())
rate = [0] * 9
for a in [int(x) for x in input().split()]:
  rate[a // 400] += 1

ret = 0
for r in rate[:-1]:
  if r:
    ret += 1

print(ret, ret + rate[-1])

Submission status: Runtime Error

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

for a in A:
  if a >= 3200:
    c += 1
  else:
    s.add(a//400
print(max(1, len(s)), len(s) + c)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
color = {}
f = 0
for a in A:
    if 1 <= a <= 399:
        color['g'] = 1
    elif 400 <= a <= 799:
        color['br'] = 1
    elif 800 <= a <= 1199:
        color['gr'] = 1
    elif 1200 <= a <= 1599:
        color['m'] = 1
    elif 1600 <= a <= 1999:
        color['b'] = 1
    elif 2000 <= a <= 2399:
        color['y'] = 1
    elif 2400 <= a <= 2799:
        color['o'] = 1
    elif 2800 <= a <= 3199:
        color['r'] = 1
    else:
        f += 1
print(max(1, len(color)), min(len(color)+f))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input()))
color = {}
f = 0
for a in A:
    if 1 <= a <= 399:
        color['g'] = 1
    elif 400 <= a <= 799:
        color['br'] = 1
    elif 800 <= a <= 1199:
        color['gr'] = 1
    elif 1200 <= a <= 1599:
        color['m'] = 1
    elif 1600 <= a <= 1999:
        color['b'] = 1
    elif 2000 <= a <= 2399:
        color['y'] = 1
    elif 2400 <= a <= 2799:
        color['o'] = 1
    elif 2800 <= a <= 3199:
        color['r'] = 1
    else:
        f += 1
print(max(1, len(color)), min(8, len(color)+f))

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for i in a:
    colors[i//400] += 1
ans = 0
for i in colors[0:8]:
    if i != 0:
        ans += 1
print(ans, ans+colors[8])

Submission status: Runtime Error

Solution code:
n=int(input())
def f(x):
  return x//400 if x<3200 else return 8
l=set(map(lambda x:x//400 if x < 3200 else 8 ,list(map(int,input().split()))))
print(l)

Submission status: Runtime Error

Solution code:
_ = input().strip()
kind_set = {}
colors = list(map(int, input().strip().split(' ')))

def whatcolor(rate):
  if rate < 400:
    return 0
  elif rate < 800:
    return 1
  elif rate < 1200:
    return 2
  elif rate < 1600:
    return 3
  elif rate < 2000:
    return 4
  elif rate < 2400:
    return 5
  elif rate < 2800:
    return 6
  elif rate < 3200:
    return 7
  else:
    return 'red'
  
for r in rates:
  color = whatcolor(r)
  if color == 'red':
    continue
  else:
    kind_set.add(color)

print(max(1, len(kind_set)))

Submission status: Runtime Error

Solution code:
N = int(input())

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

C = [0] * 9

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

blank = C[0:8].count(0)

if blank == 0:
    print("8 8")
    exit()

if C[8] == 0:
    ans = str(8 - blank)
    print(ans + " " + ans)
    exit()
elif C[8] >= 8:
    ans = str(max(8 - blank, 1))
    print(ans + " " + 8)
elif 1 <= C[8] <= 7:
    ans = str(8 - blank)
    ans2 = str(min(8, 8 - blank + C[8]))
    print(ans + " " + ans2)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*10
count=0
for i in range(N):
    B[A[i]//400]+=1

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

print(count, end=" ")
print(min(count+int(B[8]),8))

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
	a[i]//=400
free=0
b=set()
for i in range(n):
	if a[i]>=8:
		free+=1
	else:
		b.add(a[i])
cnt=len(b)
x=max(cnt,1)
y=min(cnt+free)
print(x,y)

Submission status: Runtime Error

Solution code:
rates  = [399,799,1199,1599,1999,2399,2799,3199]
from collections import defaultdict


def return_index(score):
  for i in rates:
    if score <= i:
      return rates.index(i)
  else:
    return 8

N = int(input())
A = list(map(int,input().split()))
d = defaultdict(int)
for a in A:
  d[return_index(a)] += 1
num_of_9s = d[8]
has_9 = 1 if num_of_9s > 0 else 0
print("{} {}".format(len(d.keys()-has_9 ),len(d.keys())-has_9+num_of_9s ))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
an = list(map(int,input().split()))
rate_bucket = [0] * 9
ret = 0
for a in an:
    rate_bucket[a//400]+=1
for i in rate_bucket[0:-1:]:
    if i > 0:
        ret+=1
print("{} {}".format(ret,ret+rate_bucket[-1]))

Submission status: Runtime Error

Solution code:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A)
if 8 in min_counter.keys():
    min_counter.pop(8)
maximum = 0
max_counter = Counter(A)
if max_counter[8] >= 8:
    maximum = 8
else:
    if 8 in max_counter.keys():
        maximum = max_counter[8]
        max_counter.pop(8)
    maximum += len(max_counter)
minimum = len(min_counter)
print(f"{minimum} {maximum}")

Submission status: Runtime Error

Solution code:
n = int(input())
an = [int(i) for i in input().split()]
score = [0]*9
ans = 0

for i in an:
  score[i//400] += 1

for i in score[:8]:
  if i:
    ans += 1
print(ans,ans+score[8])

Submission status: Runtime Error

Solution code:
import sys
from functools import reduce

def solve():
    pass

def main():
    N = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9 # 8色 + 任意の1色
    for rate in a:
        colors[rate // 400] += 1

    mn = 0
    for c in colors[0:8]:
        if c != 0:
            mn += 1

    mx = mn + min(8 - mn, colors[8])
    print(mn, mx)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def main():
    _ = int(input())
    A = list(map(int, input().split()))
    c = [False] * (4800 // 400 - 1)
    d = [0] * (4800 // 400 - 1)
    for a in A:
        c[a // 400] = True
        d[a // 400] += 1
    mn = 1 if c[:8].count(True) == 0 else c[:8].count(True)
    mx = c[:8].count(True) + sum(d[8:])
    print(mn, mx)


main()

Submission status: Runtime Error

Solution code:
def main():
    _ = int(input())
    A = list(map(int, input().split()))
    c = [0] * (4800 // 400)
    mx = 0
    for a in A:
        c[a // 400] = True
        if a >= 3200:
            mx += 1
    print(max(c[:3200 // 400].count(True), mx),
          c[:3200 // 400].count(True) + mx)


main()

Submission status: Runtime Error

Solution code:
import numpy as np
# 参加人数を入力する
N = int(input())
# レートを入力する
a = list(map(int, input().split()))
# ndarray型に変換
arr_a = np.array(a)
# 3200未満のレートを持つ人について、色の種類数を設定する
under3200 = 0
# 色ごとのレートの下限と上限を設定
lower = 1
upper = 399
# 上限が3200未満である限り繰り返す
while upper < 3200:
    # 範囲内のレートを持つ人がいる場合、色の種類数を増やす
    if len(arr_a[(arr_a  >= lower) & (arr_a <= upper)]) != 0:
        under3200 += 1
    # 下限と上限を更新する
    lower = upper + 1
    upper += 400
# 3200を超えるレートを持つ人の数を数える
over3200 = len(arr_a[arr_a >= 3200])

# 色の種類数の最小値について
if under3200 != 0:
    under3200
else:
    min_color = 1
# 色の種類数の最大値について
max_color = under3200 + over3200
# 結果を出力する
print("{} {}".format(min_color, max_color))

Submission status: Runtime Error

Solution code:
import numpy as np
# 参加人数を入力する
N = int(input())
# レートを入力する
a = list(map(int, input().split()))
# ndarray型に変換
arr_a = np.array(a)
# 3200未満のレートを持つ人について、色の種類数を設定する
under3200 = 0
# 色ごとのレートの下限と上限を設定
lower = 1
upper = 399
# 上限が3200未満である限り繰り返す
while upper < 3200:
    # 範囲内のレートを持つ人がいる場合、色の種類数を増やす
    if len(arr_a[(arr_a  >= lower) & (arr_a <= upper)]) != 0:
        under3200 += 1
    # 下限と上限を更新する
    lower = upper + 1
    upper += 400
# 3200を超えるレートを持つ人の数を数える
over3200 = len(arr_a[arr_a >= 3200])
# 規定の色の数を設定する
color = 8

# 色の種類数の最小値について
if over3200 <= under3200:
    min_color = under3200
elif over3200 < color:
    min_color = overcolor
else:
    min_color = 8
# 色の種類数の最大値について
if under3200 + over3200 < color:
    max_color = under3200 + over3200
else:
    max_color = color
# 結果を出力する
print("{} {}".format(min_color, max_color))

Submission status: Runtime Error

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

rank = [0]*9

for i in range(N):😌
    if a[i] < 400:
        rank[0] += 1
    elif a[i] < 800:
        rank[1] += 1
    elif a[i] < 1200:
        rank[2] += 1
    elif a[i] < 1600:
        rank[3] += 1
    elif a[i] < 2000:
        rank[4] += 1
    elif a[i] < 2400:
        rank[5] += 1
    elif a[i] < 2800:
        rank[6] += 1
    elif a[i] < 3200:
        rank[7] += 1
    else:
        rank[8] += 1

sum = 0

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

min = sum
max = sum + rank[8]

if min == 0:
  min = 1

print(min,max)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
c=[]
cc=1
l=0
for i in range(399,3200,400):
    for j in range(n):
        if i-400<a[j] and a[j]<=i:
            c.append(i)
            ccc=j
for i in range(ccc):
    if c[i]!=c[i+1]:
        cc+=1
print(cc,min(8,cc+n-(ccc+1)))

Submission status: Runtime Error

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

color=[0]*9
for i in range(n):
  color[hoge[i]//400]+=1

ans=0
for i in color[:8]:
  if(i!=0):
    ans+=1
    
print(ans,ans+color[8])

Submission status: Runtime Error

Solution code:
#coding; utf-8


def main():
    N = int(input())
    A = list(map(int, input().split()))
    min_color = 0
    max_color = 0
    rate_criteria = 400
    rate = [0]*9
    for i in range(N):
        diva = A[i]//rate_criteria
        rate[diva] += 1

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

    max_color = min_color + rate[-1]
    # print(rate)
    print(min_color, max_color)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
rates=list(map(int,input().split()))
over3200=sum(1 for i in rates if i>=3200)
fixed=set()
for i in rates:
  if i//<=7:
    fixed.add(i)
f=len(fixed)
if f==0:
  print(1,over3200)
else:
  print(f,f+over3200)