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:
import collections as c
input();a=c.Counter(i//400 for i in [*map(int,input().split())])
b,c=len(set([i for i,j in a.items()if i<8])),sum([j for i,j in a.items()if i>=8])
print([b,1][b==0],b+c)

Submission status: Accepted

Solution code:
import collections as c
input();a=c.Counter(i//400 for i in list(map(int,input().split())))
b,c=len(set([i for i,j in a.items() if i<8])),sum([j for i,j in a.items()if i>=8])
print([b,1][b==0],b+c)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
count=0
ans=1
color_lis=[0,0,0,0,0,0,0,0]
for i in range(n):
  if a[i]//400>=8:
    count+=1
  else:
    color_lis[a[i]//400]=1
ans=sum(color_lis)
if count>0:
  flag=1
else:
  flag=0
ans1 = max(flag,ans)
ans2 = ans+count
print(ans1,ans2)

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    a = LI()
    lst = [False]*8
    god = 0
    for i in a:
        rank = i//400
        if rank<=7:
            lst[rank] = True
        else:
            god += 1
    ans = lst.count(True)
    if ans == 0:
        ans = 1
        god -= 1

    print(ans,ans + god)

main()

Submission status: Accepted

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

c = [0] * 9
for num in a:
    if num < 400:
        c[0] += 1
    elif num < 800:
        c[1] += 1
    elif num < 1200:
        c[2] += 1
    elif num < 1600:
        c[3] += 1
    elif num < 2000:
        c[4] += 1
    elif num < 2400:
        c[5] += 1
    elif num < 2800:
        c[6] += 1
    elif num < 3200:
        c[7] += 1
    else:
        c[8] += 1
mi = 0
ma = 0
for i in range(8):
    if c[i] >= 1:
        mi += 1
        ma += 1
ma += c[8]
if mi == 0:
    if c[8] >= 1:
        mi += 1
print(str(mi) + " " + str(ma))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


N = z()
A = zz()
lis = list(range(-1, 3200, 400))
ok = 0
set_ = []
for i in range(N):
    if (A[i] >= 3200):
        ok += 1
    else:
        idx = bisect.bisect_left(lis, A[i])
        set_.append(idx)
set_ = set(set_)
min_ = max(len(set_), 1)
max_ = len(set_) + ok

print(min_, max_)

Submission status: Accepted

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

border = 3200 // 400
arr = [0] * 8
over = 0
for a in aa:
    x = a // 400

    if x >= border:
        over += 1
        continue

    arr[x] = 1

s = sum(arr)

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

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
cnt = 0
for i in range(8):
    if c[i] != 0:
        cnt += 1
mini = max(1,cnt)
maxi = cnt+c[8]
print(mini,maxi)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
cin = [0, 0, 0, 0, 0, 0, 0, 0]
kin = 0
pin = 0
flag = 0
for i in A:
    if i < 3200:
        cin[i//400] += 1
        pin = 1
    else:
        kin += 1
        flag = 1
if pin == 0:
    print(1, kin)
else:
    print(8-cin.count(0), 8-cin.count(0)+kin)

Submission status: Accepted

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

color = [0]*8
freer=0

for i in a:
    if i<3200:
        color[i//400]+=1
    else:
        freer+=1
        
ans_base = 8-color.count(0)

if ans_base==0:
    ans_min = 1
else:
    ans_min = ans_base
    
ans_max = ans_base+freer
        
print(ans_min, ans_max)

Submission status: Accepted

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

for i in range(N):
    temp=a[i]//400
    if temp>8:
        ans[8]+=1
    else:
        ans[temp]+=1
nin=0
for i in range(8):
    if ans[i]!=0:
        nin+=1
if nin==0 and ans[8]!=0:
    nin+=1
    nax=ans[8]
else:
    nax=nin+ans[8]
print(nin,nax)

Submission status: Accepted

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

s = set()
b = 0
for i in a:
    if i < 3200:
        s.add(i//400)
    else:
        b += 1
else:
    min = len(s)
    print(max(min, 1), min + b)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
for i in range(n):
  if a[i]<400:
    b[0]+=1
  elif a[i]<800:
    b[1]+=1
  elif a[i]<1200:
    b[2]+=1
  elif a[i]<1600:
    b[3]+=1
  elif a[i]<2000:
    b[4]+=1
  elif a[i]<2400:
    b[5]+=1
  elif a[i]<2800:
    b[6]+=1
  elif a[i]<3200:
    b[7]+=1
  else:
    b[8]+=1
    
min=8-b[:8].count(0)
max=min+b[8]

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

Submission status: Accepted

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

b=[0 for _ in range(8)]
for r in a:
  t=r//400
  if t>=8:
    ch+=1
  else:
    b[t]+=1
    
c=8-b.count(0)
print(str(max(1,c))+' '+str(c+ch))

Submission status: Accepted

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

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

ans = 0
if col[8] == N:
  print(1, N)
  exit()
  
for i in range(8):
  if col[i] > 0:
    ans += 1
print(ans, end=" ")
ans += col[8]
print(ans)

Submission status: Accepted

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

color=[]
free=0
Sans,Mans=0,0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        
#Mans=Sans
#if free+Sans>=8:
 #   Mans=8
#else:
 #   Mans=Sans+free

Mans=Sans+free
if Sans==0:
    Sans=1
print(Sans,Mans)

Submission status: Accepted

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

mini = 0
color_list = []
for i in a:
    if (i//400)<8 and ((i//400 in color_list) == False):
        mini += 1
        color_list.append(i//400)

maxi = mini
for j in a:
    if j >= 3200:
        maxi += 1
if mini == 0:#忘れてた
    mini = 1
print(mini,maxi)

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
L=[i//400 for i in L]
a=[i for i in L if i<8]
b=[i for i in L if i>7]
a=len(set(a))
b=len(b)
if a==0:
  mi=1
  ma=b
else:
  mi=a
  ma=mi+b
print(mi,ma)

Submission status: Accepted

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

A = [a // 400 for a in A]

C = [0 for _ in range(9)]
for a in A:
    if a > 8:
        a = 8
    C[a] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1


if C[-1] == 0:
    ans_min = cnt_n0
    ans_max = cnt_n0
else:
    if sum(C) == C[-1]:
        ans_min = 1
    else:
        ans_min = cnt_n0 - 1

    ans_max = cnt_n0 - 1 + C[-1]


print(ans_min, ans_max)

Submission status: Accepted

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

ans = 0
t = 400
while t < 3201:
  for i in a:
    if i >= t-400 and i < t:
      ans += 1
      break
  t += 400

s = 0
for i in a:
  if i >= 3200: s += 1

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: min(x // 400, 8), a))
#print(a)
m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1
#M = min(M, 8)
if m == 0:
    m = 1
print(m, M)

Submission status: Accepted

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

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

if sum(R[:-1])!=0:
  M = 8-R[:-1].count(0)+R[-1]
  m = 8-R[:-1].count(0)
  print(m,M)
else:
  print(1,R[-1])

Submission status: Accepted

Solution code:
is_alive = [0]*8#各ランク

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

count_over=0

for i in range(0,N,1):
    if a[i]>=3200:
        count_over +=1
    else:
        is_alive[a[i]//400]=1

print(max(1,sum(is_alive)),sum(is_alive)+count_over)

Submission status: Accepted

Solution code:
N = int(input())
rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
p = [0] * 9

A = [int(a) for a in input().split(" ")]
A.sort()

j = 0
for i in range(len(A)):
  while j < 8:
    if rate[j] <= A[i] < rate[j + 1]:
      p[j] = 1
      break
    else:
      j += 1
  else:
    p[8] = len(A[i:])
    break

print(str(max([sum(p[:8]), 1])) + " " + str(sum(p)))

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = [False] * 8
o = 0
for i in range(N):
    for j in range(8):
        if a[i] >= 400*j and a[i] < 400*(j+1):
            c[j] = True
    if a[i] >= 3200:
        o += 1
if c.count(True) > 0:
    print(c.count(True), c.count(True)+o)
else:
    print(1, o)

Submission status: Accepted

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc) + (1 if (len(cc) == 0 and extra) else 0), min(10000, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Accepted

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

c=[0]*8
maxc=0
for a in A:
    if a>=3200:
        maxc+=1
    else:
        c[a//400]=1
minc = c.count(1)
ans = minc+maxc
print(max(minc,1),ans)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*8
c=0
for x in a:
  if x<400:
    b[0]=1
  elif x<800:
    b[1]=1
  elif x<1200:
    b[2]=1
  elif x<1600:
    b[3]=1
  elif x<2000:
    b[4]=1
  elif x<2400:
    b[5]=1
  elif x<2800:
    b[6]=1
  elif x<3200:
    b[7]=1
  else:
    c+=1
x=b.count(1)
print(max(x,1),x+c)

Submission status: Accepted

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

list_over_3200 = []
list_under_3200 = []
for num in a:
    if num < 3200:
        list_under_3200.append(num // 400)
    else:
        # 3200以上の人を別のリストにいれる。
        list_over_3200.append(num)
maxAns = len(set(list_under_3200)) + len(list_over_3200)
if len(set(list_under_3200)) == 0:
    minAns = 1
else:
    minAns = len(set(list_under_3200))
print(minAns, maxAns)

Submission status: Accepted

Solution code:
def main():
    n=int(input())
    ans=[0]*8
    other = 0
    for a in map(int,input().split()):
        if a >= 3200:
            other+=1
        else:
            ans[a//400] = 1
    a = ans.count(1)
    print(a if a != 0 else 1, a+other)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
dic = {}
over = 0
color = 8
for i in range(n):
    if a[i]<400:
        dic.setdefault(400,0)
        dic[400] += 1
    elif a[i]<800:
        dic.setdefault(800,0)
        dic[800] += 1
    elif a[i]<1200:
        dic.setdefault(1200,0)
        dic[1200] += 1
    elif a[i]<1600:
        dic.setdefault(1600,0)
        dic[1600] += 1
    elif a[i]<2000:
        dic.setdefault(2000,0)
        dic[2000] += 1
    elif a[i]<2400:
        dic.setdefault(2400,0)
        dic[2400] += 1
    elif a[i]<2800:
        dic.setdefault(2800,0)
        dic[2800] += 1
    elif a[i]<3200:
        dic.setdefault(3200,0)
        dic[3200] += 1
    else:
        over += 1

if over > 0:
    if len(dic)==0:
        print(1,over)
    else:
        print(len(dic),len(dic)+over)
else:
    print(len(dic),len(dic))

Submission status: Accepted

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

free = 0
colors = {}

for a in A:
    if a < 3200:
        ai = a // 400
        colors[ai] = True

    else:
        free += 1

lc = len(colors)

print(max(1, lc), lc + free)

Submission status: Accepted

Solution code:
#C - Colorful Leaderboard 

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

n = 399
a, b, c, d, e, f, g, h, z = 0,0,0,0,0,0,0,0,0

for i in A:
    if i >= 1 and i <= n:
        a = 1
    elif i >= 400 and i <= n + 400:
        b = 1
    elif i >= 2*400 and i <= 2*400 + n:
        c = 1
    elif i >= 3*400 and i <= 3*400 + n:
        d = 1
    elif i >= 4*400 and i <= 4*400 + n:
        e = 1
    elif i >= 5*400 and i <= 5*400 + n:
        f = 1
    elif i >= 6*400 and i <= 6*400 + n:
        g = 1
    elif i >= 7*400 and i <= 7*400 + n:
        h = 1
    else:
        z += 1

min_num, max_num = 0, 0
        
min_num = a+b+c+d+e+f+g+h


max_num = min_num + z
min_num = max(1, min_num)

print(min_num,max_num)

Submission status: Accepted

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

w = []
num = 0
for i in a:
    if 1 <= i <= 399:
        if 1 not in w:
            w.append(1)
    elif 400 <= i <= 799:
        if 400 not in w:
            w.append(400)
    elif 800 <= i <= 1199:
        if 800 not in w:
            w.append(800)
    elif 1200 <= i <= 1599:
        if 1200 not in w:
            w.append(1200)
    elif 1600 <= i <= 1999:
        if 1600 not in w:
            w.append(1600)
    elif 2000 <= i <= 2399:
        if 2000 not in w:
            w.append(2000)
    elif 2400 <= i <= 2799:
        if 2400 not in w:
            w.append(2400)
    elif 2800 <= i <= 3199:
        if 2800 not in w:
            w.append(2800)
    else:
        num += 1
if 0 < len(w):
    print(len(w), len(w)+num)
else:
    print(1, len(w)+num)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    l = [i//400 for i in a if i < 3200]
    c = len(set(l))
    print(max(1, c), c+n-len(l))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
cnt = []
over = 0
for i in range(n):
    m = a[i] // 400
    if m < 8:
        if m not in cnt:
            cnt.append(m)
    else:
        over += 1
if len(cnt) > 0:
    print(len(cnt), len(cnt)+over)
else:
    print(1, len(cnt)+over)

Submission status: Accepted

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

ans = []
over = 0
for i in range(N):
  n = a[i] // 400
  if n < 8:
    if n not in ans:
      ans.append(n)
  else:
    over += 1
    
cnt = len(ans) + over
if len(ans) > 0:
  print(len(ans), cnt)
else:
  print(1, cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(lambda x: min(8, int(x)//400), input().split()))

cnt = 0
for i in a:
    if i >= 8:
        cnt += 1
c = len(set(a)) - (1 if cnt != 0 else 0)

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

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())

rank=[0]*9

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

cnt=8
for i in range(8):
    if rank[i]==0:
        cnt-=1

print('{} {}'.format(max(1,cnt),cnt+rank[8]))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]
if min(a) >= 3200:
  print(1,len(a))
  quit()
for ai in a:
  if ai <= 3199:
    rnk = ai // 400
    color[rnk] += 1
  else:
    color[8] += 1

min_color = 0
for i in range(8):
  if color[i] > 0:
    min_color += 1
max_color = min_color + color[8]
print(min_color,max_color)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
*A,=map(int,input().split())
s=list(map(lambda x: x//400, A))

mm=len(set([i for i in s if i<8])) 
o=len([i for i in s if 8<=i]) # 色を変えられる人
print(mm if 1<=mm else 1,min(N,mm+o))

Submission status: Accepted

Solution code:
from collections import defaultdict

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

count=defaultdict(int)
count3200=0
for i in range(N):
  if a[i] < 3200:
    count[a[i] // 400] += 1
  else:
    count3200 += 1
    
print(max(len(count),1),len(count)+count3200)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0 for i in range(9)]
for i in range(n):
    b[min([a[i]//400,8])]+=1

ans1=len([i for i in b[:8] if i>0])
ans2=ans1+b[8]
ans1=max([ans1,1])
print(ans1,ans2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

colors = [min(8, i // 400) for i in rates]
CTR_colors = collections.Counter(colors)

ans = len(CTR_colors)

if (CTR_colors[8] > 0):
    ans -= 1

    if (ans == 0):
        mini_ans = ans + 1
    else:
        mini_ans = ans
    
    max_ans = min(100, ans + CTR_colors[8])

else:
    mini_ans, max_ans = ans, ans

print(mini_ans, max_ans)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    A = list(map(int, input().split()))
    rate = set()
    top = 0
    for a in A:
        if a >= 3200:
            top += 1
        else:
            rate.add(a // 400)
    print("{} {}".format(max(1, len(rate)), len(rate) + top))
    
    

if __name__ == "__main__":
    main()

Submission status: Accepted

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

lst = [0] * 8
s = 0

for i in a:
    if i >= 3200:
        s += 1
    else:
        i //= 400
        lst[i] += 1

colour = 0
for i in lst:
    if i >= 1:
        colour += 1

m = max(1, colour)
M = colour + s

print(m, M)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
al=0
for i in range(n):
  if a[i]>=3200:
    al+=1
    a[i]=8
  else:
    a[i]=a[i]//400
if al==0:
  cl=len(set(a))
else:
  cl=len(set(a))-1
if cl==0:
  mi=1
else:
  mi=cl
ma=al+cl
print(mi,ma)

Submission status: Accepted

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

rate = [i*400-1 for i in range(1,9)]
over = 0
d = {}

for i in range(n):
    if a[i] > rate[-1]:
        over += 1
    else:
        for j in range(len(rate)):
            if a[i] <= rate[j]:
                if rate[j] not in d:
                    d[rate[j]] = 1
                else:
                    d[rate[j]] = d[rate[j]] + 1
                break


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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
d={}
f=0
for a in l:
    if a<400:
        if not 0 in d:
            d[0]=1
    elif a<800:
        if not 1 in d:
            d[1]=1
    elif a<1200:
        if not 2 in d:
            d[2]=1
    elif a<1600:
        if not 3 in d:
            d[3]=1
    elif a<2000:
        if not 4 in d:
            d[4]=1
    elif a<2400:
        if not 5 in d:
            d[5]=1
    elif a<2800:
        if not 6 in d:
            d[6]=1
    elif a<3200:
        if not 7 in d:
            d[7]=1
    else:
        f+=1
v=sum(d.values())
min_=1 if v==0 else v
max_=v+f
print(min_,max_)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
d={}
f=0
for a in l:
    if a<400:
        if not 0 in d:
            d[0]=1
    elif a<800:
        if not 1 in d:
            d[1]=1
    elif a<1200:
        if not 2 in d:
            d[2]=1
    elif a<1600:
        if not 3 in d:
            d[3]=1
    elif a<2000:
        if not 4 in d:
            d[4]=1
    elif a<2400:
        if not 5 in d:
            d[5]=1
    elif a<2800:
        if not 6 in d:
            d[6]=1
    elif a<3200:
        if not 7 in d:
            d[7]=1
    else:
        f+=1
v=sum(d.values())
min_=1 if v==0 else v
max_=v+f
print(min_,max_)

Submission status: Accepted

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

cnt = [False] * 8
free = 0

for a in A:
  c = a // 400
  if c >= 8:
    free += 1
  else:
    cnt[c] = True

max_c = sum(cnt) + free
if sum(cnt) != 0:
  min_c = sum(cnt)
else:
  min_c = 1

print(min_c, max_c)

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int, input().split()))
r = 0
cols = [0] * 8
for i in arr:
  color = i // 400
  if color <= 7:
    cols[color] = 1
  else:
    r += 1
c = sum(cols)
print(max(1, c), r+c)

Submission status: Accepted

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

c = [0] * 8
r = 0

for i in a:
    col = i // 400
    if col <= 7:
        c[col] = 1
    else:
        r += 1

c = sum(c)

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(lambda x:int(x)//400, input().split()))

r = len(set(range(8)) & set(a))
cnt = 0
for i in a:
    if i >= 8: cnt += 1

x, y = max(r, 1), r+cnt
print(x, y)

Submission status: Accepted

Solution code:
_ = input()
A = list(map(int,input().rstrip().split(" ")))
ans = [0,0]
q = [0 for i in range(9)]
for i in A:
    q[min(8,i // 400)] += 1
for i in range(9):
    if i == 8:
        ans[1] += q[i]
    else:
        if q[i] != 0:
            ans[0] += 1
            ans[1] += 1
ans[0] = max(1,ans[0])
print(str(ans[0]) + " " + str(ans[1]))

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
color=set()
over_3200=0
 
for i in range(N):
  if A[i]<=399:
    color.add(1)
  elif A[i]<=799:
    color.add(2)
  elif A[i]<=1199:
    color.add(3)
  elif A[i]<=1599:
    color.add(4)
  elif A[i]<=1999:
    color.add(5)
  elif A[i]<=2399:
    color.add(6)
  elif A[i]<=2799:
    color.add(7)
  elif A[i]<=3199:
    color.add(8)
  else:
    over_3200+=1

if len(color)==0:
  print(1,over_3200)
else:
  print(len(color),len(color)+over_3200)

Submission status: Accepted

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

colors = [0] * 9
for a in A:
    idx = a // 400
    if idx >= 8:
        idx = 8
    colors[idx] += 1
ans = 0
for i in range(8):
    if colors[i] > 0:
        ans += 1
max_ans = ans
if colors[8] > 0:
    max_ans += colors[8]

if ans == 0 and max_ans > 0:
    ans += 1
print(ans, max_ans)

Submission status: Accepted

Solution code:
n = int(input())
alst = list(map(int, input().split()))
lst = [0 for _ in range(9)]
for num in alst:
    pos = min(num // 400, 8)
    lst[pos] += 1
cnt = 8 - lst[:-1].count(0)
print(max(cnt, 1), cnt + lst[-1])

Submission status: Accepted

Solution code:
N = int(input())
A = [int(T) for T in input().split()]
Color = [T//400 for T in A if T<3200]
ColL = len(Color)
SetL = len(set(Color))
MIN = max(1,SetL)
MAX = SetL+(N-ColL)
print('{} {}'.format(MIN,MAX))

Submission status: Accepted

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

d = {'gry':0,'brw':0,'grn':0,'miz':0,'blu':0,'yel':0,'dai':0,'red':0,'any':0}
for i in a:
    if 1 <= i <= 399:
        d['gry'] += 1
    elif 400 <= i <= 799:
        d['brw'] += 1
    elif 800 <= i <= 1199:
        d['grn'] += 1
    elif 1200 <= i <= 1599:
        d['miz'] += 1
    elif 1600 <= i <= 1999:
        d['blu'] += 1
    elif 2000 <= i <= 2399:
        d['yel'] += 1
    elif 2400 <= i <= 2799:
        d['dai'] += 1
    elif 2800 <= i <= 3199:
        d['red'] += 1
    else: #any
        d['any'] += 1

ans = 0
zero = 0
for k,v in d.items():
    if k == 'any':
        pass
    else:
        if v != 0:
            ans += 1

print (max(1,ans),ans+d['any'])

Submission status: Accepted

Solution code:
n = int(input())
et=0
arr = list(map(int , input().split()))
count = [0 for i in range(0,10)]
for i in range(0 , n):
	if arr[i]>=1 and arr[i]<=399:
		count[0]=count[0]+1
	elif arr[i]>=400 and arr[i]<=799:
		count[1]=count[1]+1
	elif arr[i]>=800 and arr[i]<=1199:
		count[2]=count[2]+1
	elif arr[i]>=1200 and arr[i]<=1599:
		count[3]=count[3]+1
	elif arr[i]>=1600 and arr[i]<=1999:
		count[4]=count[4]+1
	elif arr[i]>=2000 and arr[i]<=2399:
		count[5]=count[5]+1
	elif arr[i]>=2400 and arr[i]<=2799:
		count[6]=count[6]+1
	elif arr[i]>=2800 and arr[i]<=3199:
		count[7]=count[7]+1
	else:
		et = et+1
mn =1000
mx =0
tot=0
for i in range(0, 8):
	if count[i]>0:
		tot=tot+1
if tot==0:
	print(1,et)
else:
	print(tot , tot+et)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(set(A))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum == 0:
    print(1, end=' ')
else:
    print(sum, end=' ')
sum += cnt8
print(sum)

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
o=0
m=0
u=[0]*8
for i in a:
    if 3199<i:
        o+=1
    else:
        if u[i//400]==0:
            u[i//400]+=1
            m+=1
print(max(m,1),m+o)

Submission status: Accepted

Solution code:
#8
n = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(8)]
cnt = 0

for i in a:
    x = i//400
    if x >=8:
        cnt +=1
    else:
        if num[x] == 0:
            num[x] +=1
    
if cnt == 0:
    print(sum(num),sum(num))
elif sum(num) == 0:
    print(1,cnt)
else:
    print(sum(num),sum(num)+cnt)

Submission status: Accepted

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

if l.count(1) == 0:
  print("1 "+str(c))
else:
  print(str(l.count(1))+" "+str(l.count(1)+c))

Submission status: Accepted

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

for a in A:
    if a < 400:
        check.append(1)
    elif a < 800:
        check.append(2)
    elif a < 1200:
        check.append(3)
    elif a < 1600:
        check.append(4)
    elif a < 2000:
        check.append(5)
    elif a < 2400:
        check.append(6)
    elif a < 2800:
        check.append(7)
    elif a < 3200:
        check.append(8)
    else:
        every += 1
length = len(set(check))
if length == 0:
    length = 1
    every -= 1

print(length,length+every)

Submission status: Accepted

Solution code:
from collections import defaultdict
n=input()
A=[int(i) for i in input().split()]
c=defaultdict(int)
free=0
for a in A:
  if a > 3199:
    free+=1
  else:
    c[a//400]+=1
print(max(len(c),1),len(c)+free)

Submission status: Accepted

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

rate = [0]*8
f = 0

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

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

Submission status: Accepted

Solution code:
def check_rate(r):
  for i,rate in enumerate(rates):
    if r < rate:
      return i

n=int(input())
a=list(map(int,input().split()))
rates=[400,800,1200,1600,2000,2400,2800,3200,float("inf")]
rates_cb=[False for _ in range(len(rates))]
wild=len(rates)-1
wild_c=0
for aa in a:
  r=check_rate(aa)
  if r == wild:
    wild_c+=1
  else:
    rates_cb[r]=True

base_col=rates_cb.count(True)
minc= max(1,base_col)
maxc=base_col+wild_c
print(minc,maxc)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
count = {i:0 for i in range(8)}
over = 0
for a in A:
    if a < 3200:
        count[a//400] = 1
    else:
        over += 1
hp = sum(count.values())
print(hp + int(hp == 0), hp + over)