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 = [int(_) for _ in input().split()]

rate = len(set([ai // 400 for ai in a if ai < 3200]))
count_master = len([ai for ai in a if ai >= 3200])

print(max(rate, 1), rate + count_master)

Submission status: Accepted

Solution code:
N = int(input())
a = [i // 400 for i in map(int, input().split())]
min_a = sum(i < 8 for i in set(a))
max_a = min_a + sum(i >= 8 for i in a)
print(max(min_a, 1), max_a)

Submission status: Accepted

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

def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    flag = [0 for i in range(8)]
    other_cnt = 0

    for i in a_list:
        if 1 <= i and i < 400:
            flag[0] = 1
        elif 400 <= i and i < 800:
            flag[1] = 1
        elif 800 <= i and i < 1200:
            flag[2] = 1
        elif 1200 <= i and i < 1600:
            flag[3] = 1
        elif 1600 <= i and i < 2000:
            flag[4] = 1
        elif 2000 <= i and i < 2400:
            flag[5] = 1
        elif 2400 <= i and i < 2800:
            flag[6] = 1
        elif 2800 <= i and i < 3200:
            flag[7] = 1
        elif i >= 3200:
            other_cnt += 1
    
    if all(x >= 3200 for x in a_list):
        print(1, other_cnt)
    else:
        print(sum(flag), sum(flag) + other_cnt)
        

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
col = [0] * 10
gra = 0

a = list(map(int, input().split()))
flag = False
for i in range(n):
    if a[i] < 3200:
        flag = True

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

if flag:
    print(sum(col), sum(col) + gra)
else:
    print(1, gra)

Submission status: Accepted

Solution code:
n = int(input())

arr = map(int,raw_input().split())

colors = [0] * 8
ans = 0

for i in arr:
	t = i/400
	if t < 8:
		colors[t] += 1

	else:
		ans += 1

col = 0
for i in colors:
	if i > 0:
		col += 1
if col == 0 and ans > 0 :
	print col+1 , ans 
	quit()
	
print col, col + ans

Submission status: Accepted

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

color_types = [False]*8
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = 1
	else:
		pro_count += 1
print(max(1, sum(color_types)), sum(color_types)+pro_count)

Submission status: Accepted

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

p_num = [0]*9

for a in A:
    if a<3200:
        p_num[a//400] += 1
    else:
        p_num[-1] += 1
    
ans = 0
for p in p_num[:-1]:
    if p:
        ans +=1
        
ans_min = max(ans,1) 
ans_max = ans + p_num[-1]

print(ans_min, ans_max)

Submission status: Accepted

Solution code:
def f(n):
  n=int(n)
  if 1<=n<=399:
    return 1
  elif 400<=n<=799:
    return 2
  elif 800<=n<=1199:
    return 3
  elif 1200<=n<=1599:
    return 4
  elif 1600<=n<=1999:
    return 5
  elif 2000<=n<=2399:
    return 6
  elif 2400<=n<=2799:
    return 7
  elif 2800<=n<=3199:
    return 8
  else:
    return 9

n=int(input())
l=list(map(f,input().split()))
v=l.count(9)
t=len(set(l))

if not v:
  print(t,t)
else:
  if t-1:
    print(t-1,t+v-1)
  else:
    print(1,v)

Submission status: Accepted

Solution code:
from bisect import bisect_right
def inpl(): return input().split()

n = int(input())
a = list(map(int, inpl()))
b = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

d = dict()
for i in range(n):
    pos = bisect_right(b, a[i])#1->pos=1, 3200->pos=9
    d[pos] = d.get(pos, 0) + 1
ans = 0
for pos in range(bisect_right(b, 1), bisect_right(b, 3200)):
    if (d.get(pos, 0) > 0):
        ans += 1
cnt_colorful = d.get(bisect_right(b, 3200), 0)

if ans == 0:
    #3200以上のみの場合
    print(1, cnt_colorful)
else:
    print(ans, ans + cnt_colorful)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def color(x):
	if x <= 399:
		return 0
	elif x <= 799:
		return 1
	elif x <= 1199:
		return 2
	elif x <= 1599:
		return 3
	elif x <= 1999:
		return 4
	elif x <= 2399:
		return 5
	elif x <= 2799:
		return 6
	elif x <= 3199:
		return 7
	else:
		return 8

N = int(input())
aa = list(map(int,input().split()))
color_tb = []
nizi = 0

for a in aa:
	col = color(a)
	if col == 8:
		nizi += 1
	else:
		color_tb.append(col)

L = len(set(color_tb))

if L == 0:
	min_ans = 1
	max_ans = nizi
else:
	min_ans = L
	max_ans = L+nizi

print(min_ans,max_ans)

Submission status: Accepted

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

colors=[]
niji=[]
for i in a:
    if 1<=i<=399:
        colors.append('灰')
    elif 400<=i<=799:
        colors.append('茶')
    elif 800<=i<=1199:
        colors.append('緑')
    elif 1200<=i<=1599:
        colors.append('水')
    elif 1600<=i<=1999:
        colors.append('青')
    elif 2000<=i<=2399:
        colors.append('黄')
    elif 2400<=i<=2799:
        colors.append('橙')
    elif 2800<=i<=3199:
        colors.append('赤')
    elif 3200<=i:
        niji.append('虹')

colors_count =len(set(colors))
print(max(colors_count,1),colors_count+len(niji))

Submission status: Accepted

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

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

B = {'z': 0}
for a in A:
    if 1 <= a <= 399:
        B['a'] = 1
    elif 400 <= a <= 799:
        B['b'] = 1
    elif 800 <= a <= 1199:
        B['c'] = 1
    elif 1200 <= a <= 1599:
        B['d'] = 1
    elif 1600 <= a <= 1999:
        B['e'] = 1
    elif 2000 <= a <= 2399:
        B['f'] = 1
    elif 2400 <= a <= 2799:
        B['g'] = 1
    elif 2800 <= a <= 3199:
        B['h'] = 1
    else:
        B['z'] += 1

if 'z' in B:
    print(max(len(B.keys())-1, 1), len(B.keys())-1 + B['z'])
else:
    print(len(B.keys()), len(B.keys()))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = {i:0 for i in range(9)}
for ele in a:
  if ele>=3200:
    d[8] += 1
  else:
    d[ele//400] = 1
ans1, ans2 = 0, 0
for k, v in d.items():
  if k!=8:
    ans1 += v
  ans2 += v
ans1 = max(1, ans1)
ans2 = ans2
print(ans1, ans2)

Submission status: Accepted

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

color_dict = [0 for x in range(9)] # d[8]

for c in a :
    if c in range(1, 400) : color_dict[0] = 1
    elif c in range(400, 800) : color_dict[1] = 1
    elif c in range(800, 1200) : color_dict[2] = 1
    elif c in range(1200, 1600) : color_dict[3] = 1
    elif c in range(1600, 2000) : color_dict[4] = 1
    elif c in range(2000, 2400) : color_dict[5] = 1
    elif c in range(2400, 2800) : color_dict[6] = 1
    elif c in range(2800, 3200) : color_dict[7] = 1
    elif c >= 3200 : color_dict[8] += 1
        
tot = sum(color_dict)
rainbow = color_dict[8]

if tot > rainbow :
    print(tot - rainbow, tot)
elif tot - rainbow <= rainbow :
    print(tot - rainbow + 1, tot)

Submission status: Accepted

Solution code:
import math

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

a = [0]*9
for x in l:
 if math.floor(x/400)>8:
  a[8] += 1
 else:
  a[math.floor(x/400)] += 1
c = 0
for i in range(len(a)):
 if i==8:
  if c==0:
   min=1
  else:
   min = c
  c += a[i]
 elif a[i] >0:
  c+=1

print("%d %d"% (min, c))

Submission status: Accepted

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

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

mx = 0
mn = 0
cnt = 0

a = [0] * 8
for i in range(N):
    if 1 <= aN[i] < 400:
        a[0] = 1
    elif 400 <= aN[i] < 800:
        a[1] = 1
    elif 800 <= aN[i] < 1200:
        a[2] = 1
    elif 1200 <= aN[i] < 1600:
        a[3] = 1
    elif 1600 <= aN[i] < 2000:
        a[4] = 1
    elif 2000 <= aN[i] < 2400:
        a[5] = 1
    elif 2400 <= aN[i] < 2800:
        a[6] = 1
    elif 2800 <= aN[i] < 3200:
        a[7] = 1
cnt = sum(a)

kami = len([i for i in aN if 3200 <= i])
if kami == 0:
    print(str(cnt) + " " + str(cnt)) 
else:
    if cnt == 0:
        mn = 1
        mx = kami
    else:
        mn = cnt
        mx = cnt + kami
    print(str(mn) + " " + str(mx))

Submission status: Accepted

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

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

mx = 0
mn = 0
cnt = 0
if len([i for i in aN if 1 <= i < 400]) > 0:
    cnt += 1
if len([i for i in aN if 400 <= i < 800]) > 0:
    cnt += 1
if len([i for i in aN if 800 <= i < 1200]) > 0:
    cnt += 1
if len([i for i in aN if 1200 <= i < 1600]) > 0:
    cnt += 1
if len([i for i in aN if 1600 <= i < 2000]) > 0:
    cnt += 1
if len([i for i in aN if 2000 <= i < 2400]) > 0:
    cnt += 1
if len([i for i in aN if 2400 <= i < 2800]) > 0:
    cnt += 1
if len([i for i in aN if 2800 <= i < 3200]) > 0:
    cnt += 1

# 神がいる場合は話が変わってくる
kami = len([i for i in aN if 3200 <= i])
if kami == 0:
    print(str(cnt) + " " + str(cnt)) 
else:
    if cnt == 0:
        mn = 1
        mx = kami
    else:
        mn = cnt
        mx = cnt + kami
    print(str(mn) + " " + str(mx))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0
x7 = 0
x8 = 0
c = 0

for i in range(N):
	if a[i] < 400:
		x1 = 1
	elif a[i] < 800:
		x2 = 1
	elif a[i] < 1200:
		x3 = 1
	elif a[i] < 1600:
		x4 = 1
	elif a[i] < 2000:
		x5 = 1
	elif a[i] < 2400:
		x6 = 1
	elif a[i] < 2800:
		x7 = 1
	elif a[i] < 3200:
		x8 = 1
	else:
		c += 1
s = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8
if s == 0:
	print(1, c)
else:
	print(s, s + c)

Submission status: Accepted

Solution code:

n=int(input())

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

ans=[0]*8
c=0

for i in range(n):
    if a[i]<3200:
        ans[a[i]//400]=1
    else:
        c+=1

mi=sum(ans)
ma=sum(ans)+c

if mi==0:
    mi=1


print(' '.join([str(mi),str(ma)]))

Submission status: Accepted

Solution code:
import sys
N = int(input())
r = list(map(int, input().split()))
if min(r) >= 3200:
  print(str(1)+' '+str(N))
  sys.exit()
li = [0 for i in range(9)]
for rates in r:
  if rates >= 3200:
    rates = 3200
  n = rates//400
  li[n] += 1
p = 0
for nums in li[0:8]:
  if nums !=0:
    p += 1
print(str(p)+' '+str(p+li[8]))

Submission status: Accepted

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

count = [0, 0, 0, 0, 0, 0, 0, 0, 0]

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

color_max = sum(count)
if count[8] == 0:
    color_min = sum(count)
else:
    color_min = sum(count[:7]) + 1

print(color_min, color_max)

Submission status: Accepted

Solution code:
n=int(input())
code=input().split()
a=[0]*8
i=0
k=0
for j in range(n):
    if int(code[j])<400:
        a[0]=1
    elif int(code[j])<800:
        a[1]=1
    elif int(code[j])<1200:
        a[2]=1
    elif int(code[j])<1600:
        a[3]=1
    elif int(code[j])<2000:
        a[4]=1
    elif int(code[j])<2400:
        a[5]=1
    elif int(code[j])<2800:
        a[6]=1
    elif int(code[j])<3200:
        a[7]=1
    else:
        i+=1
for z in range(8):
    if a[z]==1:
        k+=1
if k>0:
    print(k, i+k,sep=" ")
else:
    print(1, i,sep=" ")

Submission status: Accepted

Solution code:
x=int(input())
A=[int(x) for x in str(input()).split()]
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
orange=0
red=0
others=0
for i in A:
  if i<400:
    gray=1
  elif i<800:
    brown=1
  elif i<1200:
    green=1
  elif i<1600:
    cyan=1
  elif i<2000:
    blue=1
  elif i<2400:
    yellow=1
  elif i<2800:
    orange=1
  elif i<3200:
    red=1
  else:
    others+=1

mi=gray+brown+green+cyan+blue+yellow+orange+red
ma=mi+others
if mi==0:
  print("1",str(ma))
else:
  print(str(mi),str(ma))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
x=input().split()
y=0
while y<n:
    x[y]=int(x[y])
    y+=1
other=0
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
orange=0
red=0
for i in x:
    if i<=399:
        gray=1
    elif i<=799:
        brown=1
    elif i<=1199:
        green=1
    elif i<=1599:
        cyan=1
    elif i<=1999:
        blue=1
    elif i<=2399:
        yellow=1
    elif i<=2799:
        orange=1
    elif i<=3199:
        red=1
    else:
        other+=1
mi=gray+brown+green+cyan+blue+yellow+orange+red
ma=other+mi
if mi==0:
    mi=1
print(mi,ma)

Submission status: Accepted

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

colour = [0]*8
free = 0

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

minimum = kinds
if kinds == 0:
    minimum = 1

maximum = kinds + free

    
print(minimum,maximum)

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())

count_counter = Counter()
result = 0
over = 0

for i in input().split():
    count_counter[int(i) // 400] += 1

for key in count_counter.keys():
    if key < 8:
        result += 1
    else:
        over += count_counter[key]

if result == 0:
    print(1, over)
else:
    print(result, result+over)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int, input().split()))
b=[]
t=0
for x in a:
    if x<3200:
        b.append(x//400)
    else:
        t+=1
c=len(set(b))
print(max(1,c), c+t)

Submission status: Accepted

Solution code:
a = int(input())

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

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

ma = sum(c) + d

if sum(c) == 0:
	print(1,ma)
else:
	print(sum(c),ma)

Submission status: Accepted

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

gray = 0
blown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
constant = 0
variable = 0

for i in a:
    if i < 400 and gray == 0:
        gray = 1
        constant += 1
    elif 400 <= i < 800 and blown == 0:
        blown = 1
        constant += 1
    elif 800 <= i < 1200 and green == 0:
        green = 1
        constant += 1
    elif 1200 <= i < 1600 and light_blue == 0:
        light_blue = 1
        constant += 1
    elif 1600 <= i < 2000 and blue == 0:
        blue = 1
        constant += 1
    elif 2000 <= i < 2400 and yellow == 0:
        yellow = 1
        constant += 1
    elif 2400 <= i < 2800 and orange == 0:
        orange = 1
        constant += 1
    elif 2800 <= i < 3200 and red == 0:
        red = 1
        constant += 1
    elif i >= 3200:
        variable += 1

if constant == 0:
    print(1, variable)
else:
    print(constant, constant+variable)

Submission status: Accepted

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

Submission status: Accepted

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

cs = [0] * 8
free = 0
for a in src:
    if a >= 3200:
        free += 1
    else:
        cs[a//400] += 1
fix = len([1 for c in cs if c])
mx = fix + free
mn = fix + (0 if fix else 1)
print(str(mn) + ' ' + str(mx))

Submission status: Accepted

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

dic = {i : 0 for i in range(9)}
for i in range(N):
	if (a[i] // 400) > 7:
		dic[8] += 1
	else:
		dic[(a[i] // 400)] += 1

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

print(max(minv,1),minv+dic[8])

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int, input().split()))
b=dict()
for i in a:
    b[i//400]=b.get(i//400,0)+1
count=0
count2=0
for i in b:
    if i>7:count2+=b[i]
    else:count+=1
print(max(count,1),count+count2)

Submission status: Accepted

Solution code:

def m():
    n = int(input())
    a = list(map(int, input().split()))
    ans = set()
    freecont = 0
    for i in range(n):
        t = a[i] // 400
        if t >= 8:
            freecont+=1
            continue
        ans.add(t)

    return "{} {}".format(max(len(ans),1), len(ans) +freecont)
    if len(ans) == 0:
        minc = 1
        maxc = min(freecont, 8)
        return "{} {}".format(minc, maxc)

    minc = len(ans)
    maxc = min(len(ans) + freecont, 8)
    return "{} {}".format(minc, maxc)


print(m())

Submission status: Accepted

Solution code:
N = int(input())

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

colors = [0] * 8
any_c = 0

for a in A:
    if a // 400 > 7:
        any_c += 1
    else:
        colors[a // 400] += 1

min_ans = 0

for color in colors:
    if color > 0:
        min_ans += 1

max_ans = min_ans + any_c
if min_ans == 0: min_ans += 1

print(str(min_ans) + " " + str(max_ans))

Submission status: Accepted

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

P = set()
ans = 0
for a in A:
    if a // 400 < 8:
         P.add(a // 400)
    else: ans += 1

if ans == 0: print(len(P),len(P))
elif len(P)==0: print(1,ans)
else: print(len(P),len(P)+ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
s, x = set(), 0
for i in a:
    if(i < 3200):
        s.add(i//400)
    else:
        x += 1
print(max(len(s), 1), len(s)+x)

Submission status: Accepted

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

colors = [False] * 8
crown_owners = 0

for rate in a:
	if rate <= 399:
		colors[0] = True
	elif rate <= 799:
		colors[1] = True
	elif rate <= 1199:
		colors[2] = True
	elif rate <= 1599:
		colors[3] = True
	elif rate <= 1999:
		colors[4] = True
	elif rate <= 2399:
		colors[5] = True
	elif rate <= 2799:
		colors[6] = True
	elif rate <= 3199:
		colors[7] = True
	else:
		crown_owners += 1

if colors.count(True) == 0:
	print(1, crown_owners)
else:
	print(colors.count(True), colors.count(True) + crown_owners)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x)//400 for x in input().split()]
 
b = 0
c = set()
for i in range(n):
    if a[i] > 7:
        b += 1
    else:
        c.add(a[i])
 
print(max(1, len(c)), len(c)+b)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
ans1 = 0
ans2 = 0
b = []
for i in a:
    if i < 3200:
        k = i // 400
        if not k in b:
            ans2 += 1
            ans1 += 1
            b.append(k)
    else:
        ans2 += 1
print(max(ans1,1), ans2)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
col = []
f = [0]*8
sp = 0

for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1

if sum(f) > 0:
    min = sum(f)
    max = sum(f) + sp
else:
    min = 1
    max = sp
    
print(min,max)

Submission status: Accepted

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

color = 0
for i in range(len(a)):
    idx = a[i] // 400
    if idx > 8:
        idx = 8

    color_lst[idx] += 1
    if color_lst[idx] == 1 and idx != 8:
        color += 1

color_max = color + color_lst[8]
if color == 0:
        color += 1


print("{} {}".format(color, color_max))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
t = [0 for k in range(8)]
s = 0

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

print(max(1,t.count(1)),t.count(1)+s)

Submission status: Accepted

Solution code:
from collections import Counter


def getinputdata():
    # 配列初期化
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

n = int(arr_data[0][0])

arr = [int(x) for x in arr_data[1]]
arr_result = [0 for x in range(8)]

cnt = 0
for v in arr:

    if v < 400 *1 :

        arr_result[0] = 1

    elif v < 400 * 2:

        arr_result[1] = 1
    elif v < 400 * 3:

        arr_result[2] = 1
    elif v < 400 * 4:

        arr_result[3] = 1
    elif v < 400 * 5:

        arr_result[4] = 1
    elif v < 400 * 6:

        arr_result[5] = 1
    elif v < 400 * 7:

        arr_result[6] = 1

    elif v < 400 * 8:

        arr_result[7] = 1

    else:

        cnt += 1

if sum(arr_result)!=0:
    print(sum(arr_result), sum(arr_result) + cnt)
else:
    print(1, sum(arr_result) + cnt)

Submission status: Accepted

Solution code:
n=int(input())
a=map(lambda x: int(x)//400,input().split())
b=set()
c=0
for v in a:
  if v>=8:
    c+=1
  else:
    b.add(v)
if len(b)==0:
  print('1 '+str(c))
else:
  print(str(len(b))+' '+str(len(b)+c))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = 0
color = []
for a_i in a:
    if a_i>=3200:
        c += 1
    else:
        color.append(a_i//400)
    
ans_min = len(set(color))

print(max(ans_min, 1), ans_min+c)

Submission status: Accepted

Solution code:
n = int(input())
lis = [0,0,0,0,0,0,0,0]
pro = 0
li = list(map(int,input().split()))
for i in range(n):
	if li[i] >= 3200:
		pro += 1
	else:
		lis[(li[i])//400] = 1
su = lis.count(1)
print(max(su,1),min(su+pro,n))

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
c = set([])
free = 0
for r in l:
  if 1 <= r <= 399:
    c.add('grey')
  elif 400 <= r <= 799:
    c.add('brown')
  elif 800 <= r <= 1199:
    c.add('green')
  elif 1200 <= r <= 1599:
    c.add('cyan')
  elif 1600 <= r <= 1999:
    c.add('blue')
  elif 2000 <= r <= 2399:
    c.add('yellow')
  elif 2400 <= r <= 2799:
    c.add('orange')
  elif 2800 <= r <= 3199:
    c.add('red')
  elif r >= 3200:
    free += 1

if len(c) == 0:
  print(1, len(c)+free)
else:
  print(len(c), len(c)+free)

Submission status: Accepted

Solution code:
import collections

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

d = collections.defaultdict(int)

for i in a:
    i_ = i // 400
    if i_ >= 8:
        i_ = 8
    d[i_] += 1

if 8 in d:
    min_ = max(len(d) - 1, 1)
    max_ = len(d) + d[8] - 1

else:
    min_ = len(d)
    max_ = len(d)

print(min_, max_)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = [x//400 for x in A]
a,b = 0,0
for i in range(13):
    if i < 8:
        if i in B:
            a+=1
    else:
        b+=B.count(i)
print(max(a,1),a+b)

Submission status: Accepted

Solution code:
N = int(input())
src = list(map(int,input().split()))
ks = [0] * 9
for r in src:
    if r >= 3200:
        ks[-1] += 1
    else:
        ks[r//400] += 1
c = len([k for k in ks[:-1] if k])
mn = max(1, c)
mx = c + ks[-1]
print(mn,mx)

Submission status: Accepted

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

dict={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}

for a in A:
  if a>=3200:
    dict[8]+=1
  elif a>=2800:
    dict[7]+=1
  elif a>=2400:
    dict[6]+=1
  elif a>=2000:
    dict[5]+=1
  elif a>=1600:
    dict[4]+=1
  elif a>=1200:
    dict[3]+=1
  elif a>=800:
    dict[2]+=1
  elif a>=400:
    dict[1]+=1
  else:
    dict[0]+=1
ans=0
for i in range(8):
  if dict[i]>0:
    ans+=1
print(max(ans,1),ans+dict[8])

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
gray=brown=green=cyan=blue=yellow=orange=red=num=0
for i in range(n):
    if 1<=a[i]<=399:
        gray=1
    if 400<=a[i]<=799:
        brown=1
    if 800<=a[i]<=1199:
        green=1
    if 1200<=a[i]<=1599:
        cyan=1
    if 1600<=a[i]<=1999:
        blue=1
    if 2000<=a[i]<=2399:
        yellow=1
    if 2400<=a[i]<=2799:
        orange=1
    if 2800<=a[i]<=3199:
        red=1
    if 3200<=a[i]:
        num+=1
total=gray+brown+green+cyan+blue+yellow+orange+red
if total==0:
    print(1,num)
else:
    print(total,total+num)

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    n = int(input())
    a = list(map(lambda x: int(x) // 400, input().split()))
    colors = [0] * 9

    # See:
    # https://beta.atcoder.jp/contests/abc064/submissions/2416018
    for i in a:
        if i < 8:
            colors[i] = 1
        else:
            colors[8] += 1

    kind = sum(colors[:8])
    print(max(kind, 1), kind + colors[8])

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9
    rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801]

    for ai in a:
        for k in range(9):
            if rate[k] <= ai < rate[k + 1]:
                colors[k] += 1
                break

    count = 0

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

    red = colors[7]
    legend = colors[8]

    if (red == 0) and (legend == 0):
        print(count, count)
    elif (red > 0) and (legend == 0):
        print(count + 1, count + 1)
    elif (red == 0) and (legend > 0):
        print(count + 1, count + legend)
    else:
        print(count + 1, count + 1 + legend)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))[:N]

i = 0
color = 0
T = list(filter(lambda x:x>=3200,A))
A = list(filter(lambda x:x<3200,A))

for R in range(0,2801,400):
    if len(list(filter(lambda x:x>=R and x<R+400,A)))>0: color+=1
    
min_color = color
max_color = color+len(T)

if min_color==0 and len(T)>0: min_color = 1
    
print(min_color,max_color)

Submission status: Accepted

Solution code:
l = [0,0,0,0,0,0,0,0,0]
n = int(input())
a = list(map(int,input().split()))

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

if tokurei == 0:
    print('1 ' + str(l[8]) )
else:
    flag = 0
    for i in range(8):
        if l[i] > 0:
            flag = flag + 1
    print(str(flag) + ' ' + str(flag + l[8]))

Submission status: Accepted

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

n = int(input())
a = [int(x) for x in input().split(" ")]

rate = [0 for _ in range(8)]
xx = 0

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

cnt = 0
for r in rate:
    if r>0:
        cnt += 1
if xx==0:
    print(str(cnt)+" "+str(cnt))
else:
    if cnt<2:
        print("1 "+str(xx+cnt))
    else:
        print(str(cnt)+" "+str(xx+cnt))

Submission status: Accepted

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