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: Accepted

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

if num[8] == 0:
    maximum = sum(num[0:8])
    minimum = sum(num[0:8])
else:
    if num[8] == N:
        maximum = N
        minimum = 1
    else:
        maximum = sum(num[0:8]) + num[8]
        minimum = sum(num[0:8])

print(minimum, maximum)

Submission status: Accepted

Solution code:
n = int(input())
lst0 = list(map(int, input().split()))
lst1 = [0, 0, 0, 0, 0, 0, 0, 0]
god = 0
Mx, Mn = (0, 0)
for i in range(n):
    if 1 <= lst0[i] <= 399:
        lst1[0] += 1
    elif 400 <= lst0[i] <= 799:
        lst1[1] += 1
    elif 800 <= lst0[i] <= 1199:
        lst1[2] += 1
    elif 1200 <= lst0[i] <= 1599:
        lst1[3] += 1
    elif 1600 <= lst0[i] <= 1999:
        lst1[4] += 1
    elif 2000 <= lst0[i] <= 2399:
        lst1[5] += 1
    elif 2400 <= lst0[i] <= 2799:
        lst1[6] += 1
    elif 2800 <= lst0[i] <= 3199:
        lst1[7] += 1
    else:
        god += 1

Mn = 8 - lst1.count(0)
Mx = Mn + god
if Mn==0:
    Mn = 1
print(str(Mn) + " " + str(Mx))

Submission status: Accepted

Solution code:
import collections

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

cnt = collections.defaultdict(lambda: 0)
for i in range(N):
    if a[i] <= 399:
        cnt['gray'] += 1
    elif a[i] <= 799:
        cnt['brown'] += 1
    elif a[i] <= 1199:
        cnt['green'] += 1
    elif a[i] <= 1599:
        cnt['sky'] += 1
    elif a[i] <= 1999:
        cnt['blue'] +=1
    elif a[i] <= 2399:
        cnt['yellow'] += 1
    elif a[i] <= 2799:
        cnt['orange'] +=1
    elif a[i] <= 3199:
        cnt['red'] += 1
    else:
        cnt['any'] += 1

key = cnt.keys()
if 'any' in key:
    color_type = len(key) - 1
else:
    color_type = len(key)
    
color_sum = 0

for each in key:
    if each != 'any':
        color_sum += cnt[each]
        
any_sum = N - color_sum

max_type = any_sum + color_type

if color_type == 0:
    min_type = 1
else:
    min_type = color_type

print(min_type, max_type)

Submission status: Accepted

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

import sys
from collections import deque

n = int(sys.stdin.readline())
ai = list(map(int, sys.stdin.readline().split()))

o = [0] * 9

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

on = 0
for i in range(0, 8):
	if o[i] > 0:
		on += 1

min = on
if min == 0:
	min = 1

on += o[8]

max = on

print(str(min) + ' ' + str(max))

Submission status: Accepted

Solution code:
z = input()
cs = [ int(x) for x in input().split() ]
ar = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
up = 0
mn = 0
mx = 0

for x in cs :
  if x < 400 :
    ar[0] = 1
  elif x < 800 :
    ar[1] = 1
  elif x < 1200 :
    ar[2] = 1
  elif x < 1600 :
    ar[3] = 1
  elif x < 2000 :
    ar[4] = 1
  elif x < 2400 :
    ar[5] = 1
  elif x < 2800 :
    ar[6] = 1
  elif x < 3200 :
    ar[7] = 1
  else :
    up = up + 1

if sum(ar) == 0 :
  mn = 1
  mx = up
else :
  mn = sum(ar)
  mx = sum(ar) + up

print(str(mn) + " " + str(mx))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
a=[int(i) for i in input().split()]
b,c,d,e,f,g,h,j,k=0,0,0,0,0,0,0,0,0
for i in range(N):
 if (a[i]<400):
  b=1
 elif (400<=a[i]<800):
  c=1
 elif (800<=a[i]<1200):
  d=1
 elif (1200<=a[i]<1600):
  e=1
 elif (1600<=a[i]<2000):
  f=1
 elif (2000<=a[i]<2400):
  g=1
 elif (2400<=a[i]<2800):
  h=1
 elif (2800<=a[i]<3200):
  j=1
 else:
  k += 1
min=b+c+d+e+f+g+h+j
max=min+k
if min==0:
 min=1
print (min,max)

Submission status: Accepted

Solution code:
n=int(raw_input())
a=map(int,raw_input().split())
#color=[hai,cha,midori,mizu,ao,ki,daidai,aka]
c=[0 for i in xrange(8)]
ext=0
for x in a:
 if 1<=x<=399:
  c[0]=1
 elif 400<=x<=799:
  c[1]=1
 elif 800<=x<=1199:
  c[2]=1
 elif 1200<=x<=1599:
  c[3]+=1
 elif 1600<=x<=1999:
  c[4]=1
 elif 2000<=x<=2399:
  c[5]=1
 elif 2400<=x<=2799:
  c[6]=1
 elif 2800<=x<=3199:
  c[7]=1
 else:
  ext+=1
res1=8-c.count(0)+ext
res2=res1-ext
if res2==0:
 res2=1
print res2,res1

Submission status: Accepted

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

colors=[]
if list(filter(lambda x:x<3200, a)):
    f=lambda x:x<400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:400<=x<800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:800<=x<1200
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1200<=x<1600
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1600<=x<2000
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2000<=x<2400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2400<=x<2800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2800<=x<3200
    colors.append(1 if list(filter(f, a)) else 0)

    print(sum(colors), sum(colors)+len(list(filter(lambda x:3200<=x, a))))

else:
    print(1, n)

Submission status: Accepted

Solution code:
from collections import defaultdict


def main():
    N = int(input())
    a_list = list(map(int, input().split()))
    color_set = set()
    free = 0
    for a in a_list:
        for i, (s, e) in enumerate([(1, 399), (400, 799), (800, 1199), (1200, 1599), (1600, 1999), (2000, 2399), (2400, 2799), (2800, 3199)]):
            if s <= a <= e:
                color_set.add(i)
                break
        else:
            free += 1
    print(max(1, len(color_set)), len(color_set) + free)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
hai,cha,mid,miz,ao,ki,dai,aka,zen = 0,0,0,0,0,0,0,0,0
for i in range(N):
    if a[i] < 400:
        hai = 1
    elif a[i] < 800:
        cha = 1
    elif a[i] < 1200:
        mid = 1
    elif a[i] < 1600:
        miz = 1
    elif a[i] < 2000:
        ao = 1
    elif a[i] < 2400:
        ki = 1
    elif a[i] < 2800:
        dai = 1
    elif a[i] < 3200:
        aka = 1
    else:
        zen += 1
Min = hai+cha+mid+miz+ao+ki+dai+aka
Max = Min+zen
if Min == 0:
    Min = 1
print(Min,Max)

Submission status: Accepted

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 = max(len(array), 1)

print min_pount, " ", max_point

Submission status: Accepted

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), color_rigid + c[8]))

Submission status: Accepted

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: Accepted

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
if sum(l[:8]) == 0:
    print(1, sum(l))
else:
    print(sum(l[:8]), sum(l))

Submission status: Accepted

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(max([1,c-cnt])) + " " + str(c))

Submission status: Accepted

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

def mapper(x): 
    if x >= 3200:
        return -1;
    else:
        return x // 400

n = input()
stage = np.array(list(map(int, input().split())))

r = np.count_nonzero(np.vectorize(mapper)(stage) == -1)
s = len(set(np.vectorize(mapper)(stage).tolist())-set([-1]))

print(max(s,1), s+r)

Submission status: Accepted

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

def mapper(x): 
    if x >= 3200:
        return -1;
    else:
        return x // 400

n = input()

# n行x列の配列を取得
stage = np.array(list(map(int, input().split())))

#-1の個数
r = np.count_nonzero(np.vectorize(mapper)(stage) == -1)

#-1以外の重複個数
s = len(set(np.vectorize(mapper)(stage).tolist())-set([-1]))

print(max(s,1), s+r)

Submission status: Accepted

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
if minans == 0:
    print("{} {}".format(1, N))
    exit()
maxans = minans + d.get(8, 0)
print("{} {}".format(minans, maxans))

Submission status: Accepted

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 = sum(flg)
print(colmin, colmax)

Submission status: Accepted

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,
print max

Submission status: Accepted

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(colorCount+nf)
print(minColor, maxColor)

Submission status: Accepted

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 = sum(flg)
print(colmin, colmax)

Submission status: Accepted

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
        
if sum(f) > 0:
    print("{} {}".format(sum(f), sum(f)+sp))
else:
    print("{} {}".format(sum(f)+min(sp,1), sum(f)+sp))

Submission status: Accepted

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

s = sum(b)
if s == 0:
	s = 1

print s, sum(b) + c

Submission status: Accepted

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

c = [0] * 8
max = 0
for i in a:
    if i >= 3200:
        max += 1
    else:
        c[i // 400] = 1

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

max += min
if min == 0:
    print(1, max)
else:
    print(min, max)

Submission status: Accepted

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

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

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

max += min
if min == 0:
    print(1, max)
else:
    print(min, max)

Submission status: Accepted

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: Accepted

Solution code:

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

from collections import Counter
n = input()
c = Counter([min(int(i) // 400, 8) for i in input().split()])
ans = 0
for i in range(8):
    ans += (1 if c[i] > 0 else 0)
print(max(ans, 1), ans + c[8])

Submission status: Accepted

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) if len(b) != 0 else 1, len(b)+sa)

Submission status: Accepted

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:
    print(1,g_list[8])

else:
    print(g,g+g_list[8])

Submission status: Accepted

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
print(min,max)

Submission status: Accepted

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

Submission status: Accepted

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


# In[7]:

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:
    if answer == 1:
        print("1 " + str(counter["color"]))
    else:
        print(str(answer-1) + " " + str(answer-1+counter["color"]))

Submission status: Accepted

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 max(sum(colors),1), sum(colors)+aaa

Submission status: Accepted

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
    
    if ans_min == 0:
        ans_min = 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: Accepted

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
if score1to7 < 1:
    saisho = 1
else:
    saisho = score1to7
print(str(saisho) + " " + str(saidai))

Submission status: Accepted

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

a=a[0]

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

free=0

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

ma=sum(c)+free



mi=sum(c)
if mi<1:
    mi=1


print(str(mi) + " " + str(ma))

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math

N, = map(int, sys.stdin.readline().rstrip().split())
a_list = list(map(int, sys.stdin.readline().rstrip().split()))

def score_index(score):
    if score < 400:
        return 0
    if score < 800:
        return 1
    if score < 1200:
        return 2
    if score < 1600:
        return 3
    if score < 2000:
        return 4
    if score < 2400:
        return 5
    if score < 2800:
        return 6
    if score < 3200:
        return 7
    else:
        raise Exception()



superplayers = 0
counts = set()
for a in a_list:
    if a < 3200:
        counts.add(score_index(a))
    else:
        superplayers += 1

print("{} {}".format(
    max(len(counts), 1),
    len(counts) + superplayers
))

exit(0)

Submission status: Accepted

Solution code:
N=input()
def waru(num):
    return int(num)//400
a = list(map(waru, input().split()))
b = []
num = 0
for i in a:
    if i >= 8:
        b.append(i)
minu = len(set(a)) - len(set(b))
if minu==0:
    minu = 1
    maxi = len(b)
else:
    maxi = len(b)+minu
print(minu, maxi)

Submission status: Accepted

Solution code:
N=input()
nlist= [int(l) for l in raw_input().split(' ')]

rate= [0,0,0,0,0,0,0,0]
up = 0
for n in nlist:
	if n/400>=8:
		up += 1
	else:
		rate[n/400]=1

print max(1,sum(rate)),sum(rate)+up

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
input()
p =[int(x) for x in input().split(" ")]

r1_399 = 0
r400_799 = 0
r800_1199 = 0
r1200_1599 = 0
r1600_1999 = 0
r2000_2399 = 0
r2400_2799 = 0
r2800_3199 = 0
over3200 = 0

for i in p:
    if 1 <= i <400:
        r1_399 +=1
    elif 400 <= i <800:
        r400_799 +=1
    elif 800 <= i <1200:
        r800_1199 +=1
    elif 1200 <= i <1600:
        r1200_1599 +=1
    elif 1600 <= i <2000:
        r1600_1999 +=1
    elif 2000 <= i <2400:
        r2000_2399 += 1
    elif 2400 <= i < 2800:
        r2400_2799 += 1
    elif 2800<= i <3200:
        r2800_3199 += 1
    elif 3200<= i:
        over3200 += 1
num = 0
for i in [r1_399,r400_799,r800_1199,r1200_1599,r1600_1999,r2000_2399,r2400_2799,r2800_3199]:
    if i > 0:
        num+=1

nummax = num + over3200

if num == 0:
    num +=1
print(str(num)+" " +str(nummax))

Submission status: Accepted

Solution code:
n = int(input())
a = [ int(i) for i in input().split() ]
c = [ 0 for _ in range(8)]
cou = 0

for i in range(n):
    keep=a[i]

    if 1<= keep <=399:
        c[0]=1
    elif 400<= keep <=799:
        c[1]=1
    elif 800<= keep <=1199:
        c[2]=1
    elif 1200<= keep <=1599:
        c[3]=1
    elif 1600<= keep <=1999:
        c[4]=1
    elif 2000<= keep <=2399:
        c[5]=1
    elif 2400<= keep <=2799:
        c[6]=1
    elif 2800<= keep <=3199:
        c[7]=1
    else:
        cou += 1

MAX = MIN = c.count(1)
MAX += cou
MIN = max(MIN,1)


print(MIN,MAX)

Submission status: Accepted

Solution code:

N=input()

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

Rate = []
for i in range(9):
    Rate.append(0)

for i in A:
    index=i//400
    if index > 8:
        index = 8
    Rate[index] = Rate[index] + 1

a = 0

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

Max = a + Rate[8]
Min = max(a, 1)

print(Min, Max)

Submission status: Accepted

Solution code:
import math
N=input()

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

Rate = []
for i in range(9):
    Rate.append(0)

for i in A:
    index=math.floor(i/400)
    if index > 8:
        index = 8
    Rate[index] = Rate[index] + 1

a = 0

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

Max = a + Rate[8]
Min = max(a, 1)

print(Min, Max)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
mi = 0
ma = 0
border = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801]
num = [0 for i in range(9)]
for i in a:
    for j in range(len(border[0:-1])):
        if(border[j] <= i and i < border[j+1]):
            num[j] += 1

for i in num[0:-1]:
    if(i > 0):
        mi += 1
        ma += 1

mi = max(1, mi)
ma = ma+num[-1]
print(mi, ma)

Submission status: Accepted

Solution code:
import math

N=int(input())
s = list(map(int,input().split()))
c = []

for i in range(9):
    c.append(0)

for i in s:
    ii = math.floor(i / 400)
    if ii > 8:
        ii = 8
    c[ii] = c[ii] + 1

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

b = a + c[8]
a = max(a, 1)

print(a, b)

Submission status: Accepted

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

flag1 = True
flag2 = True
flag3 = True
flag4 = True
flag5 = True
flag6 = True
flag7 = True
flag8 = True

Max = 0
Min = 0

for value in l:
	if 1 <= value and value < 400 and flag1 == True:
		flag1 = False
		Max += 1
		Min += 1
	elif 400 <= value and value < 800 and flag2 == True:
		flag2 = False
		Max += 1
		Min += 1
	elif 800 <= value and value < 1200 and flag3 == True:
		flag3 = False
		Max += 1
		Min +=1
	elif 1200 <= value and value < 1600 and flag4 == True:
		flag4 = False
		Max += 1
		Min += 1
	elif 1600 <= value and value < 2000 and flag5 == True:
		flag5 = False
		Max += 1
		Min += 1
	elif 2000 <= value and value < 2400 and flag6 == True:
		flag6 = False
		Max += 1
		Min += 1
	elif 2400 <= value and value < 2800 and flag7 == True:
		flag7= False
		Max += 1
		Min += 1
	elif 2800 <= value and value < 3200 and flag8 == True:
		flag8 = False
		Max += 1
		Min += 1
	elif 3200 <= value and value <= 4800:
		Max += 1

if Min == 0:
	Min = 1

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

Submission status: Accepted

Solution code:

N=int(input())

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

color=[0,0,0,0,0,0,0,0]
alles=0

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

        
while 0 in color :color.remove(0)


if len(color)==0 :
    print(int(1)," ",len(color)+alles)
else :
    print(len(color)," ",len(color)+alles)

Submission status: Accepted

Solution code:
def f(A):
    counter = [0 for _ in range(8)]
    n_free = 0
    for a in A:
        if a >= 3200:
            n_free += 1
        else:
            idx = a // 400
            counter[idx] += 1
    if sum(counter) > 0:
        n_min = sum(count > 0 for count in counter)
        n_max = n_min + n_free
    else:
        n_min = 1
        n_max = n_free
    return n_min, n_max

N = int(input())
A = list(map(int, input().split()))
n_min, n_max = f(A)
print("{} {}".format(n_min, n_max))

Submission status: Accepted

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 = max(1, sum(d[:8]))
maximam = sum(d)

print(minimam, maximam)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
b = []
j = 0
for i in a:
	if i < 3200:
		b.append(int(i/400))
	if i >= 3200:
		j += 1
k = len(set(b))
if k == 0 and j > 0:
	k = 1
	j = j-1
print(k,k+j)

Submission status: Accepted

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	

minnum = sum(colors)
maxnum = minnum + top
if minnum == 0:
	minnum = 1
print '{} {}'.format(minnum, maxnum)