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=map(int,input().split())

num=[0,0,0,0,0,0,0,0,0]
counter=0

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

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0:
    min=1
    if num[8]>=8:
        max=8
    else:
        max=num[8]

else:
    min=counter
    if counter+num[8]>=8:
        max=8
    else:
        max=counter+num[8]

#print(num)
print(str(min)+" "+str(max))

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if __name__ == "__main__":
    N = int(input())
    rates = list(map(int, input().split(" ")))
    color_list = [0] * 8

    free_num = 0
    for rate in rates:
        if rate >= 3200:
            free_num += 1
        else:
            color_list[get_index(rate)] += 1

    color_kind = len(list(filter(lambda x: x > 0, color_list)))
    if free_num == N:
        print(str(1) + " " + str(free_num))
    else:
        print(str(color_kind) + " " + str(min(8, color_kind + free_num)))

Submission status: Wrong Answer

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

res_min = 0
res_max = 0

g = list(filter(lambda x: x <= 399, a))
br = list(filter(lambda x: 400 <= x <= 799, a))
gr = list(filter(lambda x: 800 <= x <= 1199, a))
s = list(filter(lambda x: 1200 <= x <= 1599, a))
bl = list(filter(lambda x: 1600 <= x <= 1999, a))
y = list(filter(lambda x: 2000 <= x <= 2399, a))
o = list(filter(lambda x: 2400 <= x <= 2799, a))
r = list(filter(lambda x: 2800 <= x <= 3199, a))
t = list(filter(lambda x: 3200 <= x, a))

c_list = [g, br, gr, s, bl, y, o, r]

for c in c_list:
    if len(c) != 0:
        res_min += 1
        res_max += 1

res_max += len(t)


print(res_min, res_max)

Submission status: Wrong Answer

Solution code:
h=[0]*8

N=int(input())
a=list(map(int,input().split(" ")))
nu=0
for sa in a:
    fsa=int(sa/400)
    if fsa<=7:
        h[fsa]=1
    else:
        nu+=1

Min=sum(h)
Max=min(8,Min+(nu))

print(str(Min)+" "+str(Max))

Submission status: Wrong Answer

Solution code:


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


def free(dic):
    return dic[0]


def nonzero(dic):
    ret = 0
    for k, v in dic.items():
        if k == 0:
            continue

        if v != 0:
            ret += 1
    return ret


n = int(input())
a = list(map(int, input().split()))
c = [assign(e) for e in a]

dic = {i: 0 for i in range(9)}
for e in c:
    if e == 0:
        dic[0] += 1

    else:
        dic[e] = 1

nb_seq = 8
nb_free = free(dic)
nb_nonzero = nonzero(dic)

# print(dic)
# print(nb_nonzero)

nb_max = nb_nonzero + min(nb_seq - nb_nonzero, nb_free)
nb_min = nb_nonzero if nb_nonzero > 0 else 1

print('{} {}'.format(nb_min, nb_max))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if "X" in C:
    if len(B) == 8:
        print("8 8")
    elif len(B) + len(C) >= 8 and len(B) > 0:
        print(str(len(B)) + " 8")
    elif len(B) == 0 and len(C) > 8:
        print("1 8")
    elif len(B) == 0 and len(C) <= 8:
        print("1 " + str(len(C)))
    else:
        print(str(len(B)) + " " + str(len(B) + len(C)))
else:
    print(str(len(B)) + " " + str(len(B)))

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    N = int(input())
    a = list(map(int, input().split()))

    a.sort()

    # 0:gray 1:brown 2:green ...... 7:red
    colors_count = [0 for i in range(8)]
    super_count = 0
    for score in a:
        if int(score / 400) == 0:
            colors_count[0] += 1
        elif int(score / 400) == 1:
            colors_count[1] += 1
        elif int(score / 400) == 2:
            colors_count[2] += 1
        elif int(score / 400) == 3:
            colors_count[3] += 1
        elif int(score / 400) == 4:
            colors_count[4] += 1
        elif int(score / 400) == 5:
            colors_count[5] += 1
        elif int(score / 400) == 6:
            colors_count[6] += 1
        elif int(score / 400) == 7:
            colors_count[7] += 1
        else:
            super_count += 1

    # print(colors_count)

    # colors_count で0ではないとこの数
    not_zero_count = 0
    for num in colors_count:
        if num != 0:
            not_zero_count += 1

    if not_zero_count == 0:
        ans_min = 1
        ans_max = super_count if super_count <= 8 else 8
    else:
        ans_min = not_zero_count
        ans_max = not_zero_count + super_count if (not_zero_count + super_count) <= 8 else 8

    print(str(ans_min) + ' ' + str(ans_max))

Submission status: Wrong Answer

Solution code:


N = int(input())
rates = [int(x) for x in input().split()]

rates.sort()
uppers = [399, 799, 1199, 1599, 1999, 2399, 2700, 3199, 3200]
accum = list()
counts = list()

for upper in uppers:
    accum.append(len([x for x in rates if x <= upper]))

for i in range(1, len(accum)):
    counts.append(accum[i] - accum[i-1])

least = sum([1 for count in counts[:-1] if count > 0])
max_score = counts[-1]

if max_score >= 8 - least:
    most = 8
else:
    most = least + max_score

print("{} {}".format(least, most))

Submission status: Wrong Answer

Solution code:
r = [
[1,399],
[400,799],
[800,1199],
[1200,1599],
[1600,1999],
[2000,2399],
[2400,2799],
[2800,3199],
]

field = [0 for x in range(len(r))]

ok = 3200
oknum = 0

n = int(input())

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

for x in a:
    if x >= ok:
        oknum += 1
        continue
    for i, v in enumerate(r):
        if v[0] <= x <= v[1]:
            field[i] = 1


sumf = sum(field)

print(sumf if sumf != 0 else 1, min(sumf + oknum, len(r)))

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = map(int, raw_input().split())
a.sort()

rank = [False] * 8

count = 0
for i in range(N):
  if 3200 <= a[i]:
    count += 1
  else:
    rank[int(a[i]/400)] = True

minimum = rank.count(True)
maximum = minimum + count
print minimum, maximum

Submission status: Wrong Answer

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

res_min = 0
res_max = 0

g = list(filter(lambda x: x <= 399, a))
br = list(filter(lambda x: 400 <= x <= 799, a))
gr = list(filter(lambda x: 800 <= x <= 1199, a))
s = list(filter(lambda x: 1200 <= x <= 1599, a))
bl = list(filter(lambda x: 1600 <= x <= 1999, a))
y = list(filter(lambda x: 2000 <= x <= 2399, a))
o = list(filter(lambda x: 2400 <= x <= 2799, a))
r = list(filter(lambda x: 2800 <= x <= 3199, a))
t = list(filter(lambda x: 3200 <= x, a))

c_list = [g, br, gr, s, bl, y, o, r]

for c in c_list:
    if len(c) != 0:
        res_min += 1
        res_max += 1

res_max += len(t)
if res_max > 8:
    res_max = 8


print(res_min, res_max)

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = map(int, raw_input().split())
b = []
cnt = 0
for i in range(0, N):
    if a[i] / 400 >= 8:
        cnt += 1
    else:
        b.append(a[i]/400)
b = set(b)

flag = 1
for x in a:
    if x >= 3200:
        flag = 0
    else:
        flag = 1
if flag:
    print len(b)
else:
    print 1
print len(b) + cnt

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=map(int,raw_input().split())
b=[0]*9
for i in a:
	c=i//400
	if c>=8:b[8]+=1
	else:b[c]=b[c] or 1
d=sum(b[:-1])
if sum(b)>=8:e=8
else:e=sum(b)
print d,e

Submission status: Wrong Answer

Solution code:
N = int(input())

exist = [False for i in range(8)]
colorful = 0
min = 0

rates = list(map(int, input().split(" ")))

for rate in rates:
    if rate >= 3200:
        colorful += 1
        continue
    if not exist[int(rate/400)]:
        exist[int(rate / 400)] = True
        min += 1

if colorful + min < 8:
    max_color = colorful + min
else:
    max_color = 8

result = str(min) + " " + str(max_color)
print(result)

Submission status: Wrong Answer

Solution code:
N=int(raw_input())
a=map(int,raw_input().split())
c=[0,0,0,0,0,0,0,0]
m=0
for i in range(N):
    b =a[i]/ 400
    if b < 8:
        c[b]+=1
    else:
        m+=1


ans=0
for i in c:
    if i > 0:
        ans+=1

ma=ans+m
print ans,ma

Submission status: Wrong Answer

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

hai = 0;cha = 0;midori = 0; mizu = 0;ao = 0;ki = 0;dai = 0;aka = 0;ue=0
for i in range(N):
    if 0<= a[i] < 400:
        hai +=1
    elif 400<= a[i] < 800:
        cha += 1
    elif 800<= a[i] < 1200:
        midori += 1
    elif 1200<= a[i] < 1600:
        mizu += 1
    elif 1600<= a[i] < 2000:
        ao += 1    
    elif 2000<= a[i] < 2400:
        ki += 1 
    elif 2400<= a[i] < 2800:
        dai += 1
    elif 2800<= a[i] < 3200:
        aka += 1
    else:
        ue += 1

count1 = 0
if hai > 0:
    count1 += 1
if cha > 0:
    count1 += 1
if midori> 0:
    count1 += 1
if mizu > 0:
    count1 += 1
if ao > 0:
    count1 += 1
if ki > 0:
    count1 += 1
if dai > 0:
    count1 += 1
if aka > 0:
    count1 += 1

countmin = count1
countmax = min(8, count1+ue)
print("{} {}".format(countmin, countmax))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if "X" in C:
    if len(B) == 8:
        print("8 8")
    elif len(B) + len(C) >= 8 and len(B) > 0:
        print(str(len(B)) + " 8")
    elif len(B) == 0:
        print("1 " + str(len(C)))
    else:
        print(str(len(B)) + " " + str(len(B) + len(C)))
else:
    print(str(len(B)) + " " + str(len(B)))

Submission status: Wrong Answer

Solution code:
N=int(raw_input())
a=map(int,raw_input().split(' '))

color=[0]*8
free=0

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

c=len(color)-color.count(0)

m=c+free
if m>8:
    m=8

print c,m

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int,input().split()))
color_vari = set()
over3200 = 0
for x in a_list:
	if x >= 3200:
		over3200 += 1

	else:
		color_vari.add(x // 400)

print(len(color_vari),len(color_vari)+over3200)

Submission status: Wrong Answer

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

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

mn = max(1, sum(kinds))
mx = mn + wild
print mn,mx

Submission status: Wrong Answer

Solution code:
colors = {"hai": False,
          "cha": False,
          "midori": False,
          "mizu": False,
          "ao": False,
          "ki": False,
          "daidai": False,
          "aka": False}
i2c = [None]*3200
for i in range(3200):
    if i < 400:
        i2c[i] = "hai"
    elif i < 800:
        i2c[i] = "cha"
    elif i < 1200:
        i2c[i] = "midori"
    elif i < 1600:
        i2c[i] = "mizu"
    elif i < 2000:
        i2c[i] = "ao"
    elif i < 2400:
        i2c[i] = "ki"
    elif i < 2800:
        i2c[i] = "daidai"
    else:
        i2c[i] = "aka"
n = int(input())
rates = [int(i) for i in input().split()]
jiyu = 0
for x in rates:
    if x >= 3200:
        jiyu += 1
    else:
        colors[i2c[x]] = True
saisho = 0
# print(jiyu, colors)
for x in colors:
    if(colors[x]):
        saisho += 1
print(saisho, saisho+jiyu)

Submission status: Wrong Answer

Solution code:
N=int(raw_input())
a=map(int,raw_input().split())
c=[0,0,0,0,0,0,0,0]
m=0
for i in range(N):
    b =a[i]/ 400
    if b < 8:
        c[b]+=1
    else:
        m+=1


ans=0
for i in c:
    if i > 0:
        ans+=1

ma=ans+m
if ma > 9:
    ma = 9
print ans,ma

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = [int(_) for _ in input().split()]
a = np.array(a)
a = np.sort(a)
min = 0
max = 0
m = 0
for i in range(N):
    if m==0 and a[i]<400:
        min+=1
        break
    if m<400 and 400<=a[i]<800:
        min+=1
    if m<800 and 800<=a[i]<1200:
        min+=1
    if m<1200 and 1200<=a[i]<1600:
        min+=1
    if m<1600 and 1600<=a[i]<2000:
        min+=1
    if m<2000 and 2000<=a[i]<2400:
        min+=1
    if m<2400 and 2400<=a[i]<2800:
        min+=1
    if m<2800 and 2800<=a[i]<3200:
        min+=1
    m = a[i]

if len(np.where(a>=3200)[0])==0:
    max = min
else:
    max = min + len(np.where(a>=3200)[0])
    if max>8:
        max = 8
print (min, max)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if "X" in C:
    if len(B) == 8:
        print("8 8")
    elif len(B) + len(C) >= 8:
        print(str(len(B)) + " 8")
    else:
        print(str(len(B)) + " " + str(len(B) + len(C)))
else:
    print(str(len(B)) + " " + str(len(B)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

n = input()
a = [int(i) for i in input().split()]
color = [0, 0, 0, 0, 0, 0, 0, 0]
tr = 0

for i in a:
  if i < 3200:
    color[int(i / 400)] += 1
  else:
    tr += 1

count = 0
for i in color:
  if i != 0:
    count += 1

print(str(count) + " ", end='')

if count + tr < 8:
  print(str(count + tr))
else:
  print(str(8))

Submission status: Wrong Answer

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

gray, tya, midori, mizu, ao, ki, daidai, aka, joker = 0, 0, 0, 0, 0, 0, 0, 0, 0

for i in a:
    if 1 <= i <= 399:
        gray = 1
    elif 400 <= i <= 799:
        tya = 1
    elif 800 <= i <= 1199:
        midori = 1
    elif 1200 <= i <= 1599:
        mizu = 1
    elif 1600 <= i <= 1999:
        ao = 1
    elif 2000 <= i <= 2399:
        ki = 1
    elif 2400 <= i <= 2799:
        daidai = 1
    elif 2800 <= i <= 3199:
        aka = 1
    elif 3200 <= i:
        joker += 1

mini = gray+tya+midori+mizu+ao+ki+daidai+aka
maxi = min(mini + joker, 10)

print mini, maxi

Submission status: Wrong Answer

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

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

colors = []
wildcard_count = 0

for i in range(N):
    c = get_color_index(a[i])
    if c == -1:
        wildcard_count += 1
    elif c not in colors:
        colors.append(c)

c_min = max(len(colors), 1)
c_max = min(len(colors) + wildcard_count, 8)

print(str(c_min) + ' ' + str(c_max))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
R = [0]*9
for r in a:
  rr = r//400
  if rr < 8:
    R[rr] = 1
  else:
    R[8] += 1
s2 = sum(R)
s1 = min(1,s2-R[8])
print(s1,s2)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = input()
a = map(int, raw_input().split())
a = sorted(a)

check = [0]*8
ex = 0
for i in range(n):
    if(a[i]<3200):
        check[a[i]/400] = 1
    else:
        ex += 1
l = max(sum(check),1)
h = min(sum(check)+ex,8)
print(str(l)+' '+str(h))

Submission status: Wrong Answer

Solution code:

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

hai = 0;cha = 0;midori = 0; mizu = 0;ao = 0;ki = 0;dai = 0;aka = 0;ue=0
for i in range(N):
    if 0<= a[i] < 400:
        hai +=1
    elif 400<= a[i] < 800:
        cha += 1
    elif 800<= a[i] < 1200:
        midori += 1
    elif 1200<= a[i] < 1600:
        mizu += 1
    elif 1600<= a[i] < 2000:
        ao += 1    
    elif 2000<= a[i] < 2400:
        ki += 1 
    elif 2400<= a[i] < 2800:
        dai += 1
    elif 2800<= a[i] < 3200:
        aka += 1
    else:
        ue += 1

count1 = 0
if hai > 0:
    count1 += 1
if cha > 0:
    count1 += 1
if midori> 0:
    count1 += 1
if mizu > 0:
    count1 += 1
if ao > 0:
    count1 += 1
if ki > 0:
    count1 += 1
if dai > 0:
    count1 += 1
if aka > 0:
    count1 += 1

countmin = count1
countmax = min(8, count1+ue)
print(countmin, countmax)

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = map(int, raw_input().split())
a.sort()

rank = [False] * 8

count = 0
for i in range(N):
  if 3200 <= a[i]:
    count += 1
  else:
    rank[int(a[i]/400)] = True

minimum = rank.count(True)
maximum = min(minimum + count, 8)
print minimum, maximum

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if __name__ == "__main__":
    N = int(input())
    rates = list(map(int, input().split(" ")))
    color_list = [0] * 8

    free_num = 0
    for rate in rates:
        if rate >= 3200:
            free_num += 1
        else:
            color_list[get_index(rate)] += 1

    color_kind = len(list(filter(lambda x: x > 0, color_list)))
    if free_num == 0:
        print(str(color_kind) + " " + str(color_kind))
    elif color_kind == 8:
        print("8 8")
    else:
        print(str(color_kind) + " " + str(min(8, color_kind + free_num)))

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3

n = int(input())
a = list(map(int, input().split()))
s = set()
for i in a:
    if 1 <= i <= 399 : s.add(1)
    if 400 <= i <= 799 : s.add(2)
    if 800 <= i <= 1199 : s.add(3)
    if 1200 <= i <= 1599 : s.add(4)
    if 1600 <= i <= 1999 : s.add(5)
    if 2000 <= i <= 2399 : s.add(6)
    if 2400 <= i <= 2799 : s.add(7)
    if 2800 <= i : s.add(8)
print(len(s), len(s) + (len([1 for x in a if x > 3199])))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0]*9
i = input().split()
for x in range(n):
 y = int(i[x])
 if 1<= y <=399:
  a[0] += 1
 elif 400<= y <=799:
  a[1] += 1
 elif 800 <= y <= 1199:
  a[2] += 1
 elif 1200 <= y <= 1599:
  a[3] += 1
 elif 1600 <= y <= 1999:
  a[4] += 1
 elif 2000 <= y <= 2399:
  a[5] += 1
 elif 2400 <= y<= 2799:
  a[6] += 1
 elif 2800 <= y <= 3199:
  a[7] += 1
 else :
  a[8] += 1 
count = 0
for x in range(8):
 if a[x] > 0:
  count += 1
b = 8 - count
if b < a[-1]:
 a[-1] = b
print(count,count+a[-1])

Submission status: Wrong Answer

Solution code:
N=int(raw_input())
a=map(int,raw_input().split(' '))

color=[0]*8
free=0

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

c=len(color)-color.count(0)

m=c+free
if m>9:
    m=9

print c,m

Submission status: Wrong Answer

Solution code:
N = int(input())
Rates = list(map(int, input().split()))
Colors = []
Rainbow = 0

for Rate in Rates:
    if Rate < 400:
        Colors.append("灰色")
    elif Rate < 800:
        Colors.append("茶色")
    elif Rate < 1200:
        Colors.append("緑色")
    elif Rate < 1600:
        Colors.append("水色")
    elif Rate < 2000:
        Colors.append("青色")
    elif Rate < 2400:
        Colors.append("黄色")
    elif Rate < 2800:
        Colors.append("橙色")
    elif Rate < 3200:
        Colors.append("赤色")
    else:
        Rainbow += 1

Color = set(Colors)
if len(Color) != 0:
    print(len(Color) , len(Color) + Rainbow)
print(1 , len(Color) + Rainbow)

Submission status: Wrong Answer

Solution code:


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


def free(dic):
    return dic[0]


def nonzero(dic):
    ret = 0
    for k, v in dic.items():
        if v != 0:
            ret += 1
    return ret


n = int(input())
a = list(map(int, input().split()))
c = [assign(e) for e in a]

dic = {i: 0 for i in range(9)}
for e in c:
    if e == -1:
        dic[0] += 1

    else:
        dic[e] = 1

l = len(dic.keys())
a = free(dic)
b = nonzero(dic)

print('{} {}'.format(b - min(l-b, a), b+a))

Submission status: Wrong Answer

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

COLOR = 8
cnt, ov = [0] * COLOR, 0
for i in range(N):
    if a[i] < 3200:
        cnt[a[i] // 400] += 1
    else:
        ov += 1

used, unused = 0, 0
for c in cnt:
    if c > 0:
        used += 1
    else:
        unused += 1

print(max(1, used), used + min(unused, ov))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
b = set( ai//400 for ai in a)
m = len([ai for ai in a if ai > 3199])

if m == 0:
    print("{0} {0}".format(len(b)))
else:
    print("{0} {1}".format(max(len(b) - 1, 1), min(len(b) - 1+ m, 8)))

Submission status: Wrong Answer

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

def cl(n):
    return n//400

buff=[0]*9


for i in a:
    color=cl(i)
    if color>8:
        color=8
    buff[color]+=1

min=0
for i in range(len(buff)-1):
    if buff[i]>=1:
        min+=1

max=min+buff[8]
if max>8:
    max=8

print(str(min)+" "+str(max))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from collections import Counter
N = int(input())
a = [int(n)//400 for n in input().split()]
counter = Counter(a)

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

rainbow_coder = 0
for i in range(8, 13):
    rainbow_coder += counter[i]

print("{} {}".format(max(1, colors), min(8, colors+rainbow_coder)))

Submission status: Wrong Answer

Solution code:
N=int(raw_input())
a=map(int,raw_input().split())
c=[0,0,0,0,0,0,0,0]
m=0
for i in range(N):
    b =a[i]/ 400
    if b < 8:
        c[b]+=1
    else:
        m+=1


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

ma=ans+m
if ma > 8:
    ma = 8
print ans,ma

Submission status: Wrong Answer

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

a.sort()

minc=0
maxc=0

for i in range(1,9):
    if len([x for x in a if x<400*i and x>=400*(i-1)]):
        minc+=1

if minc:
    maxc = minc + len([x for x in a if x<400*9 and x>=400*(9-1)])
else:
    maxc = len([x for x in a if x<400*9 and x>=400*(9-1)])
    minc = 1

print(str(minc) + ' ' + str(maxc))

Submission status: Wrong Answer

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

def get_cols(rates):
    col_flags = [False for _ in range(8)]
    wild_colors = 0
    for rate in rates:
        if rate >= 3200:
            wild_colors += 1
        else:
            col_flags[rate // 400] = True
    min_cols = col_flags.count(True)
    max_cols = min_cols + wild_colors
    if max_cols > 8: max_cols = 8
    return (min_cols, max_cols)

print("{} {}".format(*get_cols(rates)))

Submission status: Wrong Answer

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

a.sort()

minc=0
maxc=0

for i in range(1,9):
    if len([x for x in a if x<400*i and x>=400*(i-1)]):
        minc+=1

if minc:
    maxc = minc + len([x for x in a if x<400*9 and x>=400*(9-1)])
else:
    maxc = len([x for x in a if x<400*8 and x>=400*(8-1)])
    minc = 1

print(str(minc) + ' ' + str(maxc))

Submission status: Wrong Answer

Solution code:

borders = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
def getcolor(rate):
    i = 0
    for border in borders:
        if rate < border:
            return i
        i += 1
    return -1

N = int(input())
rates = [int(x) for x in input().split(" ")]
colors = [0 for _ in range(len(borders))]
topcoders = 0

for rate in rates:
    c = getcolor(rate)
    if c != -1:
        colors[c] = 1
    else:
        topcoders += 1

s_c = sum(colors)

print(max(s_c, 1), min(s_c + topcoders, len(borders)))

Submission status: Wrong Answer

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

X = [0 for _ in range(13)]
for a in A:
    X[a / 400] += 1
cnt = 0
for x in X[:8]:
    if x != 0:
        cnt += 1
cnt2 = sum(X[8:])
print cnt, min(8, cnt + cnt2)

Submission status: Wrong Answer

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

nu=0
h=[0]*8
for sa in a:
    fsa=int(sa/400)
    if fsa<=7:
        h[fsa]=1
    else:
        nu+=1

Min=sum(h)
Max=min(7,Min+(nu))

print(str(Min)+" "+str(Max))

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = map(int, raw_input().split())
b = []
cnt = 0
for i in range(0, N):
    if a[i] / 400 >= 8:
        cnt += 1
    else:
        b.append(a[i]/400)
b = set(b)
print len(b)
print len(b) + cnt

Submission status: Wrong Answer

Solution code:
def whichcolor(n):
	if n < 3200:
		return n / 400
	else:
		return 8

def countzero(lst):
	cnt = 0
	for i in range(0, len(lst)):
		if lst[i] == 0:
			cnt += 1
	return cnt

n = int(raw_input())
inpt = map(int, raw_input().split())

color = [0, 0, 0, 0, 0, 0, 0, 0]
almighty = 0

for i in range(0, n):
	c = whichcolor(inpt[i])
	if c == 8:
		almighty += 1
	else:
		color[c] += 1

zro = countzero(color)
min = 8 - zro
if min == 0:
	min = 1
max = 8 - zro + almighty
if max > 8:
	max = 8
print str(min) + ' ' + str(max)

Submission status: Wrong Answer

Solution code:
N=int(raw_input())
a=map(int,raw_input().split(' '))

color=[0]*8
free=0

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

print color,free

c=len(color)-color.count(0)

m=c+free
if m>9:
    m=9

print c,m

Submission status: Wrong Answer

Solution code:
dic={}
n=int(input())
data=list(map(int,input().split()))
ans=0
for i in range(n):
    if data[i]>3199:
        ans+=1
    elif data[i]//400 not in dic:
        dic[data[i]//400]=1
if len(dic)==0:
    print(1)
else:
    print(len(dic),ans+len(dic))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
R = [0]*9
for r in a:
  rr = r//400
  if rr < 8:
    R[rr] = 1
  else:
    R[8] += 1
s2 = sum(R)
s1 = s2 - R[8]
print(s1,s2)

Submission status: Wrong Answer

Solution code:
N = int(input())
Rates = list(map(int, input().split()))
Colors = []
Rainbow = 0

for Rate in Rates:
    if Rate < 400:
        Colors.append("灰色")
    elif Rate < 800:
        Colors.append("茶色")
    elif Rate < 1200:
        Colors.append("緑色")
    elif Rate < 1600:
        Colors.append("水色")
    elif Rate < 2000:
        Colors.append("青色")
    elif Rate < 2400:
        Colors.append("黄色")
    elif Rate < 2800:
        Colors.append("橙色")
    elif Rate < 3200:
        Colors.append("赤色")
    else:
        Rainbow += 1

Color = set(Colors)
print(len(Color) , len(Color) + Rainbow)