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: Runtime Error

Solution code:
n = int(input())
rate = list(map(int,input().split()))
ratecolor = 0
free = 0
ratecolor = 0
color = [0]*9
for i in range(n):
    for j in range(13):
        if(rate[i] < j*400 + 400):
            if(rate[i] >= 3200):
                free += 1
                break
            if(color[j] == 0 and rate[i] < 3200):
                color[j] += 1
                ratecolor += 1
                break

print(ratecolor if ratecolor != 0 else 1,ratecolor+free)

Submission status: Runtime Error

Solution code:
#
# abc064 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2100 2500 2700 2700"""
        output = """2 2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1100 1900 2800 3200 3200"""
        output = """3 5"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990"""
        output = """1 1"""
        self.assertIO(input, output)


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

    C = [0] * 9
    for a in A:
        for i in range(8):
            if 400*i <= a <= 400*i+399:
                C[i] = 1
                break
        else:
            C[8] += 1

    print(f"{max(1, C[:8].count(1))} {C[:8].count(1)+C[8])}")


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
rate = {"a":0, "b":0, "c":0, "d":0, "e":0, "f":0, "g":0, "h":0}
ratez = {"z":0}
for i in range(N):
    if A[i] >=1 and A[i] <= 399:
        rate["a"] += 1
    if A[i] >=400 and A[i] <= 799:
        rate["b"] += 1
    if A[i] >=800 and A[i] <= 1199:
        rate["c"] += 1
    if A[i] >=1200 and A[i] <= 1599:
        rate["d"] += 1
    if A[i] >=1600 and A[i] <= 1999:
        rate["e"] += 1
    if A[i] >=2000 and A[i] <= 2399:
        rate["f"] += 1
    if A[i] >=2400 and A[i] <= 2799:
        rate["g"] += 1
    if A[i] >=2800 and A[i] <= 3199:
        rate["h"] += 1
    if A[i] >=3200:
        ratez["z"] += 1
keys = [k for k, v in rate.items() if v != 0]

if ratez["z"] == 0:
    print(len(keys), len(keys))
elif len(keys) == 8:
    print(8, 8)
elif ratez["z"] <= len(keys) and len(keys) != 8:
    print(len(keys), len(keys)+ratez["z"])
elif ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) <= 8:
    print(rate["z"], len(keys)+ratez["z"])
elif ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) > 8 and ratez["z"] <= 8:
    print(rate["z"], 8)
elif ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) > 8 and ratez["z"] > 8:
    print(8, 8)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def cin():  return list(map(int,input().split()))

N = cin()[0]
a = cin()
b = [0 for _ in range(9)]
for i in range(N):
    ind = min(8, a[i] // 400)
    if ind <= 7:  b[ind] = 1
    else:  b[ind] += 1
ma = sum(b)
if cnt == N:  mi = sum(b[:-1])
else:  mi = 1
print(mi, ma)

Submission status: Runtime Error

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

rate=[0]*9
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i < 400*j:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.counta(1)
ansmax = rate.count(1)
if ansmin == 0:
  ansmin=1

if over > 0:
  ansmax = ansmax + over
    
#print(rate,over)
print(ansmin, ansmax)

Submission status: Runtime Error

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: Runtime Error

Solution code:

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

color=[]
free=0
count=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+count>8:
    Mans=8
else:
    Mans=count+free
    
print(Sans,Mans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
N = int(input())
a = list(map(int, input().split()))

c = [0] * 9
for i in a:
    c[i // 400] += + 1

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

ans_max = ans_min
if c[-1] == 0:
    pass
else:
    f = c[-1]
    g = c.count(0)
    ans_max += min(f, g)

print(ans_min, ans_max)

Submission status: Runtime Error

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)),min(sum(is_alive)+count_over))

Submission status: Runtime Error

Solution code:
import collections
n = int(raw_input())


def f(ais):
	extra = 0
	cc = collections.Counter()
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
	else:
		extra +=1
	print min(cc.values()), max(cc.values()) + extra
f(map(int, raw_input().split()))

Submission status: Runtime Error

Solution code:

import collections
n = int(raw_input())


def f(ais):
	extra = 0
	cc = collections.Counter()
	for ai in ais:
		if ai/400 < 8:
		cc[ai/400] +=1
	else:
		extra +=1
	print min(cc.values()), max(cc.values()) + extra
f(map(int, raw_input().split()))

Submission status: Runtime Error

Solution code:

import collections
n = int(raw_input())


def f(ais):
	extra = 0
	cc = collections.Counter()
	for ai in ais:
		if ai/400 < 8:
		cc[ai/400] +=1
	else:
		extra +=1
	print min(cc.values()), max(cc.values()) + extra

Submission status: Runtime Error

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(min_num + z)
min_num = max(1, min_num)

print(min_num,max_num)

Submission status: Runtime Error

Solution code:
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: Runtime Error

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 = min(sum(color) + any)
print(m, M)

Submission status: Runtime Error

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

colors = [0] * 9

for a in A:
    colors[a // 400] += 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]
print(ans, max_ans)

Submission status: Runtime Error

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

num_free = 0
num_color = [False] * 8
for rate in nums:
    if rate < 3200:
        num_color(rate // 400) = True
    else:
        num_free += 1

ans = sum(num_color)
print('{} {}'.format(ans, ans + num_free))

Submission status: Runtime Error

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


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

min = len(list)


if list[8] > 0:
    max = len(list) + chin
else:
    max = len(list)

print(min,max)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = [0] * 9
 
for i in range(n):
    t[a[i] // 400] += 1
 
z = t.pop(8)
p = t.count(0)
amax = min(8,8-p+z)
if p == 8:
    amin = 1
else:
    amin = 8 - p

print(amin,amax)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
N = int(input())
al = list(map(int,input().split()))
cnt = 0
dic = defaultdict(int)
for i in al:
    if 1<= i <= 399:
        dic['gray'] += 1
    elif 400 <= i <= 799:
        dic['brown'] += 1
    elif 800 <= i <= 1199:
        dic['green'] += 1
    elif 1200 <= i <= 1599:
        dic['cyan'] += 1
    elif 1600 <= i <= 1999:
        dic['blue'] += 1
    elif 2000 <= i <= 2399:
        dic['yellow'] += 1
    elif 2400 <= i <= 2799:
        dic['orange'] += 1
    elif 2800 <= i <= 3199:
        dic['red'] += 1
    else:
        cnt += 1


ansmax = len(dic.keys()) + cnt
if ansmax > n:
    ansmax = n


ansmin = len(dic.keys())
if ansmin == 0 and cnt >= 1:
    ansmin = 1

print(ansmin,ansmax)

Submission status: Runtime Error

Solution code:
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()
    
    n = int(input())
    a =list(map(int, input().split()))
    rate = [0]*8
    cnt = 0
    for x in a:
        r = x//400
        if r > 7:
            cnt += 1
        if not rate[r]:
            rate[r] = 1
    s = sum(rate)
    mins = s+max(0, cnt-s)
    maxs = s+cnt
    print(mins, maxs)        
        
            



if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
la = [int(w) for w in input().split()]

cnt = [0]*9
for a in la:
    cnt[a // 400] += 1

mi = len([_ for _ in cnt[:8] if _ > 0])
ma = mi+cnt[8]

print(mi, ma)

Submission status: Runtime Error

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

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if 3200 <= a:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

MIN >= 1:
    print(MIN, (MIN+H))
MIN = 0:
    print(1, H)

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    As = list(map(int, input().split()))
    nums = []
    rainbow = 0
    for A in As:
        num = A // 400
        if num < 8:
            if num not in nums:
                nums.append(num)
        else:
            rainbow += 1
    ans_max = len(nums)+rainbow
    ans_min = max(len(1, nums))
    print(ans_min, ans_max)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

for i in range(N):
  aa = int(A[i] / 400)
  ans[aa] += 1
  
min_a = 0
max_a = 0
for i in range(9):
  if i != 8:
    if ans[i] != 0:
      min_a += 1
      max_a += 1
  else:
    max_a += ans[i]
    
print(min_a, max_a)

Submission status: Runtime Error

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

color = [0]*9
cnt = 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:
        cnt += 1
        mi = cnt
if cnt != 8:
    cnt += color[8]
    if cnt > 8:
        cnt = 8

print(str(mi) + " " + str(cnt))

Submission status: Runtime Error

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

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(max(1,ans)) + ' ' + str(ans+count_list[-1]))

Submission status: Runtime Error

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

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(max(1,ans)) + ' ' + str(ans+count_list[-1]))

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int, input().split()))
col=[0]*9
for i in range(n):
    col[a[i]//400]+=1
zero=0
cnt=0
for c in range(len(col)-1):
    if col[c]==0:
        zero+=1
    else:
        cnt+=1
m=max(cnt,1)
M=cnt+min(zero,col[-1])
print(m,M)

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int,input().split()))
color = [False]*8
over_human = 0
for i in a:
    if(i<=399):
        color[0]=True
    elif(i<=799):
        color[1]=True
    elif(i<=1199):
        color[2]=True
    elif(i<=1599):
        color[3]=True
    elif(i<=1999):
        color[4]=True
    elif(i<=2399):
        color[5]=True
    elif(i<=2799):
        color[6]=True
    elif(i<=3199):
        color[7]=True
    elif(i>=3200):
        over_human += 1
if(color.count(True)==0):
    print(1,color.count(True)+over_human))
else:
    print(color.count(True),color.count(True)+over_human))

Submission status: Runtime Error

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

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

number_min = lank.count(1)
number_max = lank.count(1) + lank.count(2)

print(number_min, number_max)

Submission status: Runtime Error

Solution code:
n = int(input())
A = map(int, input().split())
rate = [0] * 9
for a in A:
    rate[a // 400] += 1
color_min = 8 - rate[:-1].count(0)
color_max = color_min + (min(rate[-1], rate[:-1].count(0)) if rate[-1] > 0 else 0)
print(color_min, color_max)

Submission status: Runtime Error

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

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = 0
p = flag.count(True)
if p > 0: minNum = p
elif p == 0 and t > 0:
  minNum = 1
  
maxNum = 0
if minNum < 8:
  maxNum = min(8, minNum + t)
else: maxNum = minNUm

print(minNum,maxNum)

Submission status: Runtime Error

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

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = 0
p = flag.count(True)
if p > 0: minNum = p
elif p == 0 and t > 0:
  minNum = 1
  t -= 1
  
maxNum = 0
if minNum < 8:
  maxNum = min(8, minNum + t)
else: maxNum = minNUm

print(minNum,maxNum)

Submission status: Runtime Error

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

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = flag.count(True)
maxNum = 0
if minNum < 8:
  maxNum = min(8, minNum + t)
else: maxNum = minNUm

print(minNum,maxNum)

Submission status: Runtime Error

Solution code:
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

rate = [0]*9
n = readInt()
a = readInts()

for i in a:
	rate[i//400]+=1

print(8-rate[:-1].count(0),end=" ")
print(min(9,(8-rate[:-1].count(0))+rate[-1]))

Submission status: Runtime Error

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

for r in a:
  x=r//400
  if x>8:
    x==8
  c[x]+=1
ans=0
for i in range(9):
  if i==8:
    if ans==0:
      mn=1
      mx=n
    else:
      mn=ans
      mx=ans+c[i]
  if c[i]!=0:
    ans+=1

print("{} {}".format(mn,mx))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

col = [0 for _ in range(9)]
for a in A:
  if a >= 3200:
    col[8] += 1
  col[a//400] += 1
print(sum(col[:-1]), sum(col))

Submission status: Runtime Error

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

cnt = [0 for i in range(8)]
count = 0

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

ans_min = len([s for s in cnt if s != 0])
ans_max = ans_min + count

print("{} {}".format(max(1,ans_min), min(8,ans_max))

Submission status: Runtime Error

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

cnt = [0 for i in range(8)]
count = 0

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


ans_min = len([s for s in cnt if s != 0])

if ans_min == 0 and count >0:
    ans_min = 1
    ans_max = ans_min + count
else:
    if ans_max > 8:
        ans_max = 8

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
A = [0 for i in range(8)]
b = 0
ans1 = 0
for i in range(N):
  if a[i] < 400:
    if A[0] == 0:
      A[0] = 1
      ans1 += 1
    else:
      continue
  elif a[i] < 800:
    if A[1] == 0:
      A[1] = 1
      ans1 += 1
    else:
      continue
  elif a[i] < 1200:
    if A[2] == 0:
      A[2] = 1
      ans1 += 1
    else:
      continue
  elif a[i] < 1600:
    if A[3] == 0:
      A[3] = 1
      ans1 += 1
    else:
      continue
  elif a[i] < 2000:
    if A[4] == 0:
      A[4] = 1
      ans1 += 1
    else:
      continue
  elif a[i] < 2400:
    if A[5] == 0:
      A[5] = 1
      ans1 += 1
    else:
      continue
  elif a[i] < 2800:
    if A[6] == 0:
      A[6] = 1
      ans1 += 1
    else:
      continue
  elif a[i] < 3200:
    if A[7] == 0:
      A[7] = 1
      ans += 1
    else:
      continue
  else:
    b += 1
ans2 = ans1 + b
if ans1 < 1:
  ans1 = 1
  ans2 = b
if ans2 > 8:
  ans2 = 8
print(ans1, ans2, sep=' ')

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
A = [0 for i in range(8)]
b = 0
ans1 = 0
for i in range(N):
  if a[i] < 400:
    if A[0] == 0:
      A[0] = 1
      ans1 += 1
  elif a[i] < 800:
    if A[1] == 0:
      A[1] = 1
      ans1 += 1
  elif a[i] < 1200:
    if A[2] == 0:
      A[2] = 1
      ans1 += 1
  elif a[i] < 1600:
    if A[3] == 0:
      A[3] = 1
      ans1 += 1
  elif a[i] < 2000:
    if A[4] == 0:
      A[4] = 1
      ans1 += 1
  elif a[i] < 2400:
    if A[5] == 0:
      A[5] = 1
      ans1 += 1
  elif a[i] < 2800:
    if A[6] == 0:
      A[6] = 1
      ans1 += 1
  elif a[i] < 3200:
    if A[7] == 0:
      A[7] = 1
      ans += 1
  elif a[i] >= 3200:
    b += 1
ans2 = ans1 + b
if ans1 < 1:
  ans1 = 1
  ans2 = b
if ans2 > 8:
  ans2 = 8
print(ans1, ans2, sep=' ')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = map(int, input().split())
c = [0]*9

for i in a:
    col = i//400
    if 4800<= i:
        c[8] += 1
    else:
        c[col] = 1
print(max(1,sum(c[:8])),sum(c))

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    rate_count = [0] * 9
    a = tuple(map(int, input().split()))
    for ae in a:
        rank = ae // 400
        rate_count[rank] += 1

    reds =  rate_count[8]
    rate_count[8] = 0
    res = 0
    for i1 in range(8):
        res += rate_count[i1] > 0
    r_min = max(res, 1)
    r_max = min(8, res + reds)
    print(r_min, r_max)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    rate_count = [0] * 9
    a = tuple(map(int, input().split()))
    for ae in a:
        rank = ae // 400
        rate_count[rank] += 1

    reds =  rate_count[8]
    rate_count[8] = 0
    rc2 = [1 for rce in rate_count if rce > 0]
    res = sum(rc2)
    r_min = max(res, 1)
    r_max = min(8, res + reds)
    print(r_min, r_max)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

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

## Logic

ans = [0,0,0,0,0,0,0,0]
tmp = 0

for i in A:
    if A[i] >= 3200:
        tmp += 1
    else:
        ans[A[i]//400] = 1

print(max(1,sum(ans)),min(8,sum(ans)+tmp))

Submission status: Runtime Error

Solution code:
ans = [0]*8
leng = 0

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

maxi = sum(ans)+leng
mini = sum(ans)

if sum(ans)+leng >= 8:
    maxi = 8
if sum(ans) < 1:
    mini = 1

print(mini, maxi)

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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

    Color = [0] * 9
    for a in A:
        if a >= 3200:
            Color[-1] += 1
        else:
            Color[a // 400] = 1

    mi = sum(Color[:8]) + (1 if sum(Color[:8]) == 0 and Color[9] > 0 else 0)
    ma = sum(Color[:8]) + Color[8]

    print(mi, ma)


if __name__ == '__main__':
    resolve()

Submission status: Runtime Error

Solution code:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    check[tar] += 1

checkA = np.array(check[:8])
num = np.count_nonzero(checkA != 0)
rest = 8 - num

if (rest > check[8]):
    more = num + check[8]
else:

    more = 8


print(num, more)

Submission status: Runtime Error

Solution code:
n = int(input())

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

l = [0]*9

for i in a:
    
    l[i//400] +=1

b = [i for i in l[:8] if i > 0]

mx = len(b)+l[8]
mn = len(b)
print(mn,mx)

Submission status: Runtime Error

Solution code:
def judge_color(n):
  if 1 <= n <= 399:
    return "gray"
  elif 400 <= n <= 799:
    return "brown"
  elif 800 <= n <= 1199:
    return "green"
  elif 1200 <= n <= 1599:
    return "sky"
  elif 1600 <= n <= 1999:
    return "blue"
  elif 2000 <= n <= 2399:
    return "yellow"
  elif 2400 <= n <= 2799:
    return "orange"
  elif 2800 <= n <= 3199:
    return "red"
  else:
    return "free"

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

d = {}
for each in a:
  color = judge_color(each)
  d[color] = d.get(color, 0) + 1
  
c = d.get("free",0)
l = len(d)
if c == 0:
  print(l, l)
else:
  print(max(l-1,1) l-1+c)

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))

if len(set(s_a)) + len(b_a) <= :
    max = len(set(s_a)) + len(b_a)
else:
    max = 7

print(min, max)

Submission status: Runtime Error

Solution code:
# ABC064
# C
# Colorful Leaderboard

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

color_list = [0]*8
over = 0
for i in range(n):
    _ = a_list[i] // 400
    if _ < 8:
        color_list[_] = 1
    else:
        over += 1

_tmp = sum(color_list)
if _tmp == 0:
    print("1 %d"%_over)
else:
    print("%d %d"%(_tmp, _tmp+over))

Submission status: Runtime Error

Solution code:
# ABC064
# C
# Colorful Leaderboard

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

color_list = [0]*8
over = 0
for i in range(n):
    _ = a_list[i] // 400
    if _ < 8:
        color_list[i] = 1
    else:
        over += 1

_tmp = sum(color_list)
print("%d %d"%(_tmp, _tmp+over))