Problem:


Score : 300 points

Problem Statement

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

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

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

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

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

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

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

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

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

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

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

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

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

Sample Input 3

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

Sample Output 3

1 1

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



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

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

d = [0] * 9
for i in a:
    if i <= 399:
        d[0] = 1
    elif i <= 799:
        d[1] = 1
    elif i <= 1199:
        d[2] = 1
    elif i <= 1599:
        d[3] = 1
    elif i <= 1999:
        d[4] = 1
    elif i <= 2399:
        d[5] = 1
    elif i <= 2799:
        d[6] = 1
    elif i <= 3199:
        d[7] = 1
    else:
        d[8] += 1

minimam = sum(d[:8])
maximam = min(8, minimam + d[8])

print(minimam, maximam)

Submission status: Wrong Answer

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

d = {0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0}
for i in a:
    if i <= 399:
        d[0] = 1
    elif i <= 799:
        d[1] = 1
    elif i <= 1199:
        d[2] = 1
    elif i <= 1599:
        d[3] = 1
    elif i <= 1999:
        d[4] = 1
    elif i <= 2399:
        d[5] = 1
    elif i <= 2799:
        d[6] = 1
    elif i <= 3199:
        d[7] = 1
    else:
        d[8] += 1

minimam = 0
maximam = 0
for i in range(8):
    if d[i] == 1:
        minimam += 1
maximam = min(8, minimam + d[8])

print(minimam, maximam)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
N = int(raw_input())
rates = map(int, raw_input().split(' '))

colors = [0 for _ in range(8)]
top = 0
for r in rates:
	mod = r / 400
	if mod < 8:
		colors[mod] = 1
	else:
		top += 1	
	
print '{} {}'.format(sum(colors), sum(colors)+top)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
N = int(raw_input())
rates = map(int, raw_input().split(' '))

color_num = {}
for r in rates:
	mod = r / 400
	if mod > 7:
		mod = 8
	color_num[mod] = color_num.setdefault(mod, 0) + 1

minnum = len(color_num)
maxnum = minnum
if 8 in color_num:
	minnum -= 1
	maxnum += color_num[8] - 1
	
print '{} {}'.format(minnum, maxnum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input()
aa = [min(8, int(a) // 400) for a in input().split()]
over3200 = aa.count(8)
colors = len(set(aa))
_min = colors - 1 if over3200 and colors > over3200 else colors
_max = colors + over3200 - 1 if over3200 else colors
print(_min, _max)

Submission status: Wrong Answer

Solution code:
input()
aa = list(map(lambda a: min(8, int(a) // 400), input().split()))
over3200 = aa.count(8)
colors = len(set(aa))
_min = colors - 1 if over3200 else colors
_max = colors + over3200 - 1 if over3200 else colors
print(_min, _max)

Submission status: Wrong Answer

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

color = [0] * 8
over = 0

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

mini = color.count(1)
maxi = color.count(1)
if over >= 1:
    if mini == 0:
        mini = 1

    maxi += over
    if maxi > 8:
        maxi = 8

print(mini,maxi)

Submission status: Wrong Answer

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

GRAY = 400
BROWN = 800
GREEN = 1200
CYAN = 1600
BLUE = 2000
YELLOW = 2400
ORANGE = 2800
RED = 3200

colors = []
over3200 = 0

for i in a:
    if i < GRAY:
        colors.append(GRAY)
    elif i < BROWN:
        colors.append(BROWN)
    elif i < GREEN:
        colors.append(GREEN)
    elif i < CYAN:
        colors.append(CYAN)
    elif i < BLUE:
        colors.append(BLUE)
    elif i < YELLOW:
        colors.append(YELLOW)
    elif i < ORANGE:
        colors.append(ORANGE)
    elif i < RED:
        colors.append(RED)
    else:
        over3200 += 1

colornum = len(set(colors))
mincolor = colornum
maxcolor = colornum + over3200

print(' '.join([str(mincolor),str(maxcolor)]))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(int(a_n[i])/400))
    else:
        count += 1

n_min = len(set(a2_n))
n_max = n_min+count

print(max(1, n_min),min(8,n_max))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])/400)
    else:
        count += 1

    n_min = len(set(a2_n))
    n_max = n_min+count

print(max(1, n_min),min(8,n_max))

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 = 100

for i in range(8):
    set_1 = set(np.where(i*400<=a)[0])
    set_2 = set(np.where(a<(i+1)*400)[0])
    match = list(set_1 & set_2)
    if len(match)>0:
        min+=1
if min==0:
    min=1
    if N>8:
        max = 8
    else:
        max = N
else:
    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:
# -*- coding: utf-8 -*-
import sys

N = input()
an = input()
lit = sorted(map(int, an.split()))
color = {}

for i in range(400, 3201, 400):
    color[i] = list(filter(lambda x: i-400 <= x <i , lit))
rainbow = list(filter(lambda x: x>=3200, lit))
label = 0

for v in color.values():
    if len(v) != 0:
        label += 1

print('{} {}'.format(label, label + len(rainbow)))

Submission status: Wrong Answer

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

N = input()
an = input()
lit = sorted(map(int, an.split()))
color = {}

for i in range(400, 3201, 400):
    color[i] = list(filter(lambda x: i-400 <= x <i , lit))
color[3201] = list(filter(lambda x: x>=3200, lit))
label = 0

for v in color.values():
    if len(v) != 0:
        label += 1
if len(color[3201]) != 0:
    label -= 1

rainbow = len(color[3201])
print('{} {}'.format(label, label + rainbow))

Submission status: Wrong Answer

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

N = input()
an = input()
lit = sorted(map(int, an.split()))
color = {}

for i in range(400, 3201, 400):
    color[i] = list(filter(lambda x: i-400 <= x <i , lit))
color[3201] = list(filter(lambda x: x>=3200, lit))
label = 0

for k, v in color.items():
    if len(v) != 0:
        label += 1
if len(color[3200]) != 0:
    label -= 1

rainbow = len(color[3201])
print('{} {}'.format(label, label + rainbow))

Submission status: Wrong Answer

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

colors = [0,0,0,0,0,0,0,0]
free = 0

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

s = sum(colors)

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

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

# sys.stdin = open("c1.in")


def is_not_zero(x):
    if x != 0:
        return True
    else:
        return False


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

for x in a:
    for l in range(0, 3600, 400):
        if x < l:
            c[l] += 1

g = []
for l in range(400, 3600, 400):
    g.append(c[l] - c[l - 400])
r = n - sum(g)

# print('g:', g, '\nr:', r)

res = [0, 0]
# non_zero = list(filter(lambda x: x != 0, g))
non_zero = list(filter(is_not_zero, g))
res[0] = len(non_zero)
res[1] = res[0] + r
print(res[0], res[1])

Submission status: Wrong Answer

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

colors = [0,0,0,0,0,0,0,0]
free = 0

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

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

Submission status: Wrong Answer

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

colors = [0,0,0,0,0,0,0,0]
free = 0

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

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

Submission status: Wrong Answer

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

colors = [0,0,0,0,0,0,0,0]
free = 0

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

print(str(sum(colors)) + " " + str(min(sum(colors) + free, 8)))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1599:
        color.append("water")
    elif arr[j] >= 1600 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)
result = num + all_num

if "all" in over:
    if num == 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1 8")
            else:
                print("1" + " " +str(all_num) )
        else:
            if result >= 8:
                print(str(num) + " " + "8")
            else:
                print(str(num) + " " +str(result))
else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
if ans == 0:
    ans =1
    ans_sum = flag[8]
elif ans+flag[8]>=8:#
    ans_sum = 8
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
#print(flag[:-1])
if ans == 0 and flag[8]>=8: #レート3200未満なし AND レート3200以上が8人以上
    ans =1
    ans_sum = 8
elif ans == 0:#レート3200未満なし
    ans =1
    ans_sum = flag[8]
elif ans+flag[8]>=8:#
    ans_sum = 8
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)

Submission status: Wrong Answer

Solution code:
def read(): return list(map(int, input().split()))


n = int(input())
a = read()

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

s = sum(c[:8])
mini = 1 if s < 1 else s
maxi = s + c[8]
if maxi > 8: maxi = 8
print("{} {}".format(mini, maxi))

Submission status: Wrong Answer

Solution code:
def read(): return list(map(int, input().split()))


n = int(input())
a = read()

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

s = sum(c[:8])
mini = 1 if s < 1 else s
maxi = s + c[8]
if maxi > 7: maxi = 7
print("{} {}".format(mini, maxi))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
#print(flag[:-1])
if ans == 0 and flag[8]>=8:
    ans =1
    ans_sum = 8
elif ans == 0:
    ans =1
    ans_sum = flag[8]
elif ans+flag[8]>=8:
    ans_sum = 8
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
#print(flag[:-1])
if ans == 0 and flag[8]>=8:
    ans =1
    ans_sum = 8
elif ans == 0 and flag[8]<8:
    ans =1
    ans_sum = flag[8]
elif ans+flag[8]>=8:
    ans_sum = 8
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
#print(flag[:-1])
if ans == 0:
    ans =1
    ans_sum = flag[8]
elif ans+flag[8]>=8:
    ans_sum = 8
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
if ans + flag[8]>=8:
    ans_sum = 8
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)

Submission status: Wrong Answer

Solution code:
if __name__=="__main__":
    N = int(raw_input())
    a = map(int, raw_input().split())
    s = set()
    c = 0
    for x in a:
        x = int(x/400)
        if x>=3200:
            c += 1
        else:
            s.add(x)
    print "{} {}".format(len(s), len(s)+c)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# static colors [gray, brown, green, water, blue, yellow, orange, red, free]
color_list = [0] * 9


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

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

# do
ans = 0
for i in range(len(a_list)):
    n = check_color(a_list[i])
    if (color_list[n] == 0) & (n <= 7):
        ans += 1
    color_list[n] += 1

print(str(ans) + " " + str(ans + color_list[8]))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# static colors [gray, brown, green, water, blue, yellow, orange, red, free]
color_list = [0] * 9


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

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

# do
ans = 0
for i in range(len(a_list)):
    n = check_color(a_list[i])
    if (color_list[n] == 0) & (n <= 7):
        ans += 1
    color_list[n] += 1

print(str(ans) + " " + str(ans + color_list[8]))

Submission status: Wrong Answer

Solution code:
human_count = int(input())
rates = [int(n) for n in input().split(" ")]
color_dic = {"GRAY":False, "BROWN":False, "GREEN":False, "LITEBLUE":False, "BLUE":False, "YELLOW":False, "ORANGE":False, "RED":False, "FREE":0}

for rate in rates:
    if rate < 400:
        color_dic["GRAY"] = True
    elif rate < 800:
        color_dic["BROWN"] = True
    elif rate < 1200:
        color_dic["GREEN"] = True
    elif rate < 1600:
        color_dic["LITEBLUE"] = True
    elif rate < 2000:
        color_dic["BLUE"] = True
    elif rate < 2400:
        color_dic["YELLOW"] = True
    elif rate < 2800:
        color_dic["ORANGE"] = True
    elif rate < 3200:
        color_dic["RED"] = True
    else:
        color_dic["FREE"] += 1
color_count_min = list(color_dic.values()).count(True)
if color_count_min == 0:
    color_count_min = 1
color_count_max = color_count_min + color_dic["FREE"]
print("{} {}".format(color_count_min, color_count_max))

Submission status: Wrong Answer

Solution code:
human_count = int(input())
rates = [int(n) for n in input().split(" ")]
color_dic = {"GRAY":False, "BROWN":False, "GREEN":False, "LITEBLUE":False, "BLUE":False, "YELLOW":False, "ORANGE":False, "RED":False, "FREE":0}

for rate in rates:
    if rate < 400:
        color_dic["GRAY"] = True
    elif rate < 800:
        color_dic["BROWN"] = True
    elif rate < 1200:
        color_dic["GREEN"] = True
    elif rate < 1600:
        color_dic["LITEBLUE"] = True
    elif rate < 2000:
        color_dic["BLUE"] = True
    elif rate < 2400:
        color_dic["YELLOW"] = True
    elif rate < 2800:
        color_dic["ORANGE"] = True
    elif rate < 3200:
        color_dic["RED"] = True
    else:
        color_dic["FREE"] += 1
color_count_min = list(color_dic.values()).count(True)
color_count_max = color_count_min + color_dic["FREE"]
if color_count_min == 0:
    color_count_min = 1
print("{} {}".format(color_count_min, color_count_max))

Submission status: Wrong Answer

Solution code:
human_count = int(input())
rates = [int(n) for n in input().split(" ")]
color_dic = {"GRAY":False, "BROWN":False, "GREEN":False, "LITEBLUE":False, "BLUE":False, "YELLOW":False, "ORANGE":False, "RED":False, "FREE":0}

for rate in rates:
    if rate < 400:
        color_dic["GRAY"] = True
    elif rate < 800:
        color_dic["BROWN"] = True
    elif rate < 1200:
        color_dic["GREEN"] = True
    elif rate < 1600:
        color_dic["LITEBLUE"] = True
    elif rate < 2000:
        color_dic["BLUE"] = True
    elif rate < 2400:
        color_dic["YELLOW"] = True
    elif rate < 2800:
        color_dic["ORANGE"] = True
    elif rate < 3200:
        color_dic["RED"] = True
    else:
        color_dic["FREE"] += 1
color_count_min = list(color_dic.values()).count(True)
color_count_max = color_count_min + color_dic["FREE"]
if color_count_min == 0:
    color_count_min = 1
if color_count_max > 8:
    color_count_max = 8
print("{} {}".format(color_count_min, color_count_max))

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    a = LI()
    d = set()
    t = 0
    for c in a:
        if c >= 3200:
            t += 1
        else:
            d.add(c//400)
    l = len(d)
    return '{} {}'.format(l,min(l+t, 8))


print(main())

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    a = LI()
    d = set()
    t = 0
    for c in a:
        if c < 400:
            d.add(0)
        elif c < 800:
            d.add(1)
        elif c < 1200:
            d.add(2)
        elif c < 1600:
            d.add(3)
        elif c < 2000:
            d.add(4)
        elif c < 2400:
            d.add(5)
        elif c < 2800:
            d.add(6)
        elif c < 3200:
            d.add(7)
        elif c >= 3200:
            t += 1
        else:
            d.add(c//400)
    l = len(d)
    return '{} {}'.format(l,l+t)


print(main())

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N = I()
    a = LI()
    d = set()
    t = 0
    for c in a:
        if c >= 3200:
            t += 1
        else:
            d.add(c//400)
    l = len(d)
    return '{} {}'.format(l,l+t)


print(main())

Submission status: Wrong Answer

Solution code:
human_count = int(input())
rates = [int(n) for n in input().split(" ")]
color_dic = {"GRAY":False, "BROWN":False, "GREEN":False, "LITEBLUE":False, "BLUE":False, "YELLOW":False, "ORANGE":False, "RED":False, "FREE":0}
color_count = 0
for rate in rates:
    if rate < 400:
        color_dic["GRAY"] = True
    elif rate < 800:
        color_dic["BROWN"] = True
    elif rate < 1200:
        color_dic["GREEN"] = True
    elif rate < 1600:
        color_dic["LITEBLUE"] = True
    elif rate < 2000:
        color_dic["BLUE"] = True
    elif rate < 2400:
        color_dic["YELLOW"] = True
    elif rate < 2800:
        color_dic["ORANGE"] = True
    elif rate < 3200:
        color_dic["RED"] = True
    else:
        color_dic["FREE"] += 1
color_count_min = list(color_dic.values()).count(True)
color_count_max = color_count_min + color_dic["FREE"]
if color_count_max > 8:
    color_count_max = 8
print("{} {}".format(color_count_min, color_count_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 color_kind == 0:
        print(str(1) + " " + str(min(8, free_num)))
    else:
        print(str(color_kind) + " " + str(min(8, color_kind + free_num)))

Submission status: Wrong Answer

Solution code:
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
min=len(memo)
if min==0:min=1
max=len(memo)+count
if max>8: max=8
print(min,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
try:min=len(memo)
except:min=1
max=len(memo)+count
if max>8: max=8
print(min,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
min=len(memo)
max=len(memo)+count
if max>8: max=8
print(min,max)

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline())
a  = map(int,stdin.readline().split())
ans = set()
co = 0
for i in a:
 if i < 3200:
  ans.add(i/400)
 else:
  co += 1
print  len(ans),min(8,len(ans) + co)

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline())
a  = map(int,stdin.readline().split())
ans = set()
co = 0
for i in a:
 if i < 3200:
  ans.add(i/400)
 else:
  co += 1
print  len(ans),min(9,len(ans) + co)

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline())
a  = map(int,stdin.readline().split())
ans = set()
co = 0
for i in a:
 if i < 3200:
  ans.add(i/400)
 else:
  co += 1
print  max(len(ans),1),min(9,len(ans) + co)

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline())
a  = map(int,stdin.readline().split())
ans = set()
co = 0
for i in a:
 if i < 3200:
  ans.add(i/400)
 else:
  co += 1
print  max(len(ans),1),min(8,len(ans) + co)

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline())
a  = map(int,stdin.readline().split())
ans = set()
co = 0
for i in a:
 if i < 3200:
  ans.add(i/400)
 else:
  co += 1
print min(8,len(ans) + co)

Submission status: Wrong Answer

Solution code:
input()
a = list(map(int, input().split()))
b = [0] * 9
for i in a:
    if i < 3200:
        b[int(i / 400)] = 1
    else:
        b[8] = b[8] + 1
mini = sum(b[1:8])
if mini == 0:
    mini = 1
maxi = sum(b[1:8]) + b[8]
print(str(mini) + ' ' + str(maxi))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
a_int = list(map(int,a))
col = 400
all_col = 0 
c = [0,0,0,0,0,0,0,0]
for i in range(n):
    if a_int[i] >= 8 * col:
        all_col += 1
    else:
        ii = int(a_int[i]/col)
        if c[ii] < 1:
            c[ii] += 1
        
cnt = c.count(1)
min_c = max(cnt, 1)
max_c = min_c + all_col
if max_c > 8:
    max_c -= max_c -8
print(str(min_c)+' '+str(max_c))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code !

n = int(input())
a = input().split()
a_int = sorted(list(map(int,a)))
 
col = [0,0,0,0,0,0,0,0]
all_col = 0 
 
for i in range(len(a_int)):
    if a_int[i] < 400:
        col[0] += 1
    elif a_int[i] < 800:
        col[1] += 1
    elif a_int[i] < 1200:
        col[2] += 1
    elif a_int[i] < 1600:
        col[3] += 1
    elif a_int[i] < 2000:
        col[4] += 1
    elif a_int[i] < 2400:
        col[5] += 1
    elif a_int[i] < 2800:
        col[6] += 1
    elif a_int[i] < 3200:
        col[7] += 1
    else:
        all_col += 1
 
min_c = max(len(list(filter((lambda x: x > 0), col))),1)
max_c = min_c + all_col
if max_c > 8:
    max_c -= max_c -8
print(str(min_c)+' ' +str(max_c))

Submission status: Wrong Answer

Solution code:
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in range(memTime):
    member = memLate[color]
    if member // 400 >= 8:
        highLate += 1
    elif ((member // 400) in colorList) == False:
        colorList.append(member // 400)
maxColor = len(colorList) + highLate
minColor = len(colorList)
if minColor == 0:
    minColor = 1
print(str() + " " + str(maxColor))