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

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

Submission status: Wrong Answer

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

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

cnt_min = color.count(1)
if cnt_min == 0:
  cnt_min = 1
  cnt_max = min(cnt3200, 8)
else:
  cnt_max = min(cnt_min + cnt3200, 8)

print(cnt_min, cnt_max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)
minAns = len(set(list_under_3200))
print(minAns, maxAns)

Submission status: Wrong Answer

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, min(a+other, 8))
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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:
    print(len(dic),len(dic)+over)
else:
    print(len(dic),len(dic))

Submission status: Wrong Answer

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)+over>8:
        print(len(dic),8)
    else:
        print(len(dic),len(dic)+over)
else:
    print(len(dic),len(dic))

Submission status: Wrong Answer

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(min(1, lc), lc + free)

Submission status: Wrong Answer

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(lc, lc + free)

Submission status: Wrong Answer

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(lc, min(8, lc + free))

Submission status: Wrong Answer

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

free = 0
colors = {}

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

    else:
        free += 1

print(min(8, len(colors)), min(8, len(colors) + free))

Submission status: Wrong Answer

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

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


print(min_num,max_num)

Submission status: Wrong Answer

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

print(min_num,max_num)

Submission status: Wrong Answer

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 = a+b+c+d+e+f+g+h
max_num = min(min_num + z,8)
min_num = max(1, min_num)

print(min_num,max_num)

Submission status: Wrong Answer

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 = a+b+c+d+e+f+g+h
if min_num == 0:
    min_num = 1

max_num = min(min_num + z,8)

print(min_num,max_num)

Submission status: Wrong Answer

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

w = []
num = 0
for i in a:
    print(i)
    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: Wrong Answer

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
print(len(w), len(w)+num)

Submission status: Wrong Answer

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 8 < num + len(w):
    print(len(w),8)
else:
    print(len(w), len(w)+num)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    A = list(map(int, input().split()))
    ll = [0] * 8
    cnt = 0
    for i in range(n):
        if 3200 <= A[i]:
            cnt += 1
            continue
        ll[A[i] // 400] += 1
    aMin = max((8 - ll.count(0)), 1)
    aMax = aMin + cnt
    print(aMin, aMax)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    A = list(map(int, input().split()))
    ll = [0] * 8
    cnt = 0
    for i in range(n):
        if 3200 <= A[i]:
            cnt += 1
            continue
        ll[A[i] // 400] += 1
    aMin = max((8 - ll.count(0)), 1)
    aMax = min(8, aMin + cnt)
    print(aMin, aMax)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    A = list(map(int, input().split()))
    ll = [0] * 8
    cnt = 0
    for i in range(n):
        if 3200 <= A[i]:
            cnt += 1
            continue
        ll[A[i] // 400] += 1
    aMin = 8 - ll.count(0)
    aMax = min(8, aMin + cnt)
    print(aMin, aMax)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
cnt = []
for i in range(n):
    if 1 <= a[i] and a[i] <= 399:
        cnt.append(1)
    elif 400 <= a[i] and a[i] <= 799:
        cnt.append(2)
    elif 800 <= a[i] and a[i] <= 1199:
        cnt.append(3)
    elif 1200 <= a[i] and a[i] <= 1599:
        cnt.append(4)
    elif 1600 <= a[i] and a[i] <= 1999:
        cnt.append(5)
    elif 2000 <= a[i] and a[i] <= 2399:
        cnt.append(6)
    elif 2400 <= a[i] and a[i] <= 2799:
        cnt.append(7)
    elif 2800 <= a[i] and a[i] <= 3199:
        cnt.append(8)
    else:
        cnt.append(9)
over = cnt.count(9)
cntset = list(set(cnt))
if over == 0:
    print(str(len(cntset)) + " " + str(len(cntset)))
else:
    print(str(len(cntset)-1) + " " + str(len(cntset)-1+over))

Submission status: Wrong Answer

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
print(len(ans), cnt)

Submission status: Wrong Answer

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 cnt < 8:
  print(len(ans), cnt)
else:
  print(len(ans), 8)

Submission status: Wrong Answer

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 cnt < 7:
  print(len(ans), cnt)
else:
  print(len(ans), 7)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(lambda x: 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: Wrong Answer

Solution code:
n = int(input())
a = list(map(lambda x: 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(c, c+cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]
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: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]
for ai in a:
  if ai <= 3199:
    rnk = ai // 400
    color[rnk] += 1
  else:
    color[8] += 1
max_color = sum(color)
color2 = color[:8]
min_color = sum(color2)
print(min_color,max_color)

Submission status: Wrong Answer

Solution code:
n=int(input())
a= list(map(int, input().strip().split()))
if max(a)<=3199:
    for i in range(n):
        a[i]=a[i]//400
    a=list(set(a))
    print(len(a),len(a))
else:
    b=[]
    a.sort()
    for i in range(n):
        if a[i]>3199:
            f=i
            break
    jiyuu=n-f
    del a[f:n]
    for i in range(f):
        a[i]=a[i]//400
    a=list(set(a))
    l=len(a)
    print(l,min(l+jiyuu,8))

Submission status: Wrong Answer

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(min(mm,1),min(N,mm+o))

Submission status: Wrong Answer

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,min(N,mm+o))

Submission status: Wrong Answer

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,min(100,mm+o))

Submission status: Wrong Answer

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])
mx=mm+o
print(mm,mx)

Submission status: Wrong Answer

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(len(count),len(count)+count3200)

Submission status: Wrong Answer

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, 9)
print(m, M)

Submission status: Wrong Answer

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, 8)
print(m, M)

Submission status: Wrong Answer

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(m + any, 8)
print(m, M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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
    mini_ans = ans
    
    max_ans = min(8, ans + CTR_colors[8])

else:
    mini_ans, max_ans = ans, ans

print(mini_ans, max_ans)

Submission status: Wrong Answer

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(len(rate), len(rate) + top))
    
    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

rate_list = [0] * 8
s = 0

for rate in a:
    rate //= 400
    if rate < 8:
        rate_list[rate] += 1
    else:
        s += 1

cnt = 0

for i in rate_list:
    if i > 0:
       cnt += 1

mini = 1
maxi = 8

mini = max(mini, cnt)
maxi = min(maxi, cnt + s)

print(mini, maxi)

Submission status: Wrong Answer

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)), min(8, len(s) + cnt))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

rate_list = [0] * 9

for rate in a:
    rate //= 400
    if rate < 8:
        rate_list[rate] += 1
    else:
        rate_list[-1] += 1

cnt = 0
for i in rate_list[:8]:
    if i > 0:
       cnt += 1

mini = 1
maxi = 8

if cnt > 0:
    mini = cnt

if cnt + rate_list[-1] < 8:
    maxi = cnt + rate_list[-1]

print(mini, maxi)

Submission status: Wrong Answer

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
if al+cl>=8:
  ma=8
else:
  ma=al+cl
print(mi,ma)

Submission status: Wrong Answer

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
        continue
    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(len(d), len(d)+over)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
g=[0 for i in range(9)]
for a in A:
    for i in range(8):
        if 400*i<=a and a<=399+400*i:
            g[i]=1
    if a>=3200:
        g[8]+=1
if sum(g[0:7])>=1:
    print(sum(g)-g[8],sum(g))
else:
    print(g[8],1)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
g=[0 for i in range(9)]
for a in A:
    for i in range(8):
        if 400*i<=a and a<=399+400*i:
            g[i]=1
    if a>=3200:
        g[8]+=1
if sum(g[0:8])>=1:
    print(sum(g)-g[8],sum(g))
else:
    print(g[8],1)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
g=[0 for i in range(9)]
for a in A:
    for i in range(8):
        if 400*i<=a and a<=399+400*i:
            g[i]=1
    if a>=3200:
        g[8]+=1
print(g)
print(sum(g)-g[8],sum(g))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
g=[0 for i in range(9)]
for a in A:
    for i in range(8):
        if 400*i<=a and a<=399+400*i:
            g[i]=1
    if a>=3200:
        g[8]+=1
if g[8]>=1:
    print(sum(g)-g[8],sum(g))
else:
    print(sum(g),sum(g))

Submission status: Wrong Answer

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())
p=1 if v<f else 0
min_=v+p if v+p<=8 else v
max_=v+f if v+f<=8 else 8
print(min_,max_)

Submission status: Wrong Answer

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())
p=1 if v<f else 0
if v+p>8:
    p=0
if v+f>8:
    f=0
print(v+p,v+f)

Submission status: Wrong Answer

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())
p=1 if v<f else 0
print(v+p,v+f)

Submission status: Wrong Answer

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
    else:
        f+=1
v=sum(d.values())
p=1 if v<f else 0
print(v+p,v+f)

Submission status: Wrong Answer

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

min_count, max_plus_count = 0, 0
count_rate = []
for i in a:
    is_rate = i // 400
    if is_rate < 8:
        if is_rate not in count_rate:
            min_count += 1
            count_rate.append(is_rate)
    else:
        max_plus_count += 1

print(max(1, min_count), min(8, min_count + max_plus_count))

Submission status: Wrong Answer

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

result_min, result_max = 0, 0
count_rate = []
for i in a:
    is_rate = i // 400
    if is_rate < 8:
        if is_rate not in count_rate:
            result_min += 1
            result_max += 1
            count_rate.append(is_rate)
    else:
        if len(count_rate) < 8:
            result_max += 1
            count_rate.append(is_rate)
if result_min == 0:
    result_min += 1
print(result_min, result_max)

Submission status: Wrong Answer

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
min_c = sum(cnt)

print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = list(map(int, input().split()))
mx = 0
mn = 0
d = {}
colors = ["gray", "brown", "green", "cyan", "blue", "yellow", "orange", "red"]
for i in colors:
  d[i] = 0
for i in arr:
  if i in range(1, 400):
    if d["gray"] == 0:
      mx += 1
      mn += 1
    d["gray"] = 1
  elif i in range(400, 800):
    if d["brown"] == 0:
      mx += 1
      mn += 1
    d["brown"] = 1
  elif i in range(800, 1200):
    if d["green"] == 0:
      mx += 1
      mn += 1
    d["green"] = 1
  elif i in range(1200, 1600):
    if d["cyan"] == 0:
      mx += 1
      mn += 1
    d["cyan"] = 1
  elif i in range(1600, 2000):
    if d["blue"] == 0:
      mx += 1
      mn += 1
    d["blue"] = 1
  elif i in range(2000, 2400):
    if d["yellow"] == 0:
      mx += 1
      mn += 1
    d["yellow"] = 1
  elif i in range(2400, 2800):
    if d["orange"] == 0:
      mx += 1
      mn += 1
    d["orange"] = 1
  elif i in range(2800, 3200):
    if d["red"] == 0:
      mx += 1
      mn += 1
    d["red"] = 1
  elif i >= 3200:
    mx += 1
print(mx, mn)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = list(map(int, input().split()))
mx = 0
mn = 0
d = {}
colors = ["gray", "brown", "green", "cyan", "blue", "yellow", "orange", "red"]
for i in colors:
  d[i] = 0
for i in arr:
  if i in range(1, 400):
    if d["gray"] == 0:
      mx += 1
      mn += 1
    d["gray"] = 1
  elif i in range(400, 800):
    if d["brown"] == 0:
      mx += 1
      mn += 1
    d["brown"] = 1
  elif i in range(800, 1200):
    if d["green"] == 0:
      mx += 1
      mn += 1
    d["green"] = 1
  elif i in range(1200, 1600):
    if d["cyan"] == 0:
      mx += 1
      mn += 1
    d["cyan"] = 1
  elif i in range(1600, 2000):
    if d["blue"] == 0:
      mx += 1
      mn += 1
    d["blue"] = 1
  elif i in range(2000, 2400):
    if d["yellow"] == 0:
      mx += 1
      mn += 1
    d["yellow"] = 1
  elif i in range(2400, 2800):
    if d["orange"] == 0:
      mx += 1
      mn += 1
    d["orange"] = 1
  elif i in range(2800, 3200):
    if d["red"] == 0:
      mx += 1
      mn += 1
    d["red"] = 1
  else:
    mx += 1
print(mx, mn)