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

l = [False] * 8
top = 0
for i, val in enumerate(a):
    if 1 <= val <= 399:
        l[0] = True
    if 400 <= val <= 799:
        l[1] = True
    if 800 <= val <= 1199:
        l[2] = True
    if 1200 <= val <= 1599:
        l[3] = True
    if 1600 <= val <= 1999:
        l[4] = True
    if 2000 <= val <= 2399:
        l[5] = True
    if 2400 <= val <= 2799:
        l[6] = True
    if 2800 <= val <= 3199:
        l[7] = True
    if 3200 <= val:
        top += 1

c = l.count(True)
mn = c if c != 0 else 1
mx = c + top
print("{} {}".format(mn, mx))

Submission status: Accepted

Solution code:
N=int(input())
A=[int(i) for i in input().split()]
col=[0 for i in range(9)]
for a in A:
  if a<3200:
    col[a//400]+=1
  else:
    col[-1]+=1
ans=0
# print(col)
for i in range(8):
  if col[i]>0:
    ans+=1

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

Submission status: Accepted

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = a[i]//400
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1
        
mini = max(sum(rate_list), 1)
maxi = sum(rate_list)+perfect

print(mini, maxi)

Submission status: Accepted

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

colors = ["gray","brown","green","water","blue","yellow","orange","red","other"]
d = {x: 0 for x in colors}

for x in a:
    rate = x // 400
    if rate == 0:
        d["gray"] += 1
    elif rate == 1:
        d["brown"] += 1 
    elif rate == 2:
        d["green"] += 1 
    elif rate == 3:
        d["water"] += 1 
    elif rate == 4:
        d["blue"] += 1 
    elif rate == 5:
        d["yellow"] += 1 
    elif rate == 6:
        d["orange"] += 1 
    elif rate == 7:
        d["red"] += 1 
    elif rate > 7:
        d["other"] += 1 

num = 0
for x in d:
    if d[x] > 0 and x != "other":
        num += 1

if num == 0:
    print("1" + " " + str(d["other"]))
else:
    print(num, num+d["other"])

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(8):
    # print(1)
    if len([j for j in a if j > 400*i-1 and j < 400*(i+1)]) > 0:
       ans += 1 
ans_min = ans
ans_max = ans + len([i for i in a if 3200 <= i])
print(max(ans_min,1),max(ans_max,1))

Submission status: Accepted

Solution code:
MIN=set()
tourist=0

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

for i in range(n):
  if a[i]>=3200:
    tourist+=1
  else:
    for g in range(1,9):
        low=(g-1)*400
        high=g*400-1
        if low<=a[i] and a[i]<=high:
          MIN.add(g)

if len(MIN)==0:
  print(1,tourist)
else:
  print(len(MIN),len(MIN)+tourist)

Submission status: Accepted

Solution code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

cl = 8-c[:-1].count(0)
cmin = max(1, cl)
cmax = cl+c[8]
print(cmin, cmax)

Submission status: Accepted

Solution code:
def rate(n:int) ->str:
    if 1 <= n <= 399:
        return 'hai'
    elif n <= 799:
        return 'cha'
    elif n <= 1199:
        return 'mido'
    elif n <= 1599:
        return 'mizu'
    elif n <= 1999:
        return 'ao'
    elif n <= 2399:
        return 'ki'
    elif n <= 2799:
        return 'dai'
    elif n <= 3199:
        return 'aka'
    else:
        return 'neutral'

def main():
    n = int(input())
    a = [int(x) for x in input().split()]
    d = {}
    n_count = 0
    for aa in a:
        buf = rate(aa)
        if buf == 'neutral':
            n_count += 1
            continue
        if buf not in d:
            d[buf] = 0
        d[buf] += 1
    if n_count >= 1:
        if d:
            print(len(d.values()),len(d.values()) + n_count)
        else:
            print('1',n_count)
    else:
        print(len(d.values()),len(d.values()))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

color = [False for _ in range(8)]
wild = 0
for i in a:
    if i < 3200:
        color[i // 400] = True
    else:
        wild += 1

mini = 0
for i in color:
    if i:
        mini += 1
if mini == 0:
    mini = 1
    maxi = wild
else:
    maxi = mini + wild
print(mini, maxi)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
C = [0]*9
for a in A:
    if a <3200:
        C[a//400] = 1
    else:
        C[8] += 1
s = sum(C[:8])
print(max(s, 1), s+C[8])

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
color = [0]*8
v = 0
for a in A:
    if a <400:
        color[0] += 1
    elif a <800:
        color[1] += 1
    elif a <1200:
        color[2] += 1
    elif a <1600:
        color[3] += 1
    elif a <2000:
        color[4] += 1
    elif a <2400:
        color[5] += 1
    elif a <2800:
        color[6] += 1
    elif a <3200:
        color[7] += 1
    else:
        v += 1
s = 0
for c in color:
    if c:
        s += 1
if s == 0:
    m = 1 # vのみの時がある!
else:
    m = s
print(m,  s+v)

Submission status: Accepted

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

color = {1:[],2:[], 3:[],4:[],5:[],6:[],7:[],8:[]}
suki = []
iroiro = 0
for i in range(n):
    if a[i] < 1600:
        if a[i] < 800:
            if a[i] < 400:
                color[1].append(a[i])
            else:
                color[2].append(a[i])
        else:
            if a[i] < 1200:
                color[3].append(a[i])
            else:
                color[4].append(a[i])
    else:
        if a[i] < 2400:
            if a[i] < 2000:
                color[5].append(a[i])
            else:
                color[6].append(a[i])
        else:
            if a[i] < 2800:
                color[7].append(a[i])
            elif 2800 <= a[i] < 3200:
                color[8].append(a[i])
            else:
                suki.append(a[i])

for k in color.keys():
    if len(color[k]) != 0:
        iroiro += 1
    else:
        pass
Co = len(suki)
if iroiro != 0:
    ans = iroiro + Co
    print(iroiro,ans)
else:
    print(1,Co)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(n):
    if a[i]<=399:
        c.append('0')
    elif a[i]<=799:
        c.append('1') 
    elif a[i]<=1199:
        c.append('2')
    elif a[i]<=1599:
        c.append('3')
    elif a[i]<=1999:
        c.append('4')
    elif a[i]<=2399:
        c.append('5')
    elif  a[i]<=2799:
        c.append('6')
    elif  a[i]<=3199:
        c.append('7')
x=n-len(c)
#3200以上の人数
c=list(set(c))

print(max(len(c),1), len(c)+x)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<3200:
        array[x//400]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=sum(1 for x in array[:-1]if x>0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
else:
    ans+=array[8]

if ans1==0:
    ans1+=1

print(ans1,ans)

Submission status: Accepted

Solution code:
n=int(input())
s=list(map(int,input().split()))
l=[0 for _ in range(13)]
for x in s:
    l[x//400]+=1
j=sum(r>0 for r in l[:8])
print(max(1,j),j+sum(l[8:]))

Submission status: Accepted

Solution code:
# import bisect
from collections import Counter, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(input())
    a = list(map(int,ipti().split()))
    color = [0] * 8
    over_3199 = 0

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

    color_sum = sum(color)
    ans_min = max(color_sum, 1)
    ans_max = color_sum + over_3199

    print(ans_min, ans_max)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
scorelist = list(map(int, input().split(" ")))
color1 = len(set([int(i/400) for i in scorelist if i < 3200]))
color2 = len([i for i in scorelist if i >= 3200])
ans_min = max(1, color1)
ans_max = color1 + color2
print("{} {}".format(ans_min, ans_max))

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input().rstrip())

scorelist = list(map(int, input().rstrip().split(" ")))

color1 = len(set([int(i/400) for i in scorelist if i < 3200]))

color2 = len([i for i in scorelist if i >= 3200])

ans_min = max(1, color1)
ans_max = color1 + color2

print("{} {}".format(ans_min, ans_max))

Submission status: Accepted

Solution code:
N=int(input())
rates=list(map(int,input().split()))
colors=[]
over3200=0
for n in range(0,N):
    color=rates[n]//400
    if color<8:
        if not color in colors:
            colors.append(color)
    else:
        over3200+=1
if len(colors)==0:
    Min=1
else:
    Min=len(colors)
Max=len(colors)+over3200
print(Min,Max)

Submission status: Accepted

Solution code:
#abc064 c
n=int(input())
a=list(map(int,input().split()))
color=[False]*8
strongman=0
for i in a:
    x=i//400
    if x<8:
        color[x]=True
    else:
        strongman+=1
human=0
for i in color:
    if i==True:
        human+=1
color_min=max(human,1)
color_max=human+strongman
print(color_min,color_max)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
chk = []
ans = [0]*2
if a[0] >= 3200:
  ans[0] = 1
  ans[1] = n
else:
  for i in range(n):
    if a[i] < 400:
      chk.append('hai')
    elif 399 < a[i] < 800:
      chk.append('cha')
    elif 799 < a[i] < 1200:
      chk.append('mi')
    elif 1199 < a[i] < 1600:
      chk.append('miz')
    elif 1599 < a[i] < 2000:
      chk.append('ao')
    elif 1999 < a[i] < 2400:
      chk.append('ki')
    elif 2399 < a[i] < 2800:
      chk.append('dai')
    elif 2799 < a[i] < 3200:
      chk.append('aka')
    else:
      ans[1] += 1
  if 'hai' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'cha' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'mi' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'miz' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'ao' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'ki' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'aka' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'dai' in chk:
    ans[0] += 1
    ans[1] += 1
print(' '.join(map(str,ans)))

Submission status: Accepted

Solution code:
L = [0] * 8
n = int(input())
A = list(map(int, input().split()))
t = 0


for i in A:
    if i < 3200:
        a = i//400
        L[a] += 1
    else:
        t += 1
 
c = 0
for i in L:
    if i!= 0:
        c += 1
max_num = max(c, 1)
min_num = c+t
print(max_num,min_num)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x:x//400,A))
#print(A)
C = [0]*9
for a in A:
  if a>=8:
    C[8] +=1
  elif C[a]==0:
    C[a] = 1
#print(C[:-1])
mi = sum(C[:-1])
mini = mi
if mi == 0:
  mini = 1
ma = mi+C[-1]
print(mini,ma)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
c = [0] * 9
for i in a:
    if i < 3200:
        c[i // 400] += 1
    else:
        c[8] += 1
ans = 0
for i in range(8):
    if c[i] != 0:
        ans += 1
if ans == 0:
    print(1, c[8])
else:
    print(ans, ans + c[8])

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
c = [0] * 8
free = 0
for i in a:
    if i < 400:
        c[0] += 1
    elif i < 800:
        c[1] += 1
    elif i < 1200:
        c[2] += 1
    elif i < 1600:
        c[3] += 1
    elif i < 2000:
        c[4] += 1
    elif i < 2400:
        c[5] += 1
    elif i < 2800:
        c[6] += 1
    elif i < 3200:
        c[7] += 1
    else:
        free += 1
min_ans = len([i for i in c if i > 0])
max_ans = min_ans + free
if min_ans == 0:
    min_ans = 1
print(min_ans, max_ans)

Submission status: Accepted

Solution code:
# Problem C - Colorful Leaderboard

# input process
N = int(input())
a_list = list(map(int, input().split()))

# initialization
kanmuri_count = {
    "king": 0
}

# count process
for a in a_list:
    if a<400 and not "gray" in kanmuri_count:
        kanmuri_count["gray"] = 1
    elif a>=400 and a<800 and not "brown" in kanmuri_count:
        kanmuri_count["brown"] = 1
    elif a>=800 and a<1200 and not "green" in kanmuri_count:
        kanmuri_count["green"] = 1
    elif a>=1200 and a<1600 and not "cyan" in kanmuri_count:
        kanmuri_count["cyan"] = 1
    elif a>=1600 and a<2000 and not "blue" in kanmuri_count:
        kanmuri_count["blue"] = 1
    elif a>=2000 and a<2400 and not "yellow" in kanmuri_count:
        kanmuri_count["yellow"] = 1
    elif a>=2400 and a<2800 and not "orange" in kanmuri_count:
        kanmuri_count["orange"] = 1
    elif a>=2800 and a<3200 and not "red" in kanmuri_count:
        kanmuri_count["red"] = 1
    elif a>=3200:
        kanmuri_count["king"] += 1

# output process
cur_clount = len(kanmuri_count) - 1
ans = cur_clount + kanmuri_count["king"]
print("%d %d"%(max(cur_clount,1), ans))

Submission status: Accepted

Solution code:
B = [0] * 8
n = int(input())
A = list(map(int, input().split()))
t = 0
for i in A:
    if i < 3200:
        a = i//400
        B[a] += 1
    else:
        t += 1

c = 0
for i in B:
    if i!= 0:
        c += 1

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
cnt=[0]*9
for i in a:
  cnt[min(i,3200)//400]+=1
print(max(len(cnt)-cnt.count(0)-min(cnt[-1],1),1),len(cnt)-cnt.count(0)+max(0,cnt[-1]-1))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
colors = [False]*8
rainbow = 0
for i in range(N):
    if 1<=a[i]<=399:
        colors[0] = True
    elif 400<=a[i]<=799:
        colors[1] = True
    elif 800<=a[i]<=1199:
        colors[2] = True
    elif 1200<=a[i]<=1599:
        colors[3] = True
    elif 1600<=a[i]<=1999:
        colors[4] = True
    elif 2000<=a[i]<=2399:
        colors[5] = True
    elif 2400<=a[i]<=2799:
        colors[6] = True
    elif 2800<=a[i]<=3199:
        colors[7] = True
    else:
        rainbow += 1
if rainbow == 0:
    ans = colors.count(True)
    print(ans,ans)
else:
    tmp = colors.count(True)
    if tmp==0:# all rainbow
        min_ = 1
        max_ = rainbow
        print(min_,max_)
    else:# rainbow exist
        min_ = colors.count(True)
        max_ = colors.count(True) + rainbow
        print(min_,max_)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
R = [0 for i in range(9)]
for i in range(n):
    if A[i] < 3200: R[A[i]//400] += 1
    else: R[8] += 1
mi = 0
for i in range(8):
    if R[i] > 0: mi += 1
if mi == 0 and R[8] > 0:
    print(mi+1, mi+R[8])
else:
    print(mi, mi+R[8])

Submission status: Accepted

Solution code:
n = int(input())
A = [int(x) for x in input().split()]
colored = [False] * 8
cnt = 0
super= 0
for a in A:
    if 3200 <= a:
        super += 1
        continue
    rank = a // 400
    if not colored[rank]:
        colored[rank] = True
        cnt += 1
mn = 1 if cnt == 0 and super != 0 else cnt
mx = cnt + super
print(mn, mx)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = [0] * 8
tmp = 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:
    tmp = tmp + 1
l = color.count(1)
if l == 0:
  print("1 {}".format(tmp))
else:
  print("{} {}".format(l, l + tmp))

Submission status: Accepted

Solution code:
N=int(input())
a=input().split()
b=[int(c) for c in a]
list1=[0]*8
number=0
for d in b:
    if 1<=d and 399>=d:
        list1[0]+=1
    elif 400<=d and d<=799:
        list1[1]+=1
    elif 800<=d and d<=1199:
        list1[2]+=1
    elif 1200<=d and d<=1599:
        list1[3]+=1
    elif 1600<=d and d<=1999:
        list1[4]+=1
    elif 2000<=d and d<=2399:
        list1[5]+=1
    elif 2400<=d and d<=2799:
        list1[6]+=1
    elif 2800<=d and d<=3199:
        list1[7]+=1
    else:
        number+=1
while 0 in list1:
    list1.remove(0)
kazu=len(list1)
if kazu==0:
    if number==0:
        print(str(0)+' '+str(0))
    else:
        print(str(1)+' '+str(number))
else:
    if number==0:
        print(str(kazu)+' '+str(kazu))
    else:
        print(str(kazu)+' '+str(kazu+number))

Submission status: Accepted

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

dic = [False]*8

cnt = 0

for i in range(n):
  tmp = A[i] // 400
  if(tmp >= 8):
    cnt += 1
  else:
    dic[tmp] = True
if(sum(dic) == 0 and cnt > 0):
  print('1 ' + str(cnt))
else:
  print(str(sum(dic)) + ' ' + str(sum(dic) + cnt))

Submission status: Accepted

Solution code:
#64C

n = int(input())
a = list(map(int,input().split()))
color = [0] * 8
wc = 0

for i in range(n):
    for j in range(8):
        if a[i] >= j*400 and a[i] <= (j+1)*400 - 1:
            color[j] = 1
    if a[i] >= 3200:
        wc += 1
            
mi = sum(color)
ma = mi + wc

print(max(mi,1) , ma)

Submission status: Accepted

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

color = set()
over = 0
for a in A :
    if a < 3200 :
        color.add(a//400)
    else :
        over += 1

print(max(1,len(color)), len(color)+over)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
x = [i//400 for i in a]
mina = len(set([i for i in x if i < 8]))
maxa = mina + len([i for i in x if i >= 8])
print(max(mina, 1), maxa)

Submission status: Accepted

Solution code:
n = int(input())

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

rate = sum([(cs[i] != 0) for i in range(0,8)])

print("{} {}".format(max(rate,1),rate+cs[8]))

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    a=LI()
    L=[0]*8
    F=0
    for i in range(N):
        if a[i]>=3200:
            F+=1
            continue
        b=a[i]//400
        L[b]=1
        
    ans=sum(L)
    aaa=0
    if min(a)>=3200:
        aaa+=1
    print(ans+aaa,ans+F)
        

main()

Submission status: Accepted

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

gray=[]
brown=[]
green=[]
light_blue=[]
blue=[]
yellow=[]
orange=[]
red=[]
free=[]

count=0

for i in a:
    if 0<i<400:
        gray.append(i)
    elif 400<=i<800:
        brown.append(i)
    elif 800<=i<1200:
        green.append(i)
    elif 1200<=i<1600:
        light_blue.append(i)
    elif 1600<=i<2000:
        blue.append(i)
    elif 2000<=i<2400:
        yellow.append(i)
    elif 2400<=i<2800:
        orange.append(i)
    elif 2800<=i<3200:
        red.append(i)
    else:
        free.append(i)

if len(gray)>=1:
    count+=1
if len(brown)>=1:
    count+=1
if len(green)>=1:
    count+=1
if len(light_blue)>=1:
    count+=1
if len(blue)>=1:
    count+=1
if len(yellow)>=1:
    count+=1
if len(orange)>=1:
    count+=1
if len(red)>=1:
    count+=1

if count>0:
    print(count,count+len(free))
else:
    print(min(1,len(free)),len(free))

Submission status: Accepted

Solution code:
def coder(n):
    return int(n)//400
n=int(input())
aList=list(map(coder,input().split()))
Max=0
Min=0
c=0
C=0
tmp=[]
for i in range(n):
    if aList[i]<=7 and tmp.count(aList[i])==0:
        tmp.append(aList[i])
    elif aList[i]>=8:
        C+=1
c=len(tmp)
Max=c+C
if c>0:
    Min=c
else:
    Min=1
print("{} {}".format(Min,Max))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<= 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma = x+y
print('{} {}'.format(mi, ma))

Submission status: Accepted

Solution code:
def col(n):
  if 1<=n<400:
    return 1
  if 400<=n<800:
    return 2
  if 800<=n<1200:
    return 3
  if 1200<=n<1600:
    return 4
  if 1600<=n<2000:
    return 5
  if 2000<=n<2400:
    return 6
  if 2400<=n<2800:
    return 7
  if 2800<=n<3200:
    return 8
  if n>=3200:
    return 9

n=int(input())
l=list(map(int,input().split()))
list=[]
for i in l:
  list.append(col(i))
p=list.count(9)
if p==0:
  print(len(set(list)),len(set(list)))
elif len(set(list))==1:
  print(1,p)
else:
  print(len(set(list))-1,len(set(list))+p-1)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = []
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<=7:
        x.add(i)
    else:
        y+=1
x = len(x)
if x:
    mi = x
else:
    mi = 1
ma = x+y
print('{} {}'.format(mi, ma))

Submission status: Accepted

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

cnt=0
q=set()
for num in a:
    if num>=8:
        cnt+=1
    else:
        q.add(num)
        
ans=len(q)
if ans==0:
    print(1,cnt)
else:
    print(ans,ans+cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(_) for _ in input().split()]
col = [0] * n
cnt = 0
for i in range(n):
    if a[i] >= 3200:
        col[i] = 8
        cnt += 1
    else:
        col[i] = a[i] // 400
ans_min = len(set(col))
ans_max = ans_min
if cnt == n:
    ans_min = 1
    ans_max = cnt
elif cnt > 0:
    ans_min -= 1
    ans_max = ans_min + cnt
print(ans_min, ans_max)

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input().rstrip())

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

under3200 = set([int(i/400) for i in score_list if i < 3200])
over3200 = [i for i in score_list if i >= 3200]

minColor = max(1, len(under3200))
maxColor = len(under3200) + len(over3200)

print("{} {}".format(minColor, maxColor))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [min(x//400, 8) for x in map(int, input().split())]
a = Counter(a)

if len(a) == 1 and a[8] != 0:
    min_a = 1
    max_a = a[8]
elif a[8] != 0:
    min_a = len(a)-1
    max_a = min_a+a[8]
else:
    min_a = max_a = len(a)
print(min_a, max_a)

Submission status: Accepted

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

l = [0]*9
cam = 0
for d in data:
    num = d//400 if d//400 < 8 else 8
    if num==8: cam += 1
    if l[num] == 0: l[num] = 1

score = sum(l[:8])
print(max(1,score), score+cam)

Submission status: Accepted

Solution code:
N = int(input())
X = list(map(int, input().split()))
X = [x//400 for x in X]
min_X = len(set([x for x in X if x < 8]))
max_X = min_X + len([x for x in X if x >= 8])
# この max は気づかないなあ
print(max([min_X, 1]), max_X)

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
mi=0
ma=0
l=[]
count=0
for i in range(N):
 if a[i]<3200:
  l.append(a[i]//400)
 else:
  count=count+1

print(max(1,len(set(l))),max(1,len(set(l))+count))

Submission status: Accepted

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

gray = 0
brown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
ex = 0

for i in range(n):
    if a[i] <= 399:
        gray = 1
    elif a[i] <= 799:
        brown = 1
    elif a[i] <= 1199:
        green = 1
    elif a[i] <= 1599:
        light_blue = 1
    elif a[i] <= 1999:
        blue = 1
    elif a[i] <= 2399:
        yellow = 1
    elif a[i] <= 2799:
        orange = 1
    elif a[i] <= 3199:
        red = 1
    else:
        ex += 1

if ex == n:
    min_color = 1
    max_color = ex
else:
    min_color = gray + brown + green + light_blue + blue + yellow + orange + red
    max_color = min_color + ex

print('{}'.format(min_color) +' {}'.format(max_color))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
set_a = set()
cnt = 0 

for i in range(N):
    if(a[i] < 3200):
        set_a.add(a[i]//400)
    else:
        cnt += 1

print(max(len(set_a), 1), min(len(set_a)+cnt, N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
A = list(map(int, input().split()))
d = [0]*(3200+1)

for a in A:
    if a > 3200:
        a = 3200
    d[a] += 1

cnt = 0
for i in range(0, 3200, 400):
    if np.count_nonzero(d[i:i+400]) > 0:
        cnt += 1
        
if d[3200] == 0:
    print(cnt, cnt)
else:
    if cnt == 0:
        print(1, d[3200])
    else:
        print(cnt, cnt+d[3200])

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
top = 0
color = []
for i in range(N):
    if a[i] < 400:
        color.append(0)
    elif a[i] < 800:
        color.append(1)
    elif a[i] < 1200:
        color.append(2)
    elif a[i] < 1600:
        color.append(3)
    elif a[i] < 2000:
        color.append(4)
    elif a[i] < 2400:
        color.append(5)
    elif a[i] < 2800:
        color.append(6)
    elif a[i] < 3200:
        color.append(7)
    else:
        top += 1

s = set(color)
print(max(1, len(s)), len(s) + top)

Submission status: Accepted

Solution code:
n = input()
A = list(map(int, input().split()))
flags = [False] * 8
count = 0
for a in A:
  if a < 3200:
    flags[a // 400] = True
  else:
    count += 1
print(max(sum(flags), 1), sum(flags) + count)

Submission status: Accepted

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

cnt=0
l=[]
for i in a:
  p=i//400
  if p<=7:
    l.append(p)
  else:
    cnt+=1

d=len(set(l))

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

Submission status: Accepted

Solution code:
def main():
    participants = int(input())
    ratings = list(map(int, input().split()))
    color = [0] * 9
    for rating in ratings:
        color[min(rating // 400, 8)] += 1
    answer = 0
    for i in range(8):
        if color[i] > 0:
            answer += 1
    print(max(1, answer), answer + color[-1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
f = [False]*8
c = 0
for a in A:
    if a < 400:
        f[0] = True
    elif a < 800:
        f[1] = True
    elif a < 1200:
        f[2] = True
    elif a < 1600:
        f[3] = True
    elif a < 2000:
        f[4] = True
    elif a < 2400:
        f[5] = True
    elif a < 2800:
        f[6] = True
    elif a < 3200:
        f[7] = True
    else:
        c += 1
print(max(f.count(True), 1), f.count(True)+c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
from collections import Counter
input()
rates = np.array(input().split(), dtype=np.int64) // 400
over3199 = (rates >= 8).sum()
colors = len(Counter(rates[rates < 8]).keys())
print(max(1, colors), colors + over3199)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
color = [0] * 8
select = 0
for i in range(N):
    for j in range(8):
        if 400 * j <= A[i] < 400 * (j + 1):
            color[j] += 1
            break
        elif 400 * (j + 1) == 3200:
            select += 1
            break
ans = 0

for k in range(8):
    if color[k] != 0:
        ans += 1
print(max(ans, 1), ans + select)