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()))
count=[0,0,0,0,0,0,0,0]
change =0
for a in A:
    if a<400:
        count[0]=1
    elif a<800:
        count[1] =1
    elif a<1200:
        count[2] =1
    elif a<1600:
        count[3] =1
    elif a<2000:
        count[4] =1
    elif a<2400:
        count[5] =1
    elif a<2800:
        count[6] =1
    elif a<3200:
        count[7] =1
    else:
        change +=1
Min=max(sum(count),1)
Max=min(Min + change,8)
print(Min,Max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
rate_list = list(map(int,input().split()))
colors = [0 for _ in range(8)]
pros = 0

for i in range(n):
    rate_color = rate_list[i]//400%9
    if rate_color < 8:
        colors[rate_color] = 1
    else:
        pros += 1

total_color = sum(colors)
max_ans = total_color+pros
if total_color == 0:
    total_color = 1
  
print('{} {}' .format(total_color,max_ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
rate_list = list(map(int,input().split()))
colors = [0 for _ in range(8)]
pros = 0

for i in range(n):
    rate_color = rate_list[i]//400%9
    if rate_color < 8:
        colors[rate_color] = 1
    else:
        pros += 1

total_color = sum(colors)
max_ans = total_color+pros
if total_color == 0:
    total_color = 1
if max_ans > 8:
    max_ans = 8
  
print('{} {}' .format(total_color,max_ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
rate_list = list(map(int,input().split()))
colors = [0 for _ in range(8)]
pros = 0

for i in range(n):
    rate_color = rate_list[i]//400%9
    if rate_color < 8:
        colors[rate_color] = 1
    else:
        pros += 1
total_color = sum(colors)
print('{} {}' .format(total_color,(total_color+pros)%9))

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = list(map(int,input().split()))
pros = 0
for i in range(len(num_list)):
    color = num_list[i]//400
    if color < 8:
        num_list[i] = color
    else:
        num_list[i] = num_list[i-1]
        pros += 1

min_ans = len(set(num_list))
max_ans = len(set(num_list))+pros
print('{} {}' .format(min_ans,max_ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
s=[0]*8
a=0
for i in l:
    if i<400:
        s[0]+=1
    elif i<800:
        s[1]+=1
    elif i<1200:
        s[2]+=1
    elif i<1600:
        s[3]+=1
    elif i<2000:
        s[4]+=1
    elif i<2400:
        s[5]+=1
    elif i<2800:
        s[6]+=1
    elif i<3200:
        s[7]+=1
    else:
        a+=1
#print(s)
b=0
for i in s:
    if i!=0:
        b+=1
print(b,b+a)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
m = {}
non_color = 0

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

if non_color > 0:
    print(max(len(m), 1), min(8, len(m)+non_color))
else:
    print(len(m), len(m))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
m = {}
non_color = 0

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

if non_color > 0:
    print(len(m), min(8, len(m)+non_color))
else:
    print(len(m), len(m))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = list(map(int, input().split()))

d = np.arange(0, 3600, 400)
c = []

for i in range(N):
	for j in range(len(d)-1):
		if d[j] <= a[i] < d[j + 1]:
			c.append(j)
	if a[i] >= 3200:
		c.append(8)

import collections
c_dict=collections.Counter(c)

s_val, s_count=zip(*c_dict.most_common())
nana_ika = [x for x in s_val if x < 8]

if not 8 in s_val:
	print(len(nana_ika), len(nana_ika))

else:
	if len(nana_ika) == 0:
		print(1, c_dict[8])
	elif 8 - len(nana_ika) > c_dict[8]:
		print(len(nana_ika), len(nana_ika) + c_dict[8])
	elif 8 -len(nana_ika) <= c_dict[8]:
		print(len(nana_ika), 8)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = list(map(int, input().split()))

d = np.arange(0, 3600, 400)
c = []

for i in range(N):
	for j in range(len(d)-1):
		if d[j] <= a[i] < d[j + 1]:
			c.append(j)
	if a[i] >= 3200:
		c.append(8)

import collections
c_dict=collections.Counter(c)

s_val, s_count=zip(*c_dict.most_common())
nana_ika = [x for x in s_val if x < 8]

if not 8 in s_val:
	print(len(nana_ika), len(nana_ika))

else:
	if len(nana_ika) == 0:
		print(0, c_dict[8])
	elif 8 - len(nana_ika) > c_dict[8]:
		print(len(nana_ika), len(nana_ika) + c_dict[8])
	elif 8 -len(nana_ika) <= c_dict[8]:
		print(len(nana_ika), 8)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = list(map(int, input().split()))

d = np.arange(0, 3600, 400)
c = []

for i in range(N):
	for j in range(len(d)-1):
		if d[j] <= a[i] < d[j + 1]:
			c.append(j)
	if a[i] >= 3200:
		c.append(8)

import collections
c_dict=collections.Counter(c)

s_val, s_count=zip(*c_dict.most_common())
nana_ika = [x for x in s_val if x < 8]

if not 8 in s_val:
	print(len(nana_ika), len(nana_ika))

else:
	if 8 - len(nana_ika) > c_dict[8]:
		print(len(nana_ika), len(nana_ika) + c_dict[8])
	elif 8 -len(nana_ika) <= c_dict[8]:
		print(len(nana_ika), 8)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = list(map(int, input().split()))

d = np.arange(0, 3600, 400)
c = []

for i in range(N):
	for j in range(len(d)-1):
		if d[j] <= a[i] < d[j + 1]:
			c.append(j)
	if a[i] >= 3200:
		c.append(8)

import collections
s_c=collections.Counter(c)

s_val, s_count=zip(*s_c.most_common())
nana_ika = [x for x in s_val if x < 8]

if not 8 in s_val:
	print(len(nana_ika), len(nana_ika))

else:
	print(len(nana_ika), min(s_c[8]+len(nana_ika), 8))

Submission status: Wrong Answer

Solution code:
N=int(input())
C=[0,0,0,0,0,0,0,0]
R=0
A=list(map(int,input().split()))
for i in range(N):
    if (A[i]//400)<=7:
        C[(A[i]//400)]=1
    else:
        R+=1
col=0
for j in range(len(C)):
    if C[j]>=1:
        col+=1

m=max(col,1)
M=min(col+R,8)
print(m,M)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().strip().split()))
free = 0
col1 = 0
col2 = 0
col3 = 0
col4 = 0
col5 = 0
col6 = 0
col7 = 0
col8 = 0
for i in range(N):
	if a[i] <= 399:
		col1 = 1
	elif a[i] <= 799:
		col2 = 1
	elif a[i] <=1199:
		col3 = 1
	elif a[i] <= 1599:
		col4 = 1
	elif a[i] <= 1999:
		col5 = 1
	elif a[i] <= 2399:
		col6 = 1
	elif a[i] <= 2799:
		col7 = 1
	elif a[i] <= 3199:
		col8 = 1
	else:
		free += 1
print(col1, col2, col3, col4, col5, col6, col7, col8, free)
colsum = col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8
colmax = colsum + free

if colsum == 0:
	colmin = 1
else:
	colmin = colsum
	  
print(colmin, colmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().strip().split()))
free = 0
col1 = 0
col2 = 0
col3 = 0
col4 = 0
col5 = 0
col6 = 0
col7 = 0
col8 = 0
for i in range(N):
	if a[i] <= 399:
		col1 = 1
	elif a[i] <= 799:
		col2 = 1
	elif a[i] <=1199:
		col3 = 1
	elif a[i] <= 1599:
		col4 = 1
	elif a[i] <= 1999:
		col5 = 1
	elif a[i] <= 2399:
		col6 = 1
	elif a[i] <= 2799:
		col7 = 1
	elif a[i] <= 3199:
		col8 = 1
	else:
		free += 1
#print(col1, col2, col3, col4, col5, col6, col7, col8, free)
colsum = col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8
if colsum + free >=8:
	colmax = 8
else:
	colmax = colsum + free

if colsum == 0:
	colmin = 1
else:
	colmin = colsum
	  
print(colmin, colmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().strip().split()))
free = 0
col1 = 0
col2 = 0
col3 = 0
col4 = 0
col5 = 0
col6 = 0
col7 = 0
col8 = 0
for i in range(N):
	if a[i] <= 399:
		col1 = 1
	elif a[i] <= 799:
		col2 = 1
	elif a[i] <=1199:
		col3 = 1
	elif a[i] <= 1599:
		col4 = 1
	elif a[i] <= 1999:
		col5 = 1
	elif a[i] <= 2399:
		col6 = 1
	elif a[i] <= 2799:
		col7 = 1
	elif a[i] <= 3199:
		col8 = 1
	else:
		free += 1
#print(col1, col2, col3, col4, col5, col6, col7, col8, free)
if free > 8:
	free = 8
colmin = col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8
if colmin + free >= 8:
	colmax = 8
else:
	colmax = colmin + free
if colmin == 0:
	colmin = 1

	  
print(colmin, colmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().strip().split()))
free = 0
col1 = 0
col2 = 0
col3 = 0
col4 = 0
col5 = 0
col6 = 0
col7 = 0
col8 = 0
for i in range(N):
	if a[i] <= 399:
		col1 = 1
	elif a[i] <= 799:
		col2 = 1
	elif a[i] <=1199:
		col3 = 1
	elif a[i] <= 1599:
		col4 = 1
	elif a[i] <= 1999:
		col5 = 1
	elif a[i] <= 2399:
		col6 = 1
	elif a[i] <= 2799:
		col7 = 1
	elif a[i] <= 3199:
		col8 = 1
	else:
		free += 1
#print(col1, col2, col3, col4, col5, col6, col7, col8, free)
if free > 8:
	free = 8
colmin = col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8
if colmin + free >= 8:
	colmax = 8
else:
	colmax = colmin + free
if colmin == 0:
	colmin = free

	  
print(colmin, colmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().strip().split()))
free = 0
col1 = 0
col2 = 0
col3 = 0
col4 = 0
col5 = 0
col6 = 0
col7 = 0
col8 = 0
for i in range(N):
	if a[i] <= 399:
		col1 = 1
	elif a[i] <= 799:
		col2 = 1
	elif a[i] <=1199:
		col3 = 1
	elif a[i] <= 1599:
		col4 = 1
	elif a[i] <= 1999:
		col5 = 1
	elif a[i] <= 2399:
		col6 = 1
	elif a[i] <= 2799:
		col7 = 1
	elif a[i] <= 3199:
		col8 = 1
	else:
		free += 1
if free > 8:
	free = 8
colmin = col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8
if colmin == 0:
	colmin = free
if colmin + free >= 8:
	colmax = 8
else:
	colmax = colmin + free
	  
print(colmin, colmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().strip().split()))
free = 0
col1 = 0
col2 = 0
col3 = 0
col4 = 0
col5 = 0
col6 = 0
col7 = 0
col8 = 0
for i in range(N):
	if a[i] < 399:
		col1 = 1
	elif a[i] < 799:
		col2 = 1
	elif a[i] <1199:
		col3 = 1
	elif a[i] < 1599:
		col4 = 1
	elif a[i] < 1999:
		col5 = 1
	elif a[i] < 2399:
		col6 = 1
	elif a[i] < 2799:
		col7 = 1
	elif a[i] < 3199:
		col8 = 1
	else:
		free += 1
if free > 8:
	free = 8
colmin = col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8
if colmin == 0:
	colmin = free
if colmin + free >= 8:
	colmax = 8
else:
	colmax = colmin + free
	  
print(colmin, colmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().strip().split()))
free = 0
col1 = 0
col2 = 0
col3 = 0
col4 = 0
col5 = 0
col6 = 0
col7 = 0
col8 = 0
for i in range(N):
	if a[i] < 399:
		col1 = 1
	elif a[i] < 799:
		col2 = 1
	elif a[i] <1199:
		col3 = 1
	elif a[i] < 1599:
		col4 = 1
	elif a[i] < 1999:
		col5 = 1
	elif a[i] < 2399:
		col6 = 1
	elif a[i] < 2799:
		col7 = 1
	elif a[i] < 3199:
		col8 = 1
	else:
		free += 1
colmin = col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8
if colmin + free >= 8:
	colmax = 8
else:
	colmax = colmin + free
	  
print(colmin, colmax)

Submission status: Wrong Answer

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

baclet = [False] * 9
baclet[8] = 0

for val in a:
    if val < 400:
        baclet[0] = True
    elif val >= 400 and val < 800: 
        baclet[1] = True
    elif val >= 800 and val < 1200: 
        baclet[2] = True
    elif val >= 1200 and val < 1600: 
        baclet[3] = True
    elif val >= 1600 and val < 2000: 
        baclet[4] = True
    elif val >= 2000 and val < 2400: 
        baclet[5] = True
    elif val >= 2400 and val < 2800: 
        baclet[6] = True
    elif val >= 2800 and val < 3200: 
        baclet[7] = True
    elif val >= 3200: 
        baclet[8] += 1

if baclet[:-1].count(True) > 0:
    print(baclet[:-1].count(True),end=" ")
elif baclet[8] > 0:
    print(1,end=" ")

if baclet[8] >= 8:
    print(8)
    exit()
if baclet[8] == 0:
    print(baclet[:-1].count(True))
    exit()

if 8 - baclet[:-1].count(True) <= baclet[8]:
    print(8)
elif 8 - baclet[:-1].count(True) > baclet[8]:
    print(baclet[:-1].count(True) + baclet[8])

Submission status: Wrong Answer

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

baclet = [False] * 9
baclet[8] = 0

for val in a:
    if val < 400:
        baclet[0] = True
    elif val >= 400 and val < 800: 
        baclet[1] = True
    elif val >= 800 and val < 1200: 
        baclet[2] = True
    elif val >= 1200 and val < 1600: 
        baclet[3] = True
    elif val >= 1600 and val < 2000: 
        baclet[4] = True
    elif val >= 2000 and val < 2400: 
        baclet[5] = True
    elif val >= 2400 and val < 2800: 
        baclet[6] = True
    elif val >= 2800 and val < 3200: 
        baclet[7] = True
    elif val >= 3200: 
        baclet[8] += 1

if baclet[:-1].count(True) > 0:
    print(baclet[:-1].count(True),end=" ")
elif baclet[8] > 0:
    print(1,end=" ")

if baclet[:-1].count(True) > 0 and baclet[8] == 0:
    print(baclet[:-1].count(True))
elif baclet[8] >= 8:
    print(8)
elif 8 - baclet[:-1].count(True) <= baclet[8]:
    print(8)
elif 8 - baclet[:-1].count(True) > baclet[8]:
    print(baclet[:-1].count(True) + baclet[8])

Submission status: Wrong Answer

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

baclet = [False] * 9
baclet[8] = 0

for val in a:
    if val < 400:
        baclet[0] = True
    elif val >= 400 and val < 800: 
        baclet[1] = True
    elif val >= 800 and val < 1200: 
        baclet[2] = True
    elif val >= 1200 and val < 1600: 
        baclet[3] = True
    elif val >= 1600 and val < 2000: 
        baclet[4] = True
    elif val >= 2000 and val < 2400: 
        baclet[5] = True
    elif val >= 2400 and val < 2800: 
        baclet[6] = True
    elif val >= 2800 and val < 3200: 
        baclet[7] = True
    elif val >= 3200: 
        baclet[8] += 1

if baclet[:-1].count(True) > 0:
    print(baclet[:-1].count(True),end=" ")
elif baclet[8] > 0:
    print(1,end=" ")

if baclet[:-1].count(True) > 0 and baclet[8] == 0:
    print(baclet[:-1].count(True))
elif baclet[8] >= 8:
    print(8)
elif 8 - baclet[:-1].count(True) <= baclet[8]:
    print(8)
else:
    print(baclet[:-1].count(True) + baclet[8])

Submission status: Wrong Answer

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

baclet = [False] * 9
baclet[8] = 0

for val in a:
    if val < 400:
        baclet[0] = True
    elif val >= 400 and val < 800: 
        baclet[1] = True
    elif val >= 800 and val < 1200: 
        baclet[2] = True
    elif val >= 1200 and val < 1600: 
        baclet[3] = True
    elif val >= 1600 and val < 2000: 
        baclet[4] = True
    elif val >= 2000 and val < 2400: 
        baclet[5] = True
    elif val >= 2400 and val < 2800: 
        baclet[6] = True
    elif val >= 2800 and val < 3200: 
        baclet[7] = True
    elif val >= 3200: 
        baclet[8] += 1

if baclet[:-1].count(True) > 0:
    print(baclet[:-1].count(True),end=" ")
elif baclet[8] > 0:
    print(1,end=" ")

if baclet[8] >= 8:
    print(8)
elif 8 - baclet[:-1].count(True) <= baclet[8]:
    print(8)
else:
    print(baclet[:-1].count(True) + baclet[8])

Submission status: Wrong Answer

Solution code:

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

baclet = [False] * 9
baclet[8] = 0

for val in a:
    if val < 400:
        baclet[0] = True
    elif val >= 400 and val < 800: 
        baclet[1] = True
    elif val >= 800 and val < 1200: 
        baclet[2] = True
    elif val >= 1200 and val < 1600: 
        baclet[3] = True
    elif val >= 1600 and val < 2000: 
        baclet[4] = True
    elif val >= 2000 and val < 2400: 
        baclet[5] = True
    elif val >= 2400 and val < 2800: 
        baclet[6] = True
    elif val >= 2800 and val < 3200: 
        baclet[7] = True
    elif val >= 3200: 
        baclet[8] += 1
if baclet[:-1].count(True) == 0 and baclet[8] > 0 and baclet[8] < 9:
    print(1,baclet[8])
    exit()
elif baclet[:-1].count(True) == 0 and baclet[8] > 8:
    print(1,8)
    exit()
if 8 - baclet[:-1].count(True) >= baclet[8]:
    print(baclet[:-1].count(True) , baclet[:-1].count(True) + baclet[8])
else:
    print(baclet[:-1].count(True) , 8)

Submission status: Wrong Answer

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

baclet = [False] * 9
baclet[8] = 0

for val in a:
    if val < 400:
        baclet[0] = True
    elif val >= 400 and val < 800: 
        baclet[1] = True
    elif val >= 800 and val < 1200: 
        baclet[2] = True
    elif val >= 1200 and val < 1600: 
        baclet[3] = True
    elif val >= 1600 and val < 2000: 
        baclet[4] = True
    elif val >= 2000 and val < 2400: 
        baclet[5] = True
    elif val >= 2400 and val < 2800: 
        baclet[6] = True
    elif val >= 2800 and val < 3200: 
        baclet[7] = True
    elif val >= 3200: 
        baclet[8] += 1

if 8 - baclet[:-1].count(True) >= baclet[8]:
    print(baclet[:-1].count(True) , baclet[:-1].count(True) + baclet[8])
else:
    print(baclet[:-1].count(True) , 8)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=input().split()
for i in range(0,N):
    s=int(S[i])
    if 1<=s<=399:
        S[i]="a"
    if 400<=s<=799:
        S[i]="b"
    if 800<=s<=1199:
        S[i]="c"
    if 1200<=s<=1599:
        S[i]="d"
    if 1600<=s<=1999:
        S[i]="e"
    if 2000<=s<=2399:
        S[i]="f"
    if 2400<=s<=2799:
        S[i]="g"
    if 2800<=s<=3199:
        S[i]="h"
    if 3200<=s:
        S[i]="i"

if "i" in S:
    i=S.count("i")
    B=len(set(S))
    if B==1:
        C=N
        D=N
    else:
        C=B-1
        D=C+i
    
else:
    C=len(set(S))
    D=C

print(C,D)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=input().split()
for i in range(0,N):
    s=int(S[i])
    if 1<=s<=399:
        S[i]="a"
    if 400<=s<=799:
        S[i]="b"
    if 800<=s<=1199:
        S[i]="c"
    if 1200<=s<=1599:
        S[i]="d"
    if 1600<=s<=1999:
        S[i]="e"
    if 2000<=s<=2399:
        S[i]="f"
    if 2400<=s<=2799:
        S[i]="g"
    if 2800<=s<=3199:
        S[i]="h"
    if 3200<=s:
        S[i]="i"
i=S.count("i")
if "i" in S:
    
    C=len(set(S)) -1
    D=C+i
    
else:
    C=len(set(S))
    D=C

print(C,D)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int,input().split()))
D = {}
p = 0
for i in range(N) :
    if L[i] < 400 :
        color = 0
    elif L[i] < 800 :
        color = 1
    elif L[i] < 1200 :
        color = 2
    elif L[i] < 1600 :
        color = 3
    elif L[i] < 2000 :
        color = 4
    elif L[i] < 2400 :
        color = 5
    elif L[i] < 2800 :
        color = 6
    elif L[i] < 3200 :
        color = 7
    else :
        p += 1
    if L[i] < 3200 :
        if color not in D :
            D[color] = 1
        else :
            D[color] += 1
ans1 = len(list(D.keys()))

ans2 = ans1 + p
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
array1 = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
array2 = [True for _ in range(8)]
result1 = 0
plus = 0

for i in range(N):

    if a[i] >= 3200:
        plus += 1
        continue

    for j in range(len(array1)):
        if a[i] < array1[j]:
            if array2[j]:
                result1 += 1
                array2[j] = False
            break

result2 = result1 + plus
if result1 == 0:
    result1 = 1
if result2 > 8:
    result2 = 8


print(result1, result2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
array1 = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
array2 = [True for _ in range(8)]
result1 = 0
plus = 0

for i in range(N):

    if a[i] >= 3200:
        plus += 1
        continue

    for j in range(len(array1)):
        if a[i] < array1[j]:
            if array2[j]:
                result1 += 1
                array2[j] = False
            break

result2 = result1 + plus
if result2 > 8:
    result2 = 8

print(result1, result2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
array1 = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
array2 = [True for _ in range(8)]
result1 = 0
plus = 0

for i in range(N):
    print(i)

    if a[i] >= 3200:
        plus += 1
        continue

    for j in range(len(array1)):
        if a[i] < array1[j]:
            if array2[j]:
                result1 += 1
                array2[j] = False
            break

result2 = result1 + plus
if result2 > 8:
    result2 = 8

print(result1, result2)

Submission status: Wrong Answer

Solution code:
a = int(input())
ar = list(map(int,input().split(" ")))
br = []
count = 0
for r in ar:
    if r >= 1 and r <= 399:
        br.append("g")
    elif r >= 400 and r <= 799:
        br.append("b")
    elif r >= 800 and r <= 1199:
        br.append("gr")
    elif r >= 1200 and r <= 1599:
        br.append("w")
    elif r >= 1600 and r <= 1999:
        br.append("bl")
    elif r >= 2000 and r <= 2399:
        br.append("y")
    elif r >= 2400 and r <= 2799:
        br.append("o")
    elif r >= 2800 and r <= 3199:
        br.append("r")
    else:
        count += 1
print(len(set(br)),count)
if len(set(br)) == 0:
    print(1,count)
else:
    print(len(set(br)),len(set(br)) + count)

Submission status: Wrong Answer

Solution code:
a = int(input())
ar = list(map(int,input().split(" ")))
br = []
count = 0
for r in ar:
    if r >= 1 and r <= 399:
        br.append("g")
    elif r >= 400 and r <= 799:
        br.append("b")
    elif r >= 800 and r <= 1199:
        br.append("gr")
    elif r >= 1200 and r <= 1599:
        br.append("w")
    elif r >= 1600 and r <= 1999:
        br.append("bl")
    elif r >= 2000 and r <= 2399:
        br.append("y")
    elif r >= 2400 and r <= 2799:
        br.append("o")
    elif r >= 2800 and r <= 3199:
        br.append("r")
    else:
        count += 1
if len(set(br)) == 0:
    print(1,count)
elif len(set(br)) + count >= 8:
    print(len(set(br)),8)
else:
    print(len(set(br)),len(set(br)) + count)

Submission status: Wrong Answer

Solution code:
a = int(input())
ar = list(map(int,input().split(" ")))
br = []
count = 0
for r in ar:
    if r >= 1 and r <= 399:
        br.append("g")
    elif r >= 400 and r <= 799:
        br.append("b")
    elif r >= 800 and r <= 1199:
        br.append("gr")
    elif r >= 1200 and r <= 1599:
        br.append("w")
    elif r >= 1600 and r <= 1999:
        br.append("bl")
    elif r >= 2000 and r <= 2399:
        br.append("y")
    elif r >= 2400 and r <= 2799:
        br.append("o")
    elif r >= 2800 and r <= 3199:
        br.append("r")
    else:
        count += 1
print(len(set(br)),count)
if len(set(br)) == 0:
    print(1,count)
elif len(set(br)) + count >= 8:
    print(len(set(br)),8)
else:
    print(len(set(br)),len(set(br)) + count)

Submission status: Wrong Answer

Solution code:
a = int(input())
ar = list(map(int,input().split(" ")))
br = []
count = 0
for r in ar:
    if r >= 1 and r <= 399:
        br.append("g")
    elif r >= 400 and r <= 799:
        br.append("b")
    elif r >= 800 and r <= 1199:
        br.append("gr")
    elif r >= 1200 and r <= 1599:
        br.append("w")
    elif r >= 1600 and r <= 1999:
        br.append("bl")
    elif r >= 2000 and r <= 2399:
        br.append("y")
    elif r >= 2400 and r <= 2799:
        br.append("o")
    elif r >= 2800 and r <= 3199:
        br.append("r")
    else:
        count += 1
if len(set(br)) + count >= 8:
    print(len(set(br)),8)
else:
    print(len(set(br)),len(set(br)) + count)

Submission status: Wrong Answer

Solution code:
# encoding: utf-8
N = int(input())
a = list(map(int, input().split()))

used = 0
rainbow = 0
for ai in a:
    for i in range(8):
        if ai < 400 * (i + 1):
            used = used | (2 ** i)
            break
        else: continue
    else: rainbow += 1

ans = 0
for i in range(8):
    if used & (2 ** i) > 0: ans += 1

print(ans, ans + rainbow)

Submission status: Wrong Answer

Solution code:
# 要は全員自由色のパターンを見落としていた
# もし自由色がいて、かつ、固定色が0人の場合、最小のパターンは1
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))


col = []  # boolean
for rate in range(0, 3200, 400):
    if len(A[(rate <= A) & (A < (rate + 400))]) is not 0:
        col.append(True)
    else:
        col.append(False)

jiyu = len(A[(3200 <= A)])  # 自由枠

assert len(col) == 8

# min
mi = sum(col)

# 以下を見落としていた
if (mi is 0) & (jiyu is not 0):
    mi = 1

ma = mi+jiyu

print("{} {}".format(mi, ma))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))


col = []  # boolean
for rate in range(0, 3200, 400):
    if len(A[(rate <= A) & (A < (rate + 400))]) is not 0:
        col.append(True)
    else:
        col.append(False)

jiyu = len(A[(3200 <= A)])  # 自由枠

assert len(col) == 8

# min
mi = sum(col)

# 自由に色を変えられるって任意のRGBにできるって意味なんかい！！！！！
# # max
# if jiyu < (8 - mi):
#     ma = mi+jiyu
# else:
#     ma = 8

ma = mi+jiyu

print("{} {}".format(mi, ma))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))


col = []  # boolean
for rate in range(0, 3200, 400):
    if len(A[(rate <= A) & (A < (rate + 400))]) is not 0:
        col.append(True)
    else:
        col.append(False)

jiyu = len(A[(3200 <= A)])  # 自由枠

# min
mi = sum(col)

# 自由に色を変えられるって任意のRGBにできるって意味なんかい！！！！！
# # max
# if jiyu < (8 - mi):
#     ma = mi+jiyu
# else:
#     ma = 8

ma = mi+jiyu

print("{} {}".format(mi, ma))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))


col = []  # boolean
for rate in range(0, 3200, 400):
    if len(A[(rate <= A) & (A < (rate + 400))]) is not 0:
        col.append(True)
    else:
        col.append(False)

jiyu = len(A[(3200 <= A)])  # 自由枠

# min
mi = sum(col)

# max
if jiyu < (8 - mi):
    ma = mi+jiyu
else:
    ma = 8

print("{} {}".format(mi, ma))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))


col = []  # boolean
for rate in range(0, 3200, 400):
    if len(A[(rate <= A) & (A < (rate + 400))]) is not 0:
        col.append(True)
    else:
        col.append(False)

jiyu = len(A[(3200 <= A)])  # 自由枠

# min
mi = sum(col)

# max
if jiyu <= (8 - mi):
    ma = mi+jiyu
else:
    ma = 8

print(mi, ma)

Submission status: Wrong Answer

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

if sum(ans[0:9])==0:
    mi=1
else:
    mi=0
    
print("{} {}".format(sum(ans[0:8])+mi,sum(ans)))

Submission status: Wrong Answer

Solution code:
N = input()
a = list(map(int,input().split()))
syurui_min = 0
syurui_max = 0
b = [0] * 9
for i in a:
    b[min(i // 400, 8)] += 1
for i in b:
    if i > 0 and i != b[-1]:
        syurui_min += 1
syurui_max = syurui_min + b[-1]
if syurui_min == 0:
    syurui_min = 1
print("{0} {1}".format(syurui_min, syurui_max))

Submission status: Wrong Answer

Solution code:
N = input()
a = list(map(int,input().split()))
over3200 = 0
syurui_min = 0
syurui_max = 0
b = [0] * 9
for i in a:
    b[min(i // 400, 8)] += 1
for i in b:
    if i > 0 and i != b[8]:
        syurui_min += 1
syurui_max = syurui_min + b[8]
if syurui_min == 0:
    syurui_min = 1
print("{0} {1}".format(syurui_min, syurui_max))

Submission status: Wrong Answer

Solution code:
N = input()
a = list(map(int,input().split()))
over3200 = 0
syurui_min = 0
syurui_max = 0
b = [0] * 9
for i in a:
    b[min(i // 400, 8)] += 1
print(b)
for i in b:
    if i > 0 and i != b[8]:
        syurui_min += 1
syurui_max = syurui_min + b[8]
if syurui_min == 0:
    syurui_min = 1
print("{0} {1}".format(syurui_min, syurui_max))