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:
import numpy as np
N=int(input())
a=list(map(int,input().split()))
a=sorted(a)
f=np.zeros(8)
ca=0
ci=0
for item in a:
    if(item<400):
        if(not f[0]):
            f[0]=1
            ca+=1
            ci+=1
        continue
    elif(item<800):
        if(not f[1]):
            f[1]=1
            ca+=1
            ci+=1
        continue
    elif(item<1200):
        if(not f[2]):
            f[2]=1
            ca+=1
            ci+=1
        continue
    elif(item<1600):
        if(not f[3]):
            f[3]=1
            ca+=1
            ci+=1
        continue
    elif(item<2000):
        if(not f[4]):
            f[4]=1
            ca+=1
            ci+=1
        continue
    elif(item<2400):
        if(not f[5]):
            f[5]=1
            ca+=1
            ci+=1
        continue
    elif(item<2800):
        if(not f[6]):
            f[6]=1
            ca+=1
            ci+=1
        continue
    elif(item<3200):
        if(not f[7]):
            f[7]=1
            ca+=1
            ci+=1
        continue
    elif(int(np.sum(f))!=8):
        i=np.where(f==0)[0][0]
        f[i]=1
        ca+=1
        if(ci==0):
            ci+=1
        continue
    else:
        break
print(ci,ca)

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
a=list(map(int,input().split()))
a=sorted(a)
f=np.zeros(8)
ca=0
ci=0
for item in a:
    if(item<400):
        if(not f[0]):
            f[0]=1
            ca+=1
            ci+=1
        continue
    elif(item<800):
        if(not f[1]):
            f[1]=1
            ca+=1
            ci+=1
        continue
    elif(item<1200):
        if(not f[2]):
            f[2]=1
            ca+=1
            ci+=1
        continue
    elif(item<1600):
        if(not f[3]):
            f[3]=1
            ca+=1
            ci+=1
        continue
    elif(item<2000):
        if(not f[4]):
            f[4]=1
            ca+=1
            ci+=1
        continue
    elif(item<2400):
        if(not f[5]):
            f[5]=1
            ca+=1
            ci+=1
        continue
    elif(item<2800):
        if(not f[6]):
            f[6]=1
            ca+=1
            ci+=1
        continue
    elif(item<3200):
        if(not f[7]):
            f[7]=1
            ca+=1
            ci+=1
        continue
    elif(int(np.sum(f))<8):
        f[np.where(f==0)[0]]=1
        ca+=1
        continue
    else:
        break
print(ci,ca)

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
a=list(map(int,input().split()))
a=sorted(a)
f=np.zeros(8)
ca=0
ci=0
for item in a:
    if(item<400):
        if(not f[0]):
            f[0]=1
            ca+=1
            ci+=1
        continue
    elif(item<800):
        if(not f[1]):
            f[1]=1
            ca+=1
            ci+=1
        continue
    elif(item<1200):
        if(not f[2]):
            f[2]=1
            ca+=1
            ci+=1
        continue
    elif(item<1600):
        if(not f[3]):
            f[3]=1
            ca+=1
            ci+=1
        continue
    elif(item<2000):
        if(not f[4]):
            f[4]=1
            ca+=1
            ci+=1
        continue
    elif(item<2400):
        if(not f[5]):
            f[5]=1
            ca+=1
            ci+=1
        continue
    elif(item<2800):
        if(not f[6]):
            f[6]=1
            ca+=1
            ci+=1
        continue
    elif(item<3200):
        if(not f[7]):
            f[7]=1
            ca+=1
            ci+=1
        continue
    elif(int(np.sum(f))<=8):
        f[np.where(f==0)[0]]=1
        ca+=1
        continue
    else:
        break
print(ci,ca)

Submission status: Wrong Answer

Solution code:
input_line_1 = raw_input()
input_line_2 = raw_input()
#N = int(input_line_1)
array = []
count_2 = 0
for i in input_line_2.split(" "):
	point = int(i)/400
	if point < 8:
		if point not in array:
			array.append(point)
	else:
		count_2 += 1

max_point = len(array) + count_2
min_pount = len(array)

print min_pount, " ", max_point

Submission status: Wrong Answer

Solution code:
input_line_1 = raw_input()
input_line_2 = raw_input()
#N = int(input_line_1)
array = []
count_2 = 0
for i in input_line_2.split(" "):
	point = int(i)/400
	if point < 8:
		if point not in array:
			array.append(point)
	else:
		count_2 += 1

max_point = min(len(array) + count_2, 8)
min_pount = len(array)

print min_pount, " ", max_point

Submission status: Wrong Answer

Solution code:
input_line_1 = raw_input()
input_line_2 = raw_input()
#N = int(input_line_1)
array = []
count_2 = 0
for i in input_line_2.split(" "):
	point = int(i)/400
	if point < 8:
		if point not in array:
			array.append(point)
	else:
		count_2 += 1

max_point = min(len(array) + count_2, 8)
min_pount = max(len(array), count_2)

print min_pount, " ", max_point

Submission status: Wrong Answer

Solution code:
input_line_1 = raw_input()
input_line_2 = raw_input()
#N = int(input_line_1)
array = []
count_2 = 0
for i in input_line_2.split(" "):
	if (int(i)) < 3200:
		if int(i)/400 not in array:
			array.append(int(i)/400)
	else:
		count_2 += 1

max_point = min(len(array) + count_2, 8)
min_pount = max(len(array), count_2)

print min_pount, " ", max_point

Submission status: Wrong Answer

Solution code:
input_line_1 = raw_input()
input_line_2 = raw_input()
#N = int(input_line_1)
array = []
count_2 = 0
for i in input_line_2.split(" "):
	if (int(i)) < 3200:
		if int(i)/400 not in array:
			array.append(int(i)/400)
	else:
		count_2 += 1

max_point = max(len(array) + count_2, 8)
min_pount = min(len(array), count_2)

print min_pount, " ", max_point

Submission status: Wrong Answer

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

c = [0, 0, 0, 0, 0, 0, 0, 0, 0]

for rate in a:
    if (rate >= 1) and (400 > rate):
        c[0] += 1
    elif (rate >= 400) and (800 > rate):
        c[1] += 1
    elif (rate >= 800) and (1200 > rate):
        c[2] += 1
    elif (rate >= 1200) and (1600 > rate):
        c[3] += 1
    elif (rate >= 1600) and (2000 > rate):
        c[4] += 1
    elif (rate >= 2000) and (2400 > rate):
        c[5] += 1
    elif (rate >= 2400) and (2800 > rate):
        c[6] += 1
    elif (rate >= 2800) and (3200 > rate):
        c[7] += 1
    else:
        c[8] += 1
        
color_rigid = len([i for i, e in enumerate(c[:8]) if e != 0])

print ("%d %d"%(max(1, color_rigid), min(color_rigid + c[8], 8)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
l = [0 for i in range(9)]

for i in a:
    if i // 400 >= 8:
        l[8] += 1
    else:
        l[i // 400] = 1
print(max(1, sum(l[:8]), sum(l)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
l = [0 for i in range(9)]

for i in a:
    if i // 400 >= 8:
        l[8] += 1
    else:
        l[i // 400] = 1
print(sum(l[:8]), sum(l))

Submission status: Wrong Answer

Solution code:
#Colorful Leaderboard
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
b = sorted (a//400)
cnt = 0
for i in range(len(b)):
    if b[i]  < 8:
        None
    else:
        b[i]+=i
        cnt+=1
c = len(list(set(b)))

print(str(c-cnt) + " " + str(c))

Submission status: Wrong Answer

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

for a in A:
    m = a // 400
    if m >= 8:
        m = 8
    d[m] = d.get(m, 0) + 1

minans = 0
for i in range(8):
    if i in d:
        minans += 1
maxans = minans + d.get(8, 0)
print("{} {}".format(minans, maxans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

N = int(input())
a = list(map(int, input().split()))
r = np.array(a)//400
s = set(r)

if 8 in s and len(s)==1 :
    min = 1
    max = len(a)
elif 8 not in s:
    min = len(s)
    max = len(s)
else :
    min = len(s) - 1
    max = min + len(r[r==8])

print(min, max)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

N = int(input())
a = list(map(int, input().split()))
r = np.array(a)//400
s = set(r)

if 8 not in s:
    min = len(s)
    max = len(s)
else :
    min = len(s) - 1
    max = min + len(r[r==8])

print(min, max)

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = raw_input()

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

max = 0
min = 0
for i in range(9):
	max = max + c[i]

min = max - c[8]
if min == 0:
	min = 1
print (min, max)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

#calc binCount
binCount=np.zeros(9)
for rate in arr:
    rateBin=rate//400
    binCount[min(rateBin,8)]+=1

colorCount=int(np.sum(binCount[:-1]>0))
nc=int(np.sum(binCount[:-1]))
nf=int(binCount[-1])
assert N==nc+nf

if nc>0:
    minColor=colorCount
elif nf>0:
    minColor=1
else:
    minColor=0

maxColor=int(min(colorCount+nf, 8))
print(minColor, maxColor)

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = raw_input()

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

max = 0
min = 0
for i in range(9):
	max = max + c[i]

min = max - c[8]

	
print min,
print max

Submission status: Wrong Answer

Solution code:
import numpy as np

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

#calc binCount
binCount=np.zeros(9)
for rate in arr:
    rateBin=rate//400
    binCount[min(rateBin,8)]+=1
print(binCount)

colorCount=int(np.sum(binCount[:-1]>0))
nc=int(np.sum(binCount[:-1]))
nf=int(binCount[-1])
assert N==nc+nf
print(colorCount, nc, nf)

if nc>0:
    minColor=colorCount
elif nf>0:
    minColor=1
else:
    minColor=0

maxColor=int(min(colorCount+nf, 8))
print(minColor, maxColor)

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = raw_input()

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

max = 0
min = 0
for i in range(9):
	max = max + c[i]

min = max - c[8]
if max > 9:
	max = 9
	
print min,
print max

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = raw_input()

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

max = 0
min = 0
for i in range(9):
	max = max + c[i]

min = max - c[8]

print min,
print max

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = raw_input()

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

max = 0
min = 0
for i in range(9):
	max = max + c[i]

min = max - c[8]

print (min,max)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

#calc binCount
binCount=np.zeros(9)
for rate in arr:
    rateBin=rate//400
    binCount[min(rateBin,8)]+=1


colorCount=0
nc=0
for i in range(8):
    if binCount[i]>0:
        nc+=binCount[i]
        colorCount+=1

nf=N-nc

if colorCount>0:
    minColor=colorCount
elif nf>0:
    minColor=1
else:
    minColor=0

maxColor=int(min(colorCount+nf, 8))
print(minColor, maxColor)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

binCount=np.zeros(9)

for rate in arr:
    rateBin=rate//400
    if rateBin>=8:
        binCount[8]+=1
    else:
        binCount[rateBin]+=1

colorCount=0
nc=0
for i in range(8):
    if binCount[i]>0:
        colorCount+=1
        nc+=binCount[i]
nf=N-nc

if colorCount>0:
    minColor=colorCount
else:
    minColor=1

maxColor=int(min(colorCount+nf, 8))
print(minColor, maxColor)

Submission status: Wrong Answer

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

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

colmin = max(sum(flg[0:8]), 1)
colmax = min(sum(flg), 8)
print(colmin, colmax)

Submission status: Wrong Answer

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

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

colmin = max(sum(flg[0:8]), 1)
colmax = min(sum(flg), 8)
print(colmin, colmax)

Submission status: Wrong Answer

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

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

colmin = sum(flg[0:8])
colmax = min(sum(flg), 8)
print(colmin, colmax)

Submission status: Wrong Answer

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
n = ni()
a = na()
f = [0]*8
sp = 0
for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1

print(sum(f))
if sum(f) > 0:
    print("{} {}".format(sum(f), sum(f)+sp))
else:
    print("{} {}".format(sum(f)+min(sp,1), sum(f)+sp))

Submission status: Wrong Answer

Solution code:
import sys

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

c = [0 for i in range(8)]
o = 0
max_color = 0
min_color = 0

for i in range(N):
    if(A[i]>=3200):
        o += 1
        continue
    c[int(A[i]/400)] = 1

if (sum(c)+o > 8):
    max_color = 8
else:
    max_color = sum(c) + o

if(o > sum(c)):
    if (o - sum(c) > 8):
        min_color = 8
    else:
        min_color = o - sum(c)
else:
    min_color = sum(c)

print (min_color, max_color)

Submission status: Wrong Answer

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

b = [0, 0, 0, 0, 0, 0, 0, 0]
c = 0

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

print sum(b), sum(b) + c

Submission status: Wrong Answer

Solution code:
def get_color_type_num(a_list):

    c_list = [0 for i in range(9)]

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

    c_num = 0
    c_free = c_list[8]
    for i, c in enumerate(c_list):
        if i == 8:
            c_free = c
        elif c:
            c_num += 1

    min_c = c_num
    max_c = min_c + c_free
    if max_c > 8:
        max_c = 8
    if min_c == 0:
        min_c = 1

    return min_c, max_c


if __name__ == '__main__':
    N = input()
    a_list = [int(i) for i in input().split()]

    min_c, max_c = get_color_type_num(a_list)
    print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
def get_color_type_num(a_list):

    c_list = [0 for i in range(9)]

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

    c_num = 0
    c_free = c_list[8]
    for i, c in enumerate(c_list):
        if i == 8:
            c_free = c
        elif c:
            c_num += 1

    min_c = c_num
    max_c = min_c + c_free
    if max_c > 8:
        max_c = 8
    if min_c == 0:
        min_c = 1

    return min_c, max_c


if __name__ == '__main__':
    N = input()
    a_list = [int(i) for i in input().split()]

    min_c, max_c = get_color_type_num(a_list)
    print(min_c, max_c)

Submission status: Wrong Answer

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

b = [0]*9

for i in a:
        if i < 3200:
                b[i//400] = 1
        else:
                b[8] += 1
if (sum(b[:8]) == 0):
        print(sum(b),sum(b[:8]))
else:
        print(sum(b),sum(b))

Submission status: Wrong Answer

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

b = [0]*9

for i in a:
        if i < 3200:
                b[i//400] = 1
        else:
                b[8] += 1
if (sum(b[:8]) == 0):
        print(sum(b),sum(b))
else:
        print(sum(b),sum(b[:8]))

Submission status: Wrong Answer

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

b = [0]*9

for i in a:
        if i < 3200:
                b[i//400] = 1
        else:
                b[8] += 1

if b[8] == 0:
        print(str(9-b.count(0))+" "+str(9-b.count(0)))
else:
        print(str(8-b.count(0))+" "+str(8-b.count(0)+b[8]))

Submission status: Wrong Answer

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

b = [0]*9

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

if b[8] == 0:
        print(str(9-b.count(0))+" "+str(9-b.count(0)))
else:
        print(str(8-b.count(0))+" "+str(8-b.count(0)+b[8]))

Submission status: Wrong Answer

Solution code:

    #レート 1-399：灰色
    #レート 400-799：茶色
    #レート 800-1199：緑色
    #レート 1200-1599：水色
    #レート 1600-1999：青色
    #レート 2000-2399：黄色
    #レート 2400-2799：橙色
    #レート 2800-3199：赤色

import numpy as np
n = input()
a = np.array(list(map(int, input().split())))
a = a // 400
b = set()
sa = 0
ans = 0
for i in a:
    if i >= 8:
        sa+=1
    else:
        b.add(i)

print(len(b), len(b)+sa)

Submission status: Wrong Answer

Solution code:
#入力
N = int(input())
a_list = []
a_list = list(map(int,input().split()))

#変数を用意
g_list = [0]*9

#グループ1の要素があるか確認
for i in range(N):
    if 1 <= a_list[i] <= 399:
        g_list[0] = 1
        break

#グループ2から8の要素があるか確認
for j in range(1,8):
    for k in range(N):
        if 400*j <= a_list[k] <= (400*(j+1)-1):
            g_list[j] = 1
            break

#グループ1から8の要素数をgに代入
g = 0
for m in range(8):
    g += g_list[m] 

#グループ9の要素がいくつあるか数える
g_list[8] = 0
for l in range(N):
    if a_list[l] >= 3200:
        g_list[8] += 1

#条件分岐して数える
if g_list[8]==0:
    print(g,g)

elif g==0:
    if g_list[8] >= 8:
        print(1,8)
    else:
        print(1,g_list[8])

elif g==8:
    print(8,8)
    
else:
    if g + g_list[8] >=8:
        print(g,8)
    else:
        print(g,g+g_list[8])

Submission status: Wrong Answer

Solution code:
import numpy as np
n=input()
n=int(n)
a=input().split()
b=np.zeros(n)
div=0
num_8=0
for i in range(n):
 a[i]=int(a[i])
 if a[i]<=399 and a[i]>=1:
  b[i]=0
 elif a[i]>=400 and a[i]<=799:
  b[i]=1
 elif a[i]>=800 and a[i]<=1199:
  b[i]=2
 elif a[i]>=1200 and a[i]<=1599:
  b[i]=3
 elif a[i]>=1600 and a[i]<=1999:
  b[i]=4
 elif a[i]>=2000 and a[i]<=2399:
  b[i]=5
 elif a[i]>=2400 and a[i]<=2799:
  b[i]=6
 elif a[i]>=2800 and a[i]<=3199:
  b[i]=7
 else:
  b[i]=8
  num_8=num_8+1
for i in range(8):
 if i in b:
  div=div+1
min=div
max=div+num_8
print(min,max)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=input()
n=int(n)
a=input().split()
b=np.zeros(n)
div=0
num_8=0
for i in range(n):
 a[i]=int(a[i])
 if a[i]<=399 and a[i]>=1:
  b[i]=0
 elif a[i]>=400 and a[i]<=799:
  b[i]=1
 elif a[i]>=800 and a[i]<=1199:
  b[i]=2
 elif a[i]>=1200 and a[i]<=1599:
  b[i]=3
 elif a[i]>=1600 and a[i]<=1999:
  b[i]=4
 elif a[i]>=2000 and a[i]<=2399:
  b[i]=5
 elif a[i]>=2400 and a[i]<=2799:
  b[i]=6
 elif a[i]>=2800 and a[i]<=3199:
  b[i]=7
 else:
  b[i]=8
  num_8=num_8+1
for i in range(8):
 if i in b:
  div=div+1
min=div
max=div+num_8
if min==0:
 min=1
if max>8:
 max=8
print(min,max)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=input()
n=int(n)
a=input().split()
b=np.zeros(n)
div=0
num_8=0
for i in range(n):
 a[i]=int(a[i])
 if a[i]<=399 and a[i]>=1:
  b[i]=0
 elif a[i]>=400 and a[i]<=799:
  b[i]=1
 elif a[i]>=800 and a[i]<=1199:
  b[i]=2
 elif a[i]>=1200 and a[i]<=1599:
  b[i]=3
 elif a[i]>=1600 and a[i]<=1999:
  b[i]=4
 elif a[i]>=2000 and a[i]<=2399:
  b[i]=5
 elif a[i]>=2400 and a[i]<=2799:
  b[i]=6
 elif a[i]>=2800 and a[i]<=3199:
  b[i]=7
 else:
  b[i]=8
  num_8=num_8+1
for i in range(8):
 if i in b:
  div=div+1
min=div
max=div+num_8
if max>8:
 max=8
print(min,max)

Submission status: Wrong Answer

Solution code:
n = input()
a = list(map(int, input().split()))
a = sorted(a)
count = [0] * 9
for i in a:
    if i < 3200:
        count[i//400] = 1
    else:
        count[8] += 1
ansMax = min(8, sum(count))
ansMin = sum(count[:8])
if ansMin==0 and count[8] > 0:
    ansMin = 1
print(ansMin, ansMax)

Submission status: Wrong Answer

Solution code:
number = int(input())
rate = [int(i) for i in input().split()]


# In[5]:

counter = {}
for r in rate:
    if 1 <= r < 400:
        counter["grey"] = counter.get("grey", 0) + 1
    if 400 <= r < 800:
        counter["brown"] = counter.get("brown", 0) + 1
    if 800 <= r < 1200:
        counter["green"] = counter.get("green", 0) + 1
    if 1200 <= r < 1600:
        counter["sky"] = counter.get("sky", 0) + 1
    if 1600 <= r < 2000:
        counter["blue"] = counter.get("blue", 0) + 1
    if 2000 <= r < 2400:
        counter["yellow"] = counter.get("yellow", 0) + 1
    if 2400 <= r < 2800:
        counter["orange"] = counter.get("orange", 0) + 1
    if 2800 <= r < 3200:
        counter["red"] = counter.get("red", 0) + 1
    if 3200 <= r:
        counter["color"] = counter.get("color", 0) + 1

answer = 0
for k, v in counter.items():
    if not v == 0:
        answer += 1
        
if counter.get("color", 0) == 0:
    print(str(answer) + " " + str(answer))
else:
    print(str(answer-1) + " " + str(answer-1+counter["color"]))

Submission status: Wrong Answer

Solution code:
number = int(input())
rate = [int(i) for i in input().split()]

counter = {}
for r in rate:
    if 1 <= r < 400:
        counter["grey"] = counter.get("grey", 0) + 1
    if 400 <= r < 800:
        counter["brown"] = counter.get("brown", 0) + 1
    if 800 <= r < 1200:
        counter["green"] = counter.get("green", 0) + 1
    if 1200 <= r < 1600:
        counter["sky"] = counter.get("sky", 0) + 1
    if 1600 <= r < 2000:
        counter["blue"] = counter.get("blue", 0) + 1
    if 2000 <= r < 2400:
        counter["yellow"] = counter.get("yellow", 0) + 1
    if 2400 <= r < 2800:
        counter["orange"] = counter.get("orange", 0) + 1
    if 2800 <= r < 3200:
        counter["red"] = counter.get("red", 0) + 1
    if 3200 <= r:
        counter["color"] = counter.get("color", 0) + 1

answer = 0
for k, v in counter.items():
    if not v == 0:
        answer += 1
        
if counter.get("color", 0) == 0:
    print(str(answer) + " ", str(answer))
else:
    print(str(answer-1) + " " + str(answer-1+counter["color"]))

Submission status: Wrong Answer

Solution code:
import sys


if __name__ == "__main__":
    N = int(input())

    rates = map(int, raw_input().split())
    # rates = [map(int, raw_input().split()) for i in range(N)]

    # tasks = np.array(tasks)
    normal_colors = int(3200/400)
    colors = [0] * normal_colors
    aaa = 0
    for rate in rates:
        if rate >= 3200:
            aaa +=1
        else:
            colors[rate/400] = 1

    print sum(colors), sum(colors)+aaa

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
#レート 1-399：灰色 :gray
#レート 400-799：茶色 :brown
#レート 800-1199：緑色 : green
#レート 1200-1599：水色 :skyblue
#レート 1600-1999：青色 :blue
#レート 2000-2399：黄色 :yellow
#レート 2400-2799：橙色 :orange
#レート 2800-3199：赤色 :red

x = int(input())
y = input().split()

gray = 0
brown = 0
green = 0
skyblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for i in range(x):
    z = int(y[i]) 
    if z < 400:
       gray = 1 
    elif z < 800:
        brown = 1
    elif z < 1200:
        green = 1
    elif z < 1600:
        skyblue = 1
    elif z < 2000:
        blue = 1
    elif z < 2400:
        yellow = 1
    elif z < 2800:
        orange = 1
    elif z < 3200:
        red = 1
    else:
        other = other + 1

if other >= 1:
    ans_max = gray + brown + green + skyblue + blue + yellow + orange + red + other
    ans_min = gray + brown + green + skyblue + blue + yellow + orange + red + 0
    
    print(str(ans_min) + " " + str(ans_max))

else:
    ans = gray + brown + green + skyblue + blue + yellow + orange + red + other
    
    print(str(ans) + " " + str(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
#レート 1-399：灰色 :gray
#レート 400-799：茶色 :brown
#レート 800-1199：緑色 : green
#レート 1200-1599：水色 :skyblue
#レート 1600-1999：青色 :blue
#レート 2000-2399：黄色 :yellow
#レート 2400-2799：橙色 :orange
#レート 2800-3199：赤色 :red

x = int(input())
y = input().split()

#x = 4
#y =[2100, 2500, 2700, 2700]


gray = 0
brown = 0
green = 0
skyblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for i in range(x):
    z = int(y[i]) 
    if z < 400:
       gray = 1 
    elif z < 800:
        brown = 1
    elif z < 1200:
        green = 1
    elif z < 1600:
        skyblue = 1
    elif z < 2000:
        blue = 1
    elif z < 2400:
        yellow = 1
    elif z < 2800:
        orange = 1
    elif z < 3200:
        red = 1
    else:
        other = other + 1

if other > 1:
    ans_max = gray + brown + green + skyblue + blue + yellow + orange + red + other
    ans_min = gray + brown + green + skyblue + blue + yellow + orange + red + 1
    
    print(str(ans_min) + " " + str(ans_max))

else:
    ans = gray + brown + green + skyblue + blue + yellow + orange + red + other
    
    print(str(ans) + " " + str(ans))

Submission status: Wrong Answer

Solution code:
#Python

N = input()
S = raw_input()

#print N
#print S

sub_str1=S[0:S.find('(')]
sub_str2=S[S.find('('):]
#print sub_str1
#print sub_str2



#sub_str1='('*len(sub_str1)+ sub_str1
#print sub_str1

if sub_str2.count('(') > sub_str2.count(')'):
	sub_str2 =sub_str2+')'* ( sub_str2.count('(') - sub_str2.count(')') )
#print sub_str2


S=sub_str1+sub_str2
S='('*(S.count(')')-S.count('('))+S

print S

Submission status: Wrong Answer

Solution code:
N = input()
a = input().split()
scores = [0,0,0,0,0,0,0,0]
score8 = 0
for i in a:
    check = int(int(i) / 400)
    if check > 7:
        score8 += 1
    else:
        scores[check] = 1
score1to7 = sum(scores)
saidai = score1to7 + score8
saisho = score1to7
print(str(saisho) + " " + str(saidai))

Submission status: Wrong Answer

Solution code:
N = input()
a = input().split()
scores = [0,0,0,0,0,0,0,0]
score8 = 0
for i in a:
    check = int(int(i) / 400)
    if check > 7:
        score8 += 1
    else:
        scores[check] = 1
score1to7 = sum(scores)
saidai = score1to7 + score8
saisho = min(max(score1to7, score8), 8)
print(str(saisho) + " " + str(saidai))

Submission status: Wrong Answer

Solution code:
N = input()
a = input().split()
scores = [0,0,0,0,0,0,0,0]
score8 = 0
for i in a:
    check = int(int(i) / 400)
    if check > 7:
        score8 += 1
    else:
        scores[check] = 1
score1to7 = sum(scores)
saidai = min(score1to7 + score8, 8)
saisho = min(max(score1to7, score8), 8)
print(str(saisho) + " " + str(saidai))