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:
from collections import Counter
N=int(input())
a=Counter(list(map(lambda x:int(x)//400,input().split())))
d=a.keys()
if {8,9,10,11,12}&set(a.keys()):
    b=len(set(d)-{8,9,10,11,12})
    c=sum([a[i] for i in range(8,13)])
    print(max(b,1),min(b+c,9))
else:
    print(len(d),len(d))

Submission status: Wrong Answer

Solution code:
def main():
    _ = int(input())
    A = list(map(int, input().split()))
    c = [False] * 7
    h = 0
    for a in A:
        if a >= 3200:
            h += 1
            continue
        i = 0
        s = 0
        while 7 > i:
            if s + 400 <= a < s + 800:
                c[i] = True
            i += 1
            s = i * 400
    print(c.count(True), c.count(True) + h)


main()

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
n_o=len([i for i in l if i>=3200])
n_c=len(set([i//400 for i in l if i<3200]))
print(max(n_o,n_c),n_o+n_c)

Submission status: Wrong Answer

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
else:
    min_color = over3200
# 色の種類数の最大値について
max_color = under3200 + over3200
# 結果を出力する
print("{} {}".format(min_color, max_color))

Submission status: Wrong Answer

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

N = int(input())
arr = list(map(int, input().split()))
div_arr = list(map(lambda x: x // 400, arr))
sol_arr = [x for x in div_arr if x < 8]
free_len = len(div_arr) - len(sol_arr)
clr_kind = len(set(sol_arr))
min_num = clr_kind
max_num = clr_kind + free_len
print(min_num, max_num)

Submission status: Wrong Answer

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

colors = {
  'gray': 0,
  'blown': 0,
  'green': 0,
  'water': 0,
  'blue': 0,
  'yellow': 0,
  'orange': 0,
  'red': 0,
}
over_3200 = 0

for rate in a:
  if 1 <= rate <= 399:
    colors['gray'] += 1
  elif 400 <= rate <= 799:
    colors['blown'] += 1
  elif 800 <= rate <= 1199:
    colors['green'] += 1
  elif 1200 <= rate <= 1599:
    colors['water'] += 1
  elif 1600 <= rate <= 1999:
    colors['blue'] += 1
  elif 2000 <= rate <= 2399:
    colors['yellow'] += 1
  elif 2400 <= rate <= 2799:
    colors['orange'] += 1
  elif 2800 <= rate <= 3199:
    colors['red'] += 1
  elif rate >= 3200:
    over_3200 += 1

min_kinds = len([i for i in list(colors.values()) if i != 0]) 
max_kinds = min_kinds + over_3200
if min_kinds == 0:
  min_kinds = 2
print(' '.join([str(min_kinds), str(max_kinds)]))

Submission status: Wrong Answer

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

colors = {
  'gray': 0,
  'blown': 0,
  'green': 0,
  'water': 0,
  'blue': 0,
  'yellow': 0,
  'orange': 0,
  'red': 0,
}
over_3200 = 0

for rate in a:
  if 1 <= rate <= 399:
    colors['gray'] += 1
  elif 400 <= rate <= 799:
    colors['blown'] += 1
  elif 800 <= rate <= 1199:
    colors['green'] += 1
  elif 1200 <= rate <= 1599:
    colors['water'] += 1
  elif 1600 <= rate <= 1999:
    colors['blue'] += 1
  elif 2000 <= rate <= 2399:
    colors['yellow'] += 1
  elif 2400 <= rate <= 2799:
    colors['orange'] += 1
  elif 2800 <= rate <= 3199:
    colors['red'] += 1
  elif rate >= 3200:
    over_3200 += 1

min_kinds = len([i for i in list(colors.values()) if i != 0]) 
max_kinds = (min_kinds + over_3200) if min_kinds + over_3200 <= 8 else 8
if min_kinds == 0:
  min_kinds = 2
print(' '.join([str(min_kinds), str(max_kinds)]))

Submission status: Wrong Answer

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

colors = {
  'gray': 0,
  'blown': 0,
  'green': 0,
  'water': 0,
  'blue': 0,
  'yellow': 0,
  'orange': 0,
  'red': 0,
}
over_3200 = 0

for rate in a:
  if 1 <= rate <= 399:
    colors['gray'] += 1
  elif 400 <= rate <= 799:
    colors['blown'] += 1
  elif 800 <= rate <= 1199:
    colors['green'] += 1
  elif 1200 <= rate <= 1599:
    colors['water'] += 1
  elif 1600 <= rate <= 1999:
    colors['blue'] += 1
  elif 2000 <= rate <= 2399:
    colors['yellow'] += 1
  elif 2400 <= rate <= 2799:
    colors['orange'] += 1
  elif 2800 <= rate <= 3199:
    colors['red'] += 1
  elif rate >= 3200:
    over_3200 += 1

min_kinds = len([i for i in list(colors.values()) if i != 0])
max_kinds = (min_kinds + over_3200) if min_kinds + over_3200 <= 8 else 8
print(' '.join([str(min_kinds), str(max_kinds)]))

Submission status: Wrong Answer

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

colors = {
  'gray': 0,
  'blown': 0,
  'green': 0,
  'water': 0,
  'blue': 0,
  'yellow': 0,
  'orange': 0,
  'red': 0,
}
over_3200 = 0

for rate in a:
  if 1 <= rate <= 399:
    colors['gray'] += 1
  elif 400 <= rate <= 799:
    colors['blown'] += 1
  elif 800 <= rate <= 1199:
    colors['green'] += 1
  elif 1200 <= rate <= 1599:
    colors['water'] += 1
  elif 1600 <= rate <= 1999:
    colors['blue'] += 1
  elif 2000 <= rate <= 2399:
    colors['yellow'] += 1
  elif 2400 <= rate <= 2799:
    colors['orange'] += 1
  elif 2800 <= rate <= 3100:
    colors['red'] += 1
  elif rate >= 3200:
    over_3200 += 1

min_kinds = len([i for i in list(colors.values()) if i != 0])
max_kinds = (min_kinds + over_3200) if min_kinds + over_3200 <= 8 else 8
print(' '.join([str(min_kinds), str(max_kinds)]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[0]*8
sums=0
sai=0
for i in a:
    if i<3200:
        c[i//400]=1
    else:
        sai+=1
sums=sum(c)
print(sums,sums+sai)

Submission status: Wrong Answer

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

rank = [0]*9

for i in range(N):
    if a[i] < 399:
        rank[0] += 1
    elif a[i] < 799:
        rank[1] += 1
    elif a[i] < 1199:
        rank[2] += 1
    elif a[i] < 1599:
        rank[3] += 1
    elif a[i] < 1999:
        rank[4] += 1
    elif a[i] < 2399:
        rank[5] += 1
    elif a[i] < 2799:
        rank[6] += 1
    elif a[i] < 3199:
        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: Wrong Answer

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

rank = [0]*9

for i in range(N):
    if a[i] < 399:
        rank[0] += 1
    elif a[i] < 799:
        rank[1] += 1
    elif a[i] < 1199:
        rank[2] += 1
    elif a[i] < 1599:
        rank[3] += 1
    elif a[i] < 1999:
        rank[4] += 1
    elif a[i] < 2399:
        rank[5] += 1
    elif a[i] < 2799:
        rank[6] += 1
    elif a[i] < 3199:
        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]

print(min,max)

Submission status: Wrong Answer

Solution code:

N = int(input())

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


dic = {}
free = 0

for i in a:

    if i // 400 < 8:

        dic[i//400] = 1

    else:

        free += 1

print( min(1,len(dic)) ,  len(dic) + free )

Submission status: Wrong Answer

Solution code:
N = int(input())

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


dic = {}
free = 0

for i in a:

    if i // 400 < 8:

        dic[i//400] = 1

    else:

        free += 1

print( len(dic) ,  len(dic) + free )

Submission status: Wrong Answer

Solution code:

N = int(input())

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


dic = {}
free = 0

for i in a:

    if i // 400 < 8:

        dic[i//400] = 1

    else:

        free += 1

print( len(dic) ,  min( 8 , len(dic) + free) )

Submission status: Wrong Answer

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

minans=0
miniro=[0]*8
count=0

for i in range(n):
    tmp=a[i]//400
    if tmp<8 and miniro[tmp]==0:
        miniro[tmp]+=1
    elif tmp>=8:
        count+=1

print("{0} {1}".format(max(sum(miniro),1), min(count+sum(miniro), 8)))

Submission status: Wrong Answer

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

minans=0
maxans=0
miniro=[0]*8
count=0

for i in range(n):
    for j in range(8):
        a[i]-=400
        if a[i]<0:
            if miniro[j]==0:
                miniro[j]+=1
            break
        if j==7:
            count+=1

# print(miniro)
minans=max(sum(miniro),1)

print("{0} {1}".format(minans, min(count+sum(miniro), 8)))

Submission status: Wrong Answer

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

minans=0
maxans=0
miniro=[0]*8
count=0

for i in range(n):
    for j in range(8):
        a[i]-=400
        if a[i]<0:
            if miniro[j]==0:
                miniro[j]+=1
            break
        if j==7:
            count+=1

# print(miniro)
minans=max(sum(miniro),1)

print("{0} {1}".format(minans, min(count+minans, 8)))

Submission status: Wrong Answer

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

minans=0
maxans=0
miniro=[0]*8
count=0

for i in range(n):
    for j in range(8):
        a[i]-=400
        if a[i]<0:
            if miniro[j]==0:
                miniro[j]+=1
            break
        if j==7:
            count+=1

# print(miniro)
minans=sum(miniro)

print("{0} {1}".format(minans, min(count+minans, 8)))

Submission status: Wrong Answer

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

minans=0
maxans=0
miniro=[0]*8
maxiro=[0]*8
count=0

for i in range(n):
    for j in range(8):
        a[i]-=400
        if a[i]<0:
            miniro[j]+=1
            break
        if j==7:
            count+=1

for i in range(8):
    if miniro[i]>0:
        minans+=1
        maxans+=1
    if count>0 and miniro[i]==0:
        count-=1
        maxans+=1


print("{0} {1}".format(minans, maxans))

Submission status: Wrong Answer

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

minans=0
miniro=[0]*8
maxiro=[0]*8
count=0
for i in range(n):
    for j in range(8):
        a[i]-=400
        if a[i]<0:
            miniro[j]+=1
            break
        if j==7:
            count+=1

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

if minans==0 and count>0:
    minans=1

maxans=minans
for i in range(8):
    if count>0 and miniro[i]==0:
        count-=1
        maxans+=1

print("{0} {1}".format(minans, maxans))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
c=[]
cc=1
l=0
ccc=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: Wrong Answer

Solution code:
n=int(input())
a=sorted([int(i) for i in input().split()])
color=[0]*9
for i in a:
    if i<400:
        color[0]=1
    elif i<800:
        color[1]=1
    elif i<1200:
        color[2]=1
    elif i<1600:
        color[3]=1
    elif i<2000:
        color[4]=1
    elif i<2400:
        color[5]=1
    elif i<2800:
        color[6]=1
    elif i<3200:
        color[7]=1
    else:
        color[8]+=1
print("{} {}".format(sum(color[:8]),sum(color)))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
rl = [0] * 9
for c in a:
    if c>=3200:rl[0] += 1
    elif c>=2800:rl[1] = 1
    elif c >= 2400:rl[2] = 1
    elif c >= 2000:rl[3] = 1
    elif c >= 1600:rl[4] = 1
    elif c >= 1200:rl[5] = 1
    elif c >=  800:rl[6] = 1
    elif c >=  400:rl[7] = 1
    else:rl[7] = 1
print(sum(rl[1:]),sum(rl))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# C
import collections
N = int(input())
a = list(map(int, input().split()))
def color(rate):
    if 1 <= rate <= 400:
        return 'gray'
    elif 400 <= rate < 800:
        return 'brown'
    elif 800 <= rate < 1200:
        return 'green'
    elif 1200 <= rate < 1600:
        return 'mizu'
    elif 1600 <= rate < 2000:
        return 'blue'
    elif 2000 <= rate < 2400:
        return 'yellow'
    elif 2400 <= rate < 2800:
        return 'orange'
    elif 2800 <= rate < 3200:
        return 'red'
    else:
        return 'change'
color_lst = []
change_num = 0
for i in range(N):
    tmp = color(a[i])
    if tmp == 'change':
        change_num += 1
    else:
        color_lst.append(tmp)
color_counter = collections.Counter(color_lst)
num = color_counter.keys()

print('{} {}'.format(len(num), len(num) + change_num))

Submission status: Wrong Answer

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

rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
a_ac = [0,   0,   0,    0,    0,    0,    0,    0]

cnt = 0

for s in a:
    if s >= rate[-1]:
        cnt += 1
        continue
    
    cont = True
    i = 0

    while cont:
        if  s < rate[i+1]:
            a_ac[i] = 1
            cont = False
        i += 1

print(sum(a_ac))
print(sum(a_ac)+cnt)

Submission status: Wrong Answer

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

rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
a_ac = [0,   0,   0,    0,    0,    0,    0,    0,    0]

for s in a:
    cont = True
    i = 0
    while cont:
        if i == len(rate)-1:
            a_ac[len(rate)-1] += 1
            cont = False
        elif  s >= rate[i] and s < rate[i+1]:
            a_ac[i] = 1
            cont = False
        i += 1

print(sum(a_ac[:-1]))
print(sum(a_ac))

Submission status: Wrong Answer

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

color = []
over = 0
for rate in A:
    if rate >= 3200:
        over += 1
    else:
        num = int(rate / 400)
        color.append(num)

color = set(color)
if len(color) == 0:
    mini = 1
    maxi = min(8, over)

else:
    mini = len(color)
    maxi = min(8, mini + over)
print("{} {}".format(mini, maxi))

Submission status: Wrong Answer

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

color = []
over = 0
for rate in A:
    if rate >= 3200:
        over += 1
    else:
        num = int(rate / 400)
        color.append(num)

color = set(color)
mini = len(color)
maxi = min(8, mini + over)
print("{} {}".format(mini, maxi))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color=[0 for _ in range(9)]
for i in range(n):
    if a[i]<400:
        color[0]+=1
    elif 400<=a[i]<800:
        color[1]+=1
    elif 800<=a[i]<1200:
        color[2]+=1
    elif 1200<=a[i]<1600:
        color[3]+=1
    elif 1600<=a[i]<2000:
        color[4]+=1
    elif 2000<=a[i]<2400:
        color[5]+=1
    elif 2400<=a[i]<2800:
        color[6]+=1
    elif 2800<=a[i]<3200:
        color[7]+=1
    else:
        color[8]+=1
c=color[:-1].count(0)
m=8-c
M=8-c+color[8]
print(str(m)+' '+str(M))

Submission status: Wrong Answer

Solution code:
def rating(n):
    if 1<=n<=399:return 0
    elif 400<=n<=799:return 1
    elif 800<=n<=1199:return 2
    elif 1200<=n<=1599:return 3
    elif 1600<=n<=1999:return 4
    elif 2000<=n<=2399:return 5
    elif 2400<=n<=2799:return 6
    elif 2800<=n<=3199:return 7
    else:return 8

N=int(input())
A=list(map(int,input().split()))
B=[]
for a in A:B.append(rating(a))
wild=B.count(8)
b=len(list(set(B)))
if wild==0:print(b,b)
else:print(b-1,min(8,b+wild))

Submission status: Wrong Answer

Solution code:
def rating(n):
    if 1<=n<=399:return 0
    elif 400<=n<=799:return 1
    elif 800<=n<=1199:return 2
    elif 1200<=n<=1599:return 3
    elif 1600<=n<=1999:return 4
    elif 2000<=n<=2399:return 5
    elif 2400<=n<=2799:return 6
    elif 2800<=n<=3199:return 7
    else:return 8

N=int(input())
A=list(map(int,input().split()))
B=[]
for a in A:B.append(rating(a))
wild=B.count(8)
b=len(list(set(B)))
if wild==0:print(b,b)
else:print(b-1,min(8,b+1))

Submission status: Wrong Answer

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

L=[0]*9
for a in A:
    if a//400<=7:
        L[a//400]=1
    else:
        L[8]+=1

print(sum(L[:-1]),sum(L))

Submission status: Wrong Answer

Solution code:
# ABC064C - Colorful Leaderboard
def main():
    n = int(input())
    a = [i // 400 for i in tuple(map(int, input().rstrip().split()))]
    s = set(a)
    x = max
    if 8 not in s:
        print(len(s), len(s))
    else:
        c = len(s) - 1
        print(max(1, c), c + a.count(8))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# ABC064C - Colorful Leaderboard
def main():
    n = int(input())
    a = [i // 400 for i in tuple(map(int, input().rstrip().split()))]
    s = set(a)
    if 8 not in s:
        print(len(s), len(s))
    elif s == {8}:
        print(1, n)
    else:
        c = len(s) - 1
        print(c, c + a.count(8))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# ABC064C - Colorful Leaderboard
def main():
    n = int(input())
    a = [i // 400 for i in tuple(map(int, input().rstrip().split()))]
    s = set(a)
    if 8 not in s:
        print(len(s), len(s))
    elif s == {8}:
        print(1, min(8, n))
    else:
        print(len(s) - 1, min(8, len(s) - 1 + a.count(8)))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# ABC064C - Colorful Leaderboard
from collections import Counter


def main():
    n = int(input())
    lst = [i // 400 for i in tuple(map(int, input().rstrip().split()))]
    cnt = Counter(lst)
    if 8 not in cnt.keys():
        print(len(cnt), len(cnt))
    else:
        x = len(cnt) - 1
        print(max(1, x), min(8, x + cnt[8]))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# ABC064C - Colorful Leaderboard
from collections import Counter


def main():
    #n = int(input())
    lst = [i // 400 for i in tuple(map(int, input().rstrip().split()))]
    cnt = Counter(lst)
    if 8 not in cnt.keys():
        print(len(cnt), len(cnt))
    else:
        x = len(cnt) - 1
        print(max(1, x), min(8, x + cnt[8]))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# ABC064C - Colorful Leaderboard
from collections import Counter


def main():
    n = int(input())
    lst = [i // 400 for i in tuple(map(int, input().rstrip().split()))]
    cnt = Counter(lst)
    if 8 not in cnt.keys():
        print(len(cnt), len(cnt))
    else:
        x = len(cnt) - 1
        print(x, min(8, x + cnt[8]))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:


def main():
    num = int(input())
    data = list(map(int, input().split()))

    color = [0 for i in range(9)]
    for i in range(num):
        score = data[i]
        ind = score // 400
        if ind > 8:
            ind = 8
        color[ind] += 1

    now_data = 0
    for i in range(8):
        if color[i]:
            now_data += 1

    min_data = max(1, now_data)
    max_data = min(8, now_data + color[8])
    print(min_data, max_data)





if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if(a[i] >= 3200):
        a[i] = 3200
    a[i] = a[i] // 400
cnt = a.count(8)
min_ans = len(set(a))
if(cnt > 0):
    min_ans -= 1
if(cnt == n):
    min_ans = 1

print(str(min_ans)+" "+str(min_ans+cnt))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if(a[i] >= 3200):
        a[i] = 3200
    a[i] = a[i] // 400
cnt = a.count(8)
min_ans = len(set(a))
if(cnt > 0 and min_ans != 1):
    min_ans -= 1
print(str(min_ans)+" "+str(min_ans+cnt))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if(a[i] >= 3200):
        a[i] = 3200
    a[i] = a[i] // 400
cnt = a.count(8)
min_ans = len(set(a))
if(cnt > 0):
    min_ans -= 1
print(str(min_ans)+" "+str(min_ans+cnt))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if(a[i] >= 3200):
        a[i] = 3200
    a[i] = a[i] // 400
cnt = a.count(8)
min_ans = len(set(a))
print(min_ans, min_ans+cnt)

Submission status: Wrong Answer

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

def main():
    b = 400
    limit = 8
    rates = list(map(lambda n: min(limit, n // b), A))
    min_count = 0
    for i in range(limit):
        min_count += 1 if rates.count(i) else 0
    print(min_count, min_count + rates.count(limit))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

d = defaultdict(int)

for i in range(n):
    g = min(8,a[i]//400)
    d[g] +=1

cnt=0
joker=0
for i in d.keys():
    if i != 8:
        cnt+=1
    else:
        joker=d[8]
print(joker)
ans_min = max(cnt,1)
ans_max = cnt+joker


print(ans_min,ans_max)

Submission status: Wrong Answer

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

d = defaultdict(int)

for i in range(n):
    g = min(8,a[i]//400)
    d[g] +=1

cnt=0
joker=0
for i in d.keys():
    if i != 8:
        cnt+=1
    else:
        joker=d[8]
    
ans_min = max(cnt,1)
ans_max = min(cnt+joker,8)


print(ans_min,ans_max)

Submission status: Wrong Answer

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

d = defaultdict(int)

for i in range(n):
    g = min(8,a[i]//400)
    d[g] +=1

cnt=0
joker=0
for i in d.keys():
    if i != 8:
        cnt+=1
    else:
        joker=d[8]
    
ans_min = max(cnt,1)
ans_max = min(cnt+joker,9)


print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
A = nl()

colors = set()
overs = 0
for a in A:
    if a <= 399:
        colors.add(1)
    elif a <= 799:
        colors.add(2)
    elif a <= 1199:
        colors.add(3)
    elif a <= 1599:
        colors.add(4)
    elif a <= 1999:
        colors.add(5)
    elif a <= 2399:
        colors.add(6)
    elif a <= 2799:
        colors.add(7)
    elif a <= 3199:
        colors.add(8)
    else:
        overs += 1

print(len(colors), len(colors) + overs)

Submission status: Wrong Answer

Solution code:
n=int(input())
al=list(map(int,input().split()))
tl=[0]*9
for a in al:
    if a<3200:
        tl[a//400]|=1
    else:
        tl[8]+=1
print(sum(tl[0:-1]),sum(tl))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
c=0
for i in range(n):
  if a[i]<3200:
    b.append(a[i]//400)
  else:
    c+=1
l=len(set(b))
print(l,l+c)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
c=0
for i in range(n):
  if a[i]<3200:
    b.append(a[i]//400)
  else:
    c+=1
l=len(set(b))
print(l,l+min(c,8-l))

Submission status: Wrong Answer

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

if N == 1:
    print(1)
    exit()

buff = [0 for i in range(9)]
for i in range(N):
    if a[i] < 3200:
        buff[a[i] // 400] += 1
    else:
        buff[8] += 1

zero_c = 0
noz_c = 0

for i in range(8):
    if buff[i] == 0:
        zero_c += 1
    else:
        noz_c += 1

# 最小値
ans_m = 0
if noz_c > 0:
    ans_m = noz_c
elif buff[8] > 0:
    ans_m = 1

ans_mx = 0
# 最大値
if noz_c > 0:
    ans_mx = noz_c
    amari = 9 - ans_mx
    if amari <= buff[8]:
        ans_mx += amari
    elif amari > buff[8]:
        ans_mx += buff[8]
else:
    if 9 <= buff[8]:
        ans_mx = 9
    else:
        ans_mx = buff[8]

print(ans_m, ans_mx)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
buff = [0 for i in range(9)]
for i in range(N):
    if a[i] < 3200:
        buff[a[i] // 400] += 1
    else:
        buff[8] += 1

zero_c = 0
noz_c = 0

for i in range(8):
    if buff[i] == 0:
        zero_c += 1
    else:
        noz_c += 1

# 最小値
ans_m = 0
if noz_c > 0:
    ans_m = noz_c
elif buff[8] > 0:
    ans_m = 1
else:
    ans_m = 0

ans_mx = 0
# 最大値
if noz_c > 0:
    ans_mx = noz_c
    amari = 9 - ans_mx
    if amari <= buff[8]:
        ans_mx += amari
    elif amari > buff[8]:
        ans_mx += buff[8]
else:
    if 9 <= buff[8]:
        ans_mx = 9
    else:
        ans_mx = buff[8]

print(ans_m, ans_mx)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, a: "List[int]"):
    tmp = 0
    s = set()
    for v in a:
        if v >= 3200:
            tmp += 1
        else:
            s.add(v // 400)
    ret = len(s)
    print(ret,  ret + tmp)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, a: "List[int]"):
    tmp = 0
    s = set()
    for v in a:
        if v >= 3200:
            tmp += 1
        else:
            s.add(v // 400)
    ret = len(s)
    print(ret,  min(8, ret + tmp))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
grey,brown,green,water,blue,yellow,orange,red,free_color = 0,0,0,0,0,0,0,0,0

num = list(map(int, input().split())) #cityの数、roadの数の配列
arr = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる

for rate in arr:
    if grey==0 and 0 < rate < 400:
        grey = 1
    elif brown==0 and 400 <= rate < 800:
        brown = 1
    elif green==0 and 800 <= rate < 1200:
        green = 1
    elif water==0 and 1200 <= rate < 1600:
        water = 1
    elif blue==0 and 1600 <= rate < 2000:
        blue = 1
    elif yellow==0 and 2000 <= rate < 2400:
        yellow = 1
    elif orange==0 and 2400 <= rate < 2800:
        orange = 1
    elif red==0 and 2800 <= rate < 3200:
        red = 1
    elif 3200 <= rate:
        free_color = free_color+1

min_kind = grey+green+water+blue+yellow+orange+red
max_kind = min_kind + free_color
if min_kind==0:
    min_kind=1
    max_kind = free_color
print(str(min_kind) + ' ' + str(max_kind))

Submission status: Wrong Answer

Solution code:
grey,brown,green,water,blue,yellow,orange,red,free_color = 0,0,0,0,0,0,0,0,0

num = list(map(int, input().split())) #cityの数、roadの数の配列
arr = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる

for rate in arr:
    if grey==0 and 0 < rate < 400:
        grey = 1
    elif brown==0 and 400 <= rate < 800:
        brown = 1
    elif green==0 and 800 <= rate < 1200:
        green = 1
    elif water==0 and 1200 <= rate < 1600:
        water = 1
    elif blue==0 and 1600 <= rate < 2000:
        blue = 1
    elif yellow==0 and 2000 <= rate < 2400:
        yellow = 1
    elif orange==0 and 2400 <= rate < 2800:
        orange = 1
    elif red==0 and 2800 <= rate < 3200:
        red = 1
    elif 3200 <= rate:
        free_color = free_color+1

min_kind = grey+green+water+blue+yellow+orange+red
max_kind = min_kind + free_color
print(str(min_kind) + ' ' + str(max_kind))

Submission status: Wrong Answer

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

a.sort()
color = [-1] * N
for i in range(N):
    if a[i] < 400:
        color[i] = 1
    elif a[i] < 800:
        color[i] = 2
    elif a[i] < 1200:
        color[i] = 3
    elif a[i] < 1600:
        color[i] = 4
    elif a[i] < 2000:
        color[i] = 5
    elif a[i] < 2400:
        color[i] = 6
    elif a[i] < 2800:
        color[i] = 7
    elif a[i] < 3200:
        color[i] = 8
    else:
        color[i] = 9

A = set(color)
if 9 in A:
    A.remove(9)

print(len(A), len(A) + color.count(9))

Submission status: Wrong Answer

Solution code:
n = int(input())

color = [0] * 8
pro = 0
for ai in map(int, input().split()):
    if 1 <= ai <= 399:
        color[0] = 1
    elif 400 <= ai <= 799:
        color[1] = 1
    elif 800 <= ai <= 1199:
        color[2] = 1
    elif 1200 <= ai <= 1599:
        color[3] = 1
    elif 1600 <= ai <= 1999:
        color[4] = 1
    elif 2000 <= ai <= 2399:
        color[5] = 1
    elif 2400 <= ai <= 2799:
        color[6] = 1
    elif 2800 <= ai <= 3199:
        color[7] = 1
    else:
        pro += 1

colSum = sum(color)
if colSum == 0 and pro > 0:
    print(1,min(8,pro))
else:
    print(colSum, min(colSum + pro, 8))