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: Wrong Answer

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

m = color[:8].count(True)
M = m + color[8]
print(m, M)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
color = []
cnt = 0

for i in range(n):
    c = A[i]//400
    if c<=7:
        color.append(c)
    else:
        cnt += 1

diff = set(color)
minimum = max(len(diff),1)
maximum = min(8,len(diff)+cnt)

print(minimum, maximum)

Submission status: Wrong Answer

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

for k in range(1, 9):
    b = list(filter(lambda x: x < 400*k, a))
    if b:
        cnt += 1
    a = a[len(b):]
print(cnt, cnt+len(a))

Submission status: Wrong Answer

Solution code:
from sys import stderr, setrecursionlimit
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

n = getInt()
a = getInts()
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in a:
    if rate <= 399:
        colors[0] += 1
    elif rate <= 799:
        colors[1] += 1
    elif rate <= 1199:
        colors[2] += 1
    elif rate <= 1599:
        colors[3] += 1
    elif rate <= 1999:
        colors[4] += 1
    elif rate <= 2399:
        colors[5] += 1
    elif rate <= 2799:
        colors[6] += 1
    elif rate <= 3199:
        colors[7] += 1
    else:
        colors[8] += 1

monocolors = len(list(filter(lambda x:x!=0,colors[:-1])))
print(monocolors, monocolors + colors[8])

Submission status: Wrong Answer

Solution code:
from sys import stderr, setrecursionlimit
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

n = getInt()
a = getInts()
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in a:
    if rate <= 399:
        colors[0] += 1
    elif rate <= 799:
        colors[1] += 1
    elif rate <= 1199:
        colors[2] += 1
    elif rate <= 1599:
        colors[3] += 1
    elif rate <= 1999:
        colors[4] += 1
    elif rate <= 2399:
        colors[5] += 1
    elif rate <= 2799:
        colors[6] += 1
    elif rate <= 3199:
        colors[7] += 1
    else:
        colors[8] += 1

monocolors = len(list(filter(lambda x:x!=0,colors[:-1])))
print(monocolors, min(8, monocolors + colors[8]))

Submission status: Wrong Answer

Solution code:
def colormap(rate):
    if 1 <= rate < 400:
        return 0
    elif 400 <= rate < 800:
        return 1
    elif 800 <= rate < 1200:
        return 2
    elif 1200 <= rate < 1600:
        return 3
    elif 1600 <= rate < 2000:
        return 4
    elif 2000 <= rate < 2400:
        return 5
    elif 2400 <= rate < 2800:
        return 6
    elif 2800 <= rate < 3200:
        return 7
    elif 3200 <= rate:
        return -1


def solve():
    N = int(input())
    a = [int(x) for x in input().split()]

    colors = [colormap(x) for x in a]

    import collections
    count = collections.Counter(colors)
    # print(count)

    ncolor = len(count) - (-1 in count)

    nmin = 1 if ncolor == 0 else ncolor
    nmax = min(8, ncolor + count[-1])

    print(nmin, nmax)


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def colormap(rate):
    if 1 <= rate < 400:
        return 0
    elif 400 <= rate < 800:
        return 1
    elif 800 <= rate < 1200:
        return 2
    elif 1200 <= rate < 1600:
        return 3
    elif 1600 <= rate < 2000:
        return 4
    elif 2000 <= rate < 2400:
        return 5
    elif 2400 <= rate < 2800:
        return 6
    elif 2800 <= rate < 3200:
        return 7
    elif 3200 <= rate:
        return -1


def solve():
    N = int(input())
    a = [int(x) for x in input().split()]

    colors = [colormap(x) for x in a]

    import collections
    count = collections.Counter(colors)
    # print(count)

    ncolor = len(count) - (-1 in count)

    nmin = ncolor
    nmax = min(8, ncolor + count[-1])

    print(nmin, nmax)


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

se = set()
high = 0
for a in li:
    if a // 400 <= 7:
        se.add(a // 400)
    else:
        high += 1

print(len(se), len(se) + high)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
color = [False] * 8
over3200 = 0
for a in A:
    for i in range(8):
        if a < 400*i:
            color[i] = True
            break
    else:
        over3200 += 1
if sum(color):
    print(sum(color), end=' ')
    print(sum(color) + over3200)
else:
    print(1, end=' ')
    print(over3200)

Submission status: Wrong Answer

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

free = 0
colors = set()

for rate in rates:
    if rate in range(1, 400):
        colors.add('gray')
    elif rate in range(800):
        colors.add('brown')
    elif rate in range(1200):
        colors.add('green')
    elif rate in range(1600):
        colors.add('lightblue')
    elif rate in range(2000):
        colors.add('blue')
    elif rate in range(2400):
        colors.add('yellow')
    elif rate in range(2800):
        colors.add('orange')
    elif rate in range(3200):
        colors.add('red')
    elif 3200 <= rate:
        free += 1

max_num = min(len(colors) + free, 8)

if not colors and free > 0:
    colors.add('free')

print(len(colors), max_num)

Submission status: Wrong Answer

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

B = set()
crown = 0
for a in A:
    if a // 400 >= 8:
        crown += 1
    else:
        B.add(a // 400)

print(max(1, len(B)), min(8, len(B) + crown))

Submission status: Wrong Answer

Solution code:
A = [False] * 9 + [0]
n = int(input())
B = [int(i) for i in input().split()]

for i in B:
    if i < 1:
        A[0] = True
    elif i < 400:
        A[1] = True
    elif i < 800:
        A[2] = True
    elif i < 1200:
        A[3] = True
    elif i < 1600:
        A[4] = True
    elif i < 2000:
        A[5] = True
    elif i < 2400:
        A[6] = True
    elif i < 2800:
        A[7] = True
    elif i < 3200:
        A[8] = True
    else:
        A[9] += 1
        
ured = sum(A[0:9])
minc = (1 if ured == 0 else ured)
maxc = min(9, ured + A[9])
print(minc, maxc)

Submission status: Wrong Answer

Solution code:
A = [False] * 8 + [0]
n = int(input())
B = [int(i) for i in input().split()]

for i in B:
    if i < 400:
        A[0] = True
    elif i < 800:
        A[1] = True
    elif i < 1200:
        A[2] = True
    elif i < 1600:
        A[3] = True
    elif i < 2000:
        A[4] = True
    elif i < 2400:
        A[5] = True
    elif i < 2800:
        A[6] = True
    elif i < 3200:
        A[7] = True
    else:
        A[8] += 1
        
ured = sum(A[0:8])
minc = (1 if ured == 0 else ured)
maxc = min(9, ured + A[8])
print(minc, maxc)

Submission status: Wrong Answer

Solution code:
A = [False] * 8 + [0]
n = int(input())
B = [int(i) for i in input().split()]

for i in B:
    if i < 400:
        A[0] = True
    elif i < 800:
        A[1] = True
    elif i < 1200:
        A[2] = True
    elif i < 1600:
        A[3] = True
    elif i < 2000:
        A[4] = True
    elif i < 2400:
        A[5] = True
    elif i < 2800:
        A[6] = True
    elif i < 3200:
        A[7] = True
    else:
        A[8] += 1
        
ured = sum(A[0:8])
minc = (1 if ured == 0 else ured)
maxc = min(8, ured + A[8])
print(minc, maxc)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

COLORS = ["grey", "brown", "green", "sky", "blue", "yellow", "orange", "red"]

def main():
    n = int(input())
    an = list(map(int, input().split()))
    colors = [color(a) for a in an]
    mi = max(1, count_colors(colors))
    ma = min(count_colors(colors) + free_players(colors), len(COLORS))
    print(mi, ma)

def color(r):
    assert 1 <= r <= 4800
    if r < 400:
        return "grey"
    elif r < 800:
        return "brown"
    elif r < 1200:
        return "green"
    elif r < 1600:
        return "sky"
    elif r < 2000:
        return "blue"
    elif r < 2400:
        return "yellow"
    elif r < 2800:
        return "orange"
    elif r < 3200:
        return "red"
    else:
        return "free"

def count_colors(colors):
    res = set(colors)
    res -= {"free"}
    return len(res)

def free_players(colors):
    res = 0
    for c in colors:
        if c == "free":
            res += 1
    return res

main()

Submission status: Wrong Answer

Solution code:
colors = [0 for i in range(9)]

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

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

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

print("{} {}".format(min_color, min_color + colors[8]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
kind = 0
cnt = 0
used = [False]*8
for a in A:
    tmp = a//400
    if tmp < 8 and not used[tmp]:
        kind += 1
        used[tmp] = True
    elif tmp >= 8:
        cnt += 1
print(kind, kind+cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
kind = 0
cnt = 0
used = [False]*8
for a in A:
    tmp = a//400
    if tmp < 8 and not used[tmp]:
        kind += 1
        used[tmp] = True
    elif tmp >= 8:
        cnt += 1
print(kind, min(8, kind+cnt))

Submission status: Wrong Answer

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

for k in range(8):
    b = [i for i in a if 400*k <= i < 400*(k + 1)]
    if len(b) > 0:
        count += 1

if count > 0:
    print('{} {}'.format(count, count + min(8-count, len([i for i in a if 3200 <= i]))))
else:
    print('{} {}'.format(1, min(8, len([i for i in a if 3200 <= i]))))

Submission status: Wrong Answer

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

for k in range(9):
    b = [i for i in a if 400*(k -1) <= i < 400*k]
    if len(b) > 0:
        count += 1

print('{} {}'.format(count, count + min(8-count, len([i for i in a if 3200 <= i]))))

Submission status: Wrong Answer

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

for k in range(9):
    b = [i for i in a if 400*(k -1) <= i < 400*k]
    if len(b) > 0:
        print(k)
        count += 1

print('{} {}'.format(count, count + min(8-count, len([i for i in a if 3200 <= i]))))

Submission status: Wrong Answer

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

gray = [i for i in a if i < 400]
brown = [i for i in a if 400 <= i < 800]
green = [i for i in a if 800 <= i < 1200]
lblue = [i for i in a if 1200 <= i < 1600]
blue = [i for i in a if 1600 <= i < 2000]
yellow = [i for i in a if 2000 <= i < 2400]
orange = [i for i in a if 2400 <= i < 2800]
red = [i for i in a if 2800 <= i < 3200]
rainbow = [i for i in a if 3200 <= i]

color = [gray, brown, green, lblue, blue, yellow, orange, red]

for i in color:
    if len(i) > 0:
        count += 1

print('{} {}'.format(count, count + min(8-count, len(rainbow))))

Submission status: Wrong Answer

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

Ans = 0
Cnt = [0]*9
for i in range(N):
    if A[i]>3200:
        A[i] = 3200
    Cnt[A[i]//400] += 1

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

print(Ans, min(Ans+Cnt[8], 9))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[i for i in list(map(int,input().split()))if i<3200]
k=n-len(a)
c=0
for j in range(8):
    b=[i for i in a if (j)*400<=i and i<(j+1)*400]
    if len(b)>0:
        c+=1
print(str(c if c>0 else 1)+" "+str(min(8,k+c)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[i for i in list(map(int,input().split()))if i<3200]
p=len(a)
c=0
for j in range(8):
    b=[i for i in a if (j)*400<=i and i<(j+1)*400]
    if len(b)>0:
        c+=1
print(str(c)+" "+str(min(c+n-p,8))if c>n-p else str(c if c>0 else 1)+" "+str(min(8,n-p+1)))

Submission status: Wrong Answer

Solution code:
N = int(input())

A = [int(x) for x in input().split()]

s = set()
god = 0
for a in A:
    if a >= 3200:
        god += 1
    else:
        s.add(a // 400)

print("{} {}".format(max(len(s),1), min(len(s) + god, 8)))

Submission status: Wrong Answer

Solution code:
N = int(input())

A = [int(x) for x in input().split()]

s = set()
god = 0
for a in A:
    if a >= 3200:
        god += 1
    else:
        s.add(a//400)

print("{} {}".format(len(s), min(len(s)+god,8)))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
c=[0]*8
d=0
for a in A:
    if 1<=a<=399:c[0]=1
    elif 400<=a<=799:c[1]=1
    elif 800<=a<1199:c[2]=1
    elif 1200<=a<=1599:c[3]=1
    elif 1600<=a<=1999:c[4]=1
    elif 2000<=a<=2399:c[5]=1
    elif 2400<=a<=2799:c[6]=1
    elif 2800<=a<=3199:c[7]=1
    else:d+=1
if d>0 and sum(c)==0:e=1
else:e=0
print(sum(c)+e,sum(c)+d)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
c=[0]*8
d=0
for a in A:
    if 1<=a<=399:c[0]=1
    elif 400<=a<=799:c[1]=1
    elif 800<=a<1199:c[2]=1
    elif 1200<=a<=1599:c[3]=1
    elif 1600<=a<=1999:c[4]=1
    elif 2000<=a<=2399:c[5]=1
    elif 2400<=a<=2799:c[6]=1
    elif 2800<=a<=3199:c[7]=1
    else:d+=1
if d>0:e=1
else:e=0
print(sum(c)+e,sum(c)+d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ratings = list(map(int, input().split(" ")))
colors = [400*i for i in range(1, 9)]
flags = [False for i in range(8)]
over3200 = 0
for rate in ratings:
    for i, border in enumerate(colors):
        if rate < border:
            flags[i] = True
            break
        elif i == 7:
            over3200 += 1
minAns = 0
for f in flags:
    if f:
        minAns += 1
maxAns = minAns + over3200
print(minAns, maxAns)

Submission status: Wrong Answer

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

N = int(input())
nums = list(map(int, input().split()))
colors = [0]*9
mi = 0
ma = 0

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

for j in range(8):
    if colors[j] > 0:
        mi += 1
ma = mi
ma += colors[8]

print(mi, ma)

Submission status: Wrong Answer

Solution code:
import bisect
n = int(input())
a = sorted(list(int(i) for i in input().split()))
minct= 0
ov32 = n-bisect.bisect_left(a,3200)
#400で割る
def calc(n):
    return (n //400)
a2 = list(map(calc, a))
for i in range(8):
 if i in a2:
  minct +=1
minans = 0 
if minct == 0 and ov32>=1:
 minans =1
else:
 minans = minct
if minct+ov32>= 8:
 maxans =8
else:
 maxans =minct+ov32
print(*[minans,maxans])

Submission status: Wrong Answer

Solution code:
import bisect
n = int(input())
a = sorted(list(int(i) for i in input().split()))
minct= 0
ov32 = n-bisect.bisect_left(a,3200)
#400で割る
def calc(n):
    return (n //400)+1
a2 = list(map(calc, a))
for i in range(9):
 if i in a2:
  minct +=1
minans = 0 
if minct == 0 and ov32>=1:
 minans =1
else:
 minans = minct
if minct+ov32>= 8:
 maxans =8
else:
 maxans =minct+ov32
print(*[minans,maxans])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(int(i) for i in input().split())
color = []
for i in range(n):
    for j in range(8):
        if a[i]>=400*j and a[i]<400*(j+1):
            color.append(j)
            break
        elif a[i]>=3200:
            color.append(8)
            break

color_map = {}
for c in color:
    if not c in color_map.keys():
        color_map[c] = 1
    else:
        color_map[c] += 1

cmin = 0
cmax = 0
for k,v in color_map.items():
    if not k==8:
        cmin += 1
    else:
        cmax += v
cmax = cmin+cmax if cmax+cmin<8 else 8
if cmin==0:
    cmin = 1
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
#ABC064
n = int(input())
a = list(int(i) for i in input().split())
color = []
for i in range(n):
    for j in range(8):
        if a[i]>=400*j and a[i]<400*(j+1):
            color.append(j)
            break
        elif a[i]>=3200:
            color.append(8)
            break

color_map = {}
for c in color:
    if not c in color_map.keys():
        color_map[c] = 1
    else:
        color_map[c] += 1

cmin = 0
cmax = 0
for k,v in color_map.items():
    if not k==8:
        cmin += 1
    else:
        cmax += v
cmax = cmin+cmax if cmax+cmin<8 else 8
if cmin==0:
    cmin = 1
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
#ABC064
n = int(input())
a = list(int(i) for i in input().split())
color = []
for i in range(n):
    for j in range(8):
        if a[i]>=400*j and a[i]<400*(j+1):
            color.append(j)
            break
        elif a[i]>=3200:
            color.append(8)
            break

color_map = {}
for c in color:
    if not c in color_map.keys():
        color_map[c] = 1
    else:
        color_map[c] += 1

cmin = 0
cmax = 0
for k,v in color_map.items():
    if not k==8:
        cmin += 1
    else:
        cmax += v
cmax = cmin+cmax if cmax+cmin<8 else 8
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
#ABC064
n = int(input())
a = list(int(i) for i in input().split())
color = []
for i in range(n):
    for j in range(8):
        if a[i]>=400*j and a[i]<400*(j+1):
            color.append(j)
            break
        elif a[i]>=3200:
            color.append(8)
            break

color_map = {}
for c in color:
    if not c in color_map.keys():
        color_map[c] = 1
    else:
        color_map[c] += 1

cmin = 0
cmax = 0
for k,v in color_map.items():
    if not k==8:
        cmin += 1
    else:
        cmax += v
cmax = cmin+cmax if cmax+cmin<8 else 8
print(color)
print(color_map)
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
#ABC064
n = int(input())
a = list(int(i) for i in input().split())
color = []
for i in range(n):
    for j in range(8):
        if a[i]>=400*j and a[i]<400*(j+1):
            color.append(j)
            break
        elif a[i]>3200:
            color.append(8)

color_map = {}
for c in color:
    if not c in color_map.keys():
        color_map[c] = 1
    else:
        color_map[c] += 1

cmin = 0
cmax = 0
for k,v in color_map.items():
    if not k==8:
        cmin += 1
    else:
        cmax += v
cmax = cmin+cmax if cmax+cmin<8 else 8
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
rate = sorted(list(map(int,input().split())))
allcoder = 0
for i in range(N):
    if rate[i] > 3199:
        allcoder += 1
color = 0        
for i in range(8):
    if bisect.bisect_left(rate,i*400 if i>0 else 1) != bisect.bisect_right(rate,i*400+399) :
        color += 1
print(max(color,1),min(8,color+allcoder))

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
rate = sorted(list(map(int,input().split())))
allcoder = 0
for i in range(N):
    if rate[i] > 3199:
        allcoder += 1
color = 0        
for i in range(8):
    if bisect.bisect_left(rate,i*400) != bisect.bisect_right(rate,i*400+399) and color < 8:
        color += 1
print(max(color,1),min(8,color+allcoder))

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
rate = sorted(list(map(int,input().split())))
allcoder = 0
for i in range(N):
    if rate[i] > 3199:
        allcoder += 1
color = 0        
for i in range(8):
    if bisect.bisect_left(rate,i*400) != bisect.bisect_right(rate,i*400+399):
        color += 1
print(max(color,1),min(8,color+allcoder))

Submission status: Wrong Answer

Solution code:
print(8,8)

Submission status: Wrong Answer

Solution code:
print(8)

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
rate = sorted(list(map(int,input().split())))
allcoder = 0
for i in range(N):
    if rate[i] > 3199:
        allcoder += 1
color = 0        
for i in range(8):
    if bisect.bisect_left(rate,i*400) != bisect.bisect_right(rate,i*400+399):
        color += 1
print(color,min(8,color+allcoder))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0] * 9
for a in list(map(int, input().split())):
    A[min(a//400, 8)] += 1

ans = len(list(filter(lambda x: x>0, A[:-1])))

max_ans = max(1, min(ans+A[-1], 8))

if A[-1] > 0:
    min_ans = max(1, ans)
else:
    min_ans = ans
print(min_ans, end=" ")
print(max_ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
#print(n,a)

a.sort()

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

b=[a[i] for i in range(n) if a[i]>=3200]
    
print(sum(ansa),sum(ansa)+len(set(b)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
#print(n,a)

ansa=[0]*8
ansb=0
for i in range(n):
  if a[i]<400:
    ansa[0]=1
  elif a[i]<800:
    ansa[1]=1
  elif a[i]<1200:
    ansa[2]=1
  elif a[i]<1600:
    ansa[3]=1
  elif a[i]<2000:
    ansa[4]=1
  elif a[i]<2400:
    ansa[5]=1
  elif a[i]<2800:
    ansa[6]=1
  elif a[i]<3200:
    ansa[7]=1
  else:
    ansb+=1
    
print(sum(ansa),sum(ansa)+ansb)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0] * 9
for a in list(map(int, input().split())):
    A[min(a//400, 8)] += 1

ans = 0
for a in A[:-1]:
    ans += int(a>0)
max_ans = min(ans+A[-1], 8)

if A[-1] > 0:
    min_ans = max(1, ans)
else:
    min_ans = ans
print(min_ans, end=" ")
print(max_ans)

Submission status: Wrong Answer

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

c=[0 for i in range(8)]
r=0

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

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

if s==0:
    s=1
b=s+r


print(s,b)

Submission status: Wrong Answer

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

c=[0 for i in range(8)]
r=0

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

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

b=s+r


print(s,b)

Submission status: Wrong Answer

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

c=[0 for i in range(8)]
r=0

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

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

b=s+r
if b>=8:
    b=8

print(s,b)

Submission status: Wrong Answer

Solution code:
int_n = int(input())
arr_int_a = list(map(int, input().split()))
color_val = set([i // 400 for i in arr_int_a if i < 3200])

over = len([i for i in arr_int_a if i >= 3200])

min = len(color_val)
max = min + over if (min + over) <= 8 else 8

print(min,max)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(_) for _ in input().split()]
colors = [0] * 9
for a in A:
    c = a // 400
    if c < 8:
        colors[c] = 1
    else:
        colors[8] += 1
print(max(sum(colors[:8]), 1), min(sum(colors), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(_) for _ in input().split()]
colors = [0] * 9
for a in A:
    c = a // 400
    if c < 8:
        colors[c] = 1
    else:
        colors[8] += 1
print(max(sum(colors[:8]), 1), min(sum(colors[:8]) + colors[8], 8))

Submission status: Wrong Answer

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

mi = len(list(set(A))) - q

ma = mi + free
print(mi,ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

d = defaultdict(int)
for i in range(n):
    d[a[i]//400] += 1

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

print(min(8, count + d[8]), count)

Submission status: Wrong Answer

Solution code:
N = input()
A = map(lambda x: int(x)/400, raw_input().split())
S = set()
ans = 0
for a in A:
  if a <= 7:
    S.add(a)
  else:
    ans += 1
print ans + len(S)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
p = [0] * 8
q = 0
for i in a:
    if i // 400 >= 8:
        q += 1
    else:
        p[i//400] += 1
pp = 0
for qqqq in p:
    if qqqq != 0:
        pp += 1
print(pp, pp + q)

Submission status: Wrong Answer

Solution code:
import numpy as np
Level = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
N = int(input())
Point = [int(x) for x in input().split()]

def solve():
    count = np.zeros(len(Level), dtype=int)
    for p in Point:
        over3200 = True
        for i in range(1, len(Level)):
            if p<Level[i]: 
                count[i-1] += 1
                over3200 = False
                break
        if over3200: count[-1] += 1
#    print(count)
    colorCount = 0
    for i in range(len(count)-1): #3200点以上は除く
        if count[i]>0: colorCount += 1
    
    return max(colorCount, 1), min(colorCount + count[-1], len(Level) - 1)

#print(N)
#print(Point)
mi, ma = solve()
print(mi, ma)