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()))

c = []
cnt = 0
for a in A:
    if a < 400:
        c.append(0)
    elif a < 800:
        c.append(1)
    elif a < 1200:
        c.append(2)
    elif a < 1600:
        c.append(3)
    elif a < 2000:
        c.append(4)
    elif a < 2400:
        c.append(5)
    elif a < 2800:
        c.append(6)
    elif a < 3200:
        c.append(7)
    else:
        cnt += 1
d = len(set(c))

if d == 0:
    print(1, cnt)
else:
    print(d, d+cnt)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
cnt=0
X=set()
for i in range(N):
  if(A[i]>=3200):
    cnt+=1
  else:
    X.add(A[i]//400)
if(len(X)):
  print(len(X),len(X)+cnt)
else:
  print(1,cnt)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
red=0
kind=0
b=[]
for i in range(8):
    b.append([i,0])
for i in range(n):
    if a[i]<3200:
        b[a[i]//400][1]+=1
    else:
        red+=1
for i in range(8):
    if b[i][1]!=0:
        kind+=1
minc=1 if kind==0 else kind
maxc=kind+red 
print(str(minc)+" "+str(maxc))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = [8 for _ in range(n)]
free = 0
for i in range(n):
    if a[i] > 3199:
        free += 1
    else:
        b[i] = a[i] // 400
if 8 in set(b):
    under = len(set(b)) - 1
else:
    under = len(set(b))
if under != 0:
    m = under
else:
    m = 1
M = under + free
print(m, M)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*10
ans = 0
aans = 0
for i in range(n):
    if l[i] >= 3200:
        aans += 1
    else:
        color[int(l[i]/400)] += 1
for i in color:
    if i > 0:
        ans += 1
if aans == n:
    print(1,n)
else:
    print(ans,aans+ans)

Submission status: Accepted

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

for a in A:
    color = a//400
    if color >=8:
        extra +=1
    else:
        colors[color] = 1

num_8 = sum(colors)
lower = num_8
if lower==0 and extra>0:
    lower = 1
higher = num_8+extra

print(lower,higher)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    a = list(map(int, input().split()))
    A = [0]*8
    n = 0
    for i in a:
        if i >= 3200:
            n += 1
        else:
            A[i//400] = 1
    if sum(A) == 0 and n > 0:
        print(1, n)
    else:
        print(sum(A), sum(A) + n)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=[0]*8
legend=0
for i in range(n):
    if a[i]<=3199:
        b[a[i]//400]=1
    else:
        legend+=1
if b.count(1)==0:
    print(1,legend)
elif b.count(1):
    print(b.count(1),b.count(1)+legend)

Submission status: Accepted

Solution code:
# C - Colorful Leaderboard

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

n_gray_to_red = len(set([x//400 for x in a if x < 3200]))
n_3200_and_above = len([x for x in a if x >= 3200])

print(max(n_gray_to_red, 1), n_gray_to_red + n_3200_and_above)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)

def main():
    n = int(input().strip())
    v = list(map(int, input().strip().split()))
    t = 0
    kind = set()
    for e in v:
        if e // 400 >= 8:
            t += 1
        else:
            kind.add(e // 400)
    print(max(1,len(kind)), len(kind) + t)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())
r=[400,800,1200,1600,2000,2400,2800,3200]
b=[0]*8
c=0
for i in range(n):
    for j in range(8):
        if a[i]<r[j]:
            b[j]=1
            break
    if a[i]>=3200:    
        c+=1
print(max(1,sum(b)),c+sum(b))

Submission status: Accepted

Solution code:
# ABC064 C - Colorful Leaderboard
N = int(input())
A = list(map(int,input().split()))

C = set()
Tourist = 0

for a in A:
    if 1<=a<=399:
        C.add('Glay')
    elif 400<=a<=799:
        C.add('Brown')
    elif 800<=a<=1199:
        C.add('Green')
    elif 1200<=a<=1599:
        C.add('Water')
    elif 1600<=a<=1999:
        C.add('Blue')
    elif 2000<=a<=2399:
        C.add('Yellow')
    elif 2400<=a<=2799:
        C.add('Orange')
    elif 2800<=a<=3199:
        C.add('Red')
    elif 3200<=a:
        C.add('Tourist')
        Tourist += 1

MIN = len(C) - (1 if Tourist >= 1 else 0)
MAX = len(C) + (Tourist -1 if Tourist >= 1 else 0)

if Tourist == N:
    MIN = 1

print(MIN,MAX)

Submission status: Accepted

Solution code:
n = int(input())
list_a = list(map(int, input().split()))
num_rank = [0 for _ in range(9)]
for one_a in list_a:
  temp_rank = one_a // 400
  if temp_rank > 8:
    temp_rank = 8
  num_rank[temp_rank] += 1
if len([i for i in num_rank[:-1] if i > 0]) > 0:
  min_color = len([i for i in num_rank[:-1] if i > 0])
else:
  min_color = 1
max_color = len([i for i in num_rank[:-1] if i > 0]) + num_rank[-1]
print("{} {}".format(min_color, max_color))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
l=[0]*9
for a in A:
    if a>=3200:
        l[8]+=1
    else:
        l[int(a//400)]=1

sl=sum(l)-l[8]
print(max(sl,1),(sl+l[8]))

Submission status: Accepted

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = list(map(int, input().split()))
    colors = [a // 400 for a in as_ if a <= 3199]
    free_num = len([a for a in as_ if a >= 3200])

    num_color = len(set(colors))
    print(max(num_color, 1), num_color + free_num)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#64c
N = int(input()) #N<100
a_list = [int(e) for e in input().split()]

color_and_number_of_persons={"gray":0,"brown":0,"green":0,"cyan":0,"blue":0,"yellow":0,"orange":0,"red":0,"other":0}
color_and_min_rate={"gray":1,"brown":400,"green":800,"cyan":1200,"blue":1600,"yellow":2000,"orange":2400,"red":2800,"other":3200}

color_and_min_rate = sorted(color_and_min_rate.items(), reverse=True, key=lambda x : x[1])

for rate in a_list:
    #print(rate,":",end="")
    for c_and_mr in color_and_min_rate:
        if rate >= c_and_mr[1]:
            #print(c_and_mr[0])
            color_and_number_of_persons[c_and_mr[0]] += 1
            break
            
#print(color_and_number_of_persons)

number_of_color = 0

for number_of_persons in color_and_number_of_persons.values():
    if number_of_persons != 0:
        number_of_color += 1
        
if color_and_number_of_persons["other"] != 0:
    number_of_color -= 1 #number_of_colorはレート3200以上も含んでいるので、それは差し引く
    
if number_of_color == 0:
    min_ans = 1
    max_ans = color_and_number_of_persons["other"]
else:
    min_ans = number_of_color
    max_ans = number_of_color + color_and_number_of_persons["other"]

print(min_ans,max_ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
col = [0] * 9
for i in A:
  r = i//400
  if r > 8:
    r = 8
  col[r] += 1

ans = 0
for i in col[:8]:
  if i > 0:
    ans += 1

if ans == 0:
  print(1, col[-1])
else:
  print(ans, ans + col[-1])

Submission status: Accepted

Solution code:
n=int(input())
a_l=list(map(int,input().split()))
a,b,c,d,e,f,g,h=0,0,0,0,0,0,0,0
cnt=0
for i in a_l:
    if i<400*1:
        a+=1
    elif 400*1<=i<400*2:
        b+=1
    elif 400*2<=i<400*3:
        c+=1
    elif 400*3<=i<400*4:
        d+=1
    elif 400*4<=i<400*5:
        e+=1
    elif 400*5<=i<400*6:
        f+=1
    elif 400*6<=i<400*7:
        g+=1
    elif 400*7<=i<400*8:
        h+=1
    else:
        cnt+=1
ans=0
for i in [a,b,c,d,e,f,g,h]:
    if i!=0:
        ans+=1
if ans!=0:
    print(ans, ans+cnt)
else:
    print(1,cnt)

Submission status: Accepted

Solution code:
N = int(input())
a =[]
a = input().split()
flag=[False for i in range(8)]
count = 0

while a:
    tmp = int(a.pop())
    if(tmp<400):
        flag[0] = True
    elif(tmp<800):
        flag[1] = True
    elif(tmp<1200):
        flag[2] = True
    elif(tmp<1600):
        flag[3] = True
    elif(tmp<2000):
        flag[4] = True
    elif(tmp<2400):
        flag[5] = True
    elif(tmp<2800):
        flag[6] = True
    elif(tmp<3200):
        flag[7] = True
    else:
        count += 1

if True in flag:
    print(flag.count(True), flag.count(True)+count)
else:
    print(0 if count <1 else 1,count)

Submission status: Accepted

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

t = [0] * 8
over = 0
for x in a:
    if x >= 3200:
        over += 1
    else:
        t[x // 400] = 1
print(*[max(sum(t), 0 if over == 0 else 1), sum(t) + over])

Submission status: Accepted

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

b=0
for i in range(n):
  if a[i]//400>=8:
    b+=1
c=[s//400 for s in a if s<3200]
C=len(set(c))
print(C or 1, C+b)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[s//400 for s in A if s<3200]
C=len(set(B))
print(C or 1,N-len(B)+C)

Submission status: Accepted

Solution code:
import bisect

def grade(score, breakpoints=[400, 800, 1200, 1600, 2000, 2400, 2800, 3200],
          grades='abcdefghx'):
    i = bisect.bisect(breakpoints, score)
    return grades[i]

N = int(input())
a = list(map(int, input().split()))
grades = [grade(score) for score in a]

normal = [i for i in grades if i != 'x']
ans_max = len(set(normal)) + grades.count('x')
if len(normal) == 0:
    ans_min = 1
else:
    ans_min = len(set(normal))
print(ans_min, ans_max)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
dic = {}
cnt = 0
for i in range(N):
  if A[i] < 400:
    dic[0] = 1
  elif A[i] < 800:
    dic[1] = 1
  elif A[i] < 1200:
    dic[2] = 1
  elif A[i] < 1600:
    dic[3] = 1
  elif A[i] < 2000:
    dic[4] = 1
  elif A[i] < 2400:
    dic[5] = 1
  elif A[i] < 2800:
    dic[6] = 1
  elif A[i] < 3200:
    dic[7] = 1
  else:
    dic[8] = 1
    cnt += 1
if cnt > 0:
  if len(dic) == 1:
    print(1,cnt)
  else:
    print(len(dic) - 1,len(dic) + cnt - 1)
else:
  print(len(dic),len(dic))

Submission status: Accepted

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

over_count = 0
gray = 0
brawn = 0
green = 0
lightblue = 0
blue = 0
yellow = 0
orange = 0
red = 0

for a in As:
  if 1 <= a <= 399:
    gray = 1
  elif 400 <= a <= 799:
    brawn = 1
  elif 800 <= a <= 1199:
    green = 1
  elif 1200 <= a <= 1599:
    lightblue = 1
  elif 1600 <= a <= 1999:
    blue = 1
  elif 2000 <= a <= 2399:
    yellow = 1
  elif 2400 <= a <= 2799:
    orange = 1
  elif 2800 <= a <= 3199:
    red = 1
  elif 3200 <= a <= 4800:
    over_count += 1
    
min_count = gray + brawn + green + lightblue + blue + yellow + orange + red
max_count = min_count + over_count

if min_count == 0 and over_count >= 1:
  min_count = 1

print("{} {}".format(min_count, max_count))

Submission status: Accepted

Solution code:
def rank(n):
    n = int(n)
    if n < 400:
        return 'a'
    if n < 800:
        return 'b'
    if n < 1200:
        return 'c'
    if n < 1600:
        return 'd'
    if n < 2000:
        return 'e'
    if n < 2400:
        return 'f'
    if n < 2800:
        return 'g'
    if n < 3200:
        return 'h'
    else:
        return 'x'


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

normal = [i for i in a if i != 'x']
ans_max = len(set(normal)) + a.count('x')
if len(normal) == 0:
    ans_min = 1
else:
    ans_min = len(set(normal))
print(ans_min, ans_max)

Submission status: Accepted

Solution code:
clst = [0, 0, 0, 0, 0, 0, 0, 0, 0]

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

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

for i in range(9):
    if 0 < clst[i] and i != 8:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]

if sum(clst[:8]) == 0:
    maxans -= 1

print(minans, maxans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = 1
else:
    minrate = sum(li[:8])

print(minrate, maxrate)

Submission status: Accepted

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

ans = 0
free = 0
tmp = a[0] // 400
for i in a:
    if i >= 3200:
        free += 1
    elif i >= 400 * tmp:
        tmp = i//400 + 1
        ans += 1
if ans > 0:
    print(ans, ans+free)
else:
    print(1, ans+free)

Submission status: Accepted

Solution code:
# C - Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
DP = [0]*8
tmp = 0

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

ans1 = sum(DP)

if ans1 == 0:
    ans1 = 1 
else:
    pass

ans2 = sum(DP)+tmp
print(ans1,ans2)

Submission status: Accepted

Solution code:
def color(x):
  if(1 <= x and x <= 399):
    return "灰色"
  if(400 <= x and x <= 799):
    return "茶色"
  if(800 <= x and x <= 1199):
    return "緑色"
  if(1200 <= x and x <= 1599):
    return "水色"
  if(1600 <= x and x <= 1999):
    return "青色"
  if(2000 <= x and x <= 2399):
    return "黄色"
  if(2400 <= x and x <= 2799):
    return "橙色" 
  if(2800 <= x and x <= 3199):
    return "赤色"
  if(3200 <= x):
    return "free"

from collections import defaultdict
d = defaultdict(int)
n = int(input())
a = list(map(int, input().split()))
free = 0
for score in a:
  if color(score) == "free":
    free +=1
  else:
    d[color(score)] += 1
print(len(d) if len(d) != 0 else 1, len(d) + free)

Submission status: Accepted

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

colors = [0]*8
higher = 0
for a in A:
    if a <=399:
        colors[0] =1
    elif a<= 799:
        colors[1] =1
    elif a<= 1199:
        colors[2] =1
    elif a<= 1599:
        colors[3] =1
    elif a<= 1999:
        colors[4] =1
    elif a<= 2399:
        colors[5] =1
    elif a<= 2799:
        colors[6] =1
    elif a<= 3199:
        colors[7] =1
    else:
        higher +=1
print(max(1,sum(colors)),sum(colors)+higher)

Submission status: Accepted

Solution code:
participant = int(input())
rate = list(map(int, input().split()))
ratecolorCheck = [0] *8
maxColor, minColor = 0, 0
for i in range(participant):
  if 1 <= rate[i] and rate[i] <= 399:
    ratecolorCheck[0] = 1
  elif 400 <= rate[i] and rate[i] <= 799:
    ratecolorCheck[1] = 1
  elif 800 <= rate[i] and rate[i] <= 1199:
    ratecolorCheck[2] = 1
  elif 1200 <= rate[i] and rate[i] <= 1599:
    ratecolorCheck[3] = 1
  elif 1600 <= rate[i] and rate[i] <= 1999:
    ratecolorCheck[4] = 1
  elif 2000 <= rate[i] and rate[i] <= 2399:
    ratecolorCheck[5] = 1
  elif 2400 <= rate[i] and rate[i] <= 2799:
    ratecolorCheck[6] = 1
  elif 2800 <= rate[i] and rate[i] <= 3199:
    ratecolorCheck[7] = 1
  else:
    maxColor += 1
for i in range(8):
  if ratecolorCheck[i] == 1:
    minColor += 1
    maxColor += 1
if minColor == 0:
  minColor = 1
print(str(minColor) + " " + str(maxColor))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 9

for i in a:
    color[min(i, 3200) // 400] += 1

x = 8 - color[:-1].count(0)
ans = [max(1, x), x + color[8]]
print(' '.join(map(str, ans)))

Submission status: Accepted

Solution code:
N=input()
N=int(N)
a=input()
a=a.split()
score=[0]*8
legend=0
inrank=0
a=[int(item) for item in a]
for i in range(0,N):
    p=int(a[i]/400)
    if p >= 8:
        legend+=1
    else:
        score[p]=1
inrank=score.count(1)
if legend!=0:
    if inrank==0:
        t_max=legend
        t_min=1
    else:
        t_max=inrank+legend
        t_min=inrank
else:
    t_max=inrank
    t_min=inrank
print(str(t_min)+" "+str(t_max))

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

d = defaultdict(int)
for a in A:
    if a < 400:
        d[0] += 1
    elif 400 <= a < 800:
        d[1] += 1
    elif 800 <= a < 1200:
        d[2] += 1
    elif 1200 <= a < 1600:
        d[3] += 1
    elif 1600 <= a < 2000:
        d[4] += 1
    elif 2000 <= a < 2400:
        d[5] += 1
    elif 2400 <= a < 2800:
        d[6] += 1
    elif 2800 <= a < 3200:
        d[7] += 1
    else:
        d[8] += 1

cnt = 0
for i in range(8):
    if d[i]:
        cnt += 1

if cnt == 0:
    print(1, N)
else:
    print(cnt, cnt+d[8])

Submission status: Accepted

Solution code:
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    color = [0]*8
    ans_max = 0
    for i in a:
        if 1<= i <= 399:
            color[0] = 1
        elif i <= 799:
            color[1]=1
        elif i <= 1199:
            color[2] = 1
        elif i <= 1599:
            color[3] = 1
        elif i <= 1999:
            color[4] = 1
        elif i <= 2399:
            color[5] = 1
        elif i <= 2799:
            color[6] = 1
        elif i <= 3199:
            color[7] = 1
        else:
            ans_max += 1
    print(max(1,sum(color)),ans_max+sum(color))
if __name__ == '__main__':
    main()

Submission status: Accepted

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

score_list = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
counter = [0] * 9
for i in range(len(a)):
    if a[i] >= 3200:
        counter[8] += 1
    for j in range(8):
        if a[i] < score_list[j]:
            counter[j] += 1
            break
ans_min = 0
for i in range(len(counter) - 1):
    if counter[i] != 0:
        ans_min += 1
if counter[8] >= 1:
    ans_max = ans_min + counter[8]
    if ans_min == 0:
        ans_min += 1
else:
    ans_max = ans_min
print(ans_min, ans_max)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]
cmin = 0
cmax = 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 :
        color[8] += 1
        
for i in range(8) :
    if color[i] > 0 :
        cmin  += 1

if cmin == 0 :
    cmin = 1
    cmax = color[8]
else :
    cmax = cmin + color[8]

print (cmin, cmax)

Submission status: Accepted

Solution code:
n = int(input());l = [0]*9
for i in map(int, input().split()):l[min(8,i//400)]+=1
mn = len(list(filter(lambda x:x>0, l[:8])))
print(max(1, mn), mn+l[8])

Submission status: Accepted

Solution code:
import collections

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

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min


print(min, max)

Submission status: Accepted

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

color=set()
count=0

for aa in a:
    if aa>=3200:
        count+=1
    else:
        color.add(aa//400)

print(len(color) or 1, end=" ")
print(len(color)+count)

Submission status: Accepted

Solution code:
import heapq
import sys
input = sys.stdin.readline


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

    if N==1:
        print('1 1')
        return

    C = [False]*8
    r = 0
    for a in A:
        if a<400:
            C[0] = True
        elif a<800:
            C[1] = True
        elif a<1200:
            C[2] = True
        elif a<1600:
            C[3] = True
        elif a<2000:
            C[4] = True
        elif a<2400:
            C[5] = True
        elif a<2800:
            C[6] = True
        elif a<3200:
            C[7] = True
        else:
            r += 1

    c_cnt = C.count(True)
    c_min = max(c_cnt, 1)
    c_max = c_cnt + r
    print(' '.join(map(str, [c_min, c_max])))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = set()
all = 0
for i in a:
    if i >= 3200:all += 1;continue
    s.add(i//400)
print(len(s) or 1,end=" ")
print(len(s)+all)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = set()
all = 0
for i in a:
    if i >= 3200:
        all += 1
    else:s.add(i//400)
if not s:
    print(1,end=" ")
else:print(len(s),end=" ")
print(len(s)+all)

Submission status: Accepted

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

for i in range(n):
    if 1 <= li[i] <=399:
        li[i] = 1
    elif 400<= li[i] <=799: 
        li[i] = 2
    elif 800<= li[i] <=1199:
        li[i] = 3
    elif 1200<= li[i] <=1599:
        li[i] = 4
    elif 1600<= li[i] <=1999:
        li[i] = 5
    elif 2000<= li[i] <=2399:
        li[i] = 6
    elif 2400<= li[i] <=2799:
        li[i] = 7
    elif 2800<= li[i] <=3199:
        li[i] = 8
    elif 3200<= li[i] <=4800:
        li[i] = 10+i
max1 = len(set(li))
li = [x for x in li if x < 9]
if len(li) == 0:
    min1 = 1
else:
    min1 = len(set(li))
print(min1,max1)

Submission status: Accepted

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

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

st = set()
super_coder = 0
for ele in a:
    clr = ele // 400
    if clr <= 7:  # has color
        st.add(clr)
    else:  # greater than red coder!!!
        super_coder += 1

ans = [max(len(st), 1), len(st) + super_coder]

print(*ans)

Submission status: Accepted

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

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

st = set()
super_coder = 0
for ele in a:
    clr = ele // 400
    if clr <= 7:  # has color
        st.add(clr)
    else:  # greater than red coder!!!
        super_coder += 1

if super_coder:
    ans = [max(len(st), 1), len(st) + super_coder]
else:
    ans = [len(st), len(st)]

print(*ans)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
d = defaultdict(int)
for i in a:
    d[i//400] += 1
c = 0
f = 0
for key in d.keys():
    if key < 8:
        c += 1
    else:
        f += d[key]
if c == 0:
    print(1,f)
else:
    print(c,c+f)

Submission status: Accepted

Solution code:
import collections

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

counter = collections.Counter()
for a in ls:
    counter[min(8, a // 400)] += 1
n_keys = len(counter.keys())
n8 = counter[8]
if n8 > 0:
    if n_keys == 1:
        n_min = 1
        n_max = n
    else:
        n_min = n_keys - 1
        n_max = n_min + n8
else:
    n_min = n_max = n_keys
print(n_min, n_max)

Submission status: Accepted

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

def rate_color(rate):
    if 1 <= rate and rate < 400:
        return 'ash'
    elif 400 <= rate and rate < 800:
        return 'brown'
    elif 800 <= rate and rate < 1200:
        return 'green'
    elif 1200 <= rate and rate < 1600:
        return 'lightblue'
    elif 1600 <= rate and rate < 2000:
        return 'blue'
    elif 2000 <= rate and rate < 2400:
        return 'yellow'
    elif 2400 <= rate and rate < 2800:
        return 'orange'
    elif 2800 <= rate and rate < 3200:
        return 'red'
    else:
        return 'anycolor'


color_list = []
for i in range(N):
    color_list.append(rate_color(a_list[i]))


basic_color_list = ['ash', 'brown', 'green', 'lightblue', 'blue', 'yellow', 'orange', 'red', 'anycolor']

count_list = []
for _ in basic_color_list:
    count_list.append(color_list.count(_))

count_list_but_anycolor = count_list[:-1]

count_anycolor = count_list[-1]
count_0 = count_list_but_anycolor.count(0)

max_result = 8 - count_0 + count_anycolor
min_result = 8 - count_0

if max_result == 0:
    max_result = 1
else:
    pass

if min_result == 0:
    min_result = 1
else:
    pass

print(min_result, max_result)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    ls = [0] * 9
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    for v in a:
        if 1 <= v <= 399:
            ls[0] = 1
        elif 400 <= v <= 799:
            ls[1] = 1
        elif 800 <= v <= 1199:
            ls[2] = 1
        elif 1200 <= v <= 1599:
            ls[3] = 1
        elif 1600 <= v <= 1999:
            ls[4] = 1
        elif 2000 <= v <= 2399:
            ls[5] = 1
        elif 2400 <= v <= 2799:
            ls[6] = 1
        elif 2800 <= v <= 3199:
            ls[7] = 1
        else:
            ls[8] += 1
    print(max(sum(ls[:8]), 1), sum(ls[:8]) + ls[8])


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

for a in arr:
    t = a//400
    if t >= 8:
        t = 8
    temp[t] += 1

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

if ans >= 1:
    print(ans,ans+temp[-1])
else:
    print(1,ans+temp[-1])

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]
hai = 0
cha = 0
mdr = 0
miz = 0
aao = 0
kii = 0
dai = 0
aka = 0
kan = 0

for i in a:
    if i <= 399:
        hai = 1
    elif i <= 799:
        cha = 1
    elif i <= 1199:
        mdr = 1
    elif i <= 1599:
        miz = 1
    elif i <= 1999:
        aao = 1
    elif i <= 2399:
        kii = 1
    elif i <= 2799:
        dai = 1
    elif i <= 3199:
        aka = 1
    else:
        kan += 1

ans1 = kan+aka+dai+kii+aao+miz+mdr+cha+hai
ans2 = max(aka+dai+kii+aao+miz+mdr+cha+hai,1)
print(ans2,ans1)

Submission status: Accepted

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

s=[0]*8
count=0
ans=0

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

for j in range(8):
  if s[j]!=0:
    ans+=1

if ans==0:
  print(1,count)
  exit()
else:
  print(ans,ans+count)

Submission status: Accepted

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

def color(point):
  if point < 3200:
    return point // 400
  else:
    return 8

vals = {}
for i in a:
  cl = color(i)
  vals.setdefault(cl, 0)
  vals[cl] += 1

# print(vals)
  
if 8 not in vals.keys():
  print(len(vals), len(vals))
else:
  print(max(1, len(vals) - 1), len(vals) + vals[8] - 1)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
B = defaultdict(int)
for i in A:
    B[min(8,i//400)]+=1
ans = 0
jiyuu = 0
for i in B:
    if i != 8:
        ans += 1
    else:
        jiyuu = B[i]
#print(B)
print(*[max(ans,1),ans+jiyuu])