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

l = [0]*9
for i in a:
    if 1<=i<=399:
        l[0] = 1
    elif 400<=i<=799:
        l[1] = 1
    elif 800<=i<=1199:
        l[2] = 1
    elif 1200<=i<=1599:
        l[3] = 1
    elif 1600<=i<=1999:
        l[4] = 1
    elif 2000<=i<=2399:
        l[5] = 1
    elif 2400<=i<=2799:
        l[6] = 1
    elif 2800<=i<=3199:
        l[7] = 1
    else:
        l[8] += 1
ls = l[:8]
if sum(l) >8:
    print(sum(ls), 8)
elif sum(ls) == 0:
    print(1, l[8])
else:
    print(sum(ls), sum(l))

Submission status: Wrong Answer

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

l = [0]*9
for i in a:
    if 1<=i<=399:
        l[0] = 1
    elif 400<=i<=799:
        l[1] = 1
    elif 800<=i<=1199:
        l[2] = 1
    elif 1200<=i<=1599:
        l[3] = 1
    elif 1600<=i<=1999:
        l[4] = 1
    elif 2000<=i<=2399:
        l[5] = 1
    elif 2400<=i<=2799:
        l[6] = 1
    elif 2800<=i<=3199:
        l[7] = 1
    else:
        l[8] += 1
ls = l[:8]
if sum(l) >8:
    print(sum(ls), 8)
else:
    print(sum(ls), sum(l))

Submission status: Wrong Answer

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

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

if sum(l) >8:
    print(sum(l)-l[8], 8)
else:
    print(sum(l)-l[8], sum(l))

Submission status: Wrong Answer

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

l = [0]*9
for i in a:
    if 1<=i<=399:
        l[0] = 1
    elif 400<=i<=799:
        l[1] = 1
    elif 800<=i<=1199:
        l[2] = 1
    elif 1200<=i<=1599:
        l[3] = 1
    elif 1600<=i<=1999:
        l[4] = 1
    elif 2000<=i<=2399:
        l[5] = 1
    elif 2400<=i<=2799:
        l[6] = 1
    elif 2800<=i<=3199:
        l[7] = 1
    else:
        l[8] += 1
print(sum(l)-l[8], sum(l))

Submission status: Wrong Answer

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

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

print(sum(x), sum(x)+god)

Submission status: Wrong Answer

Solution code:
n=input();a=sorted(map(int,input().split()))
result = []
free_color = 0
for i in a:
  if i < 400:
    result.append('灰色')
  elif i < 800:
    result.append('茶色')
  elif i < 1200:
    result.append('緑色')
  elif i < 1600:
    result.append('水色')
  elif i < 2000:
    result.append('青色')
  elif i < 2400:
    result.append('黄色')
  elif i < 2800:
    result.append('橙色')
  elif i < 3200:
    result.append('赤色')
  else:
    free_color += 1
print(1 if len(set(result))==0 else len(set(result)), 8 if len(set(result))+free_color > 8 else len(set(result))+free_color)

Submission status: Wrong Answer

Solution code:
n=input();a=sorted(map(int,input().split()))
result = []
free_color = 0
for i in a:
  if i < 400:
    result.append('灰色')
  elif i < 800:
    result.append('茶色')
  elif i < 1200:
    result.append('緑色')
  elif i < 1600:
    result.append('水色')
  elif i < 2000:
    result.append('青色')
  elif i < 2400:
    result.append('黄色')
  elif i < 2800:
    result.append('橙色')
  elif i < 3200:
    result.append('赤色')
  else:
    free_color += 1
print(len(set(result)), 8 if len(set(result))+free_color >= 8 else len(set(result))+free_color)

Submission status: Wrong Answer

Solution code:
n=input();a=sorted(map(int,input().split()))
result = []
free_color = 0
for i in a:
  if i < 400:
    result.append('灰色')
  elif i < 800:
    result.append('茶色')
  elif i < 1200:
    result.append('緑色')
  elif i < 1600:
    result.append('水色')
  elif i < 2000:
    result.append('青色')
  elif i < 2400:
    result.append('黄色')
  elif i < 2800:
    result.append('橙色')
  elif i < 3200:
    result.append('赤色')
  else:
    free_color += 1
print(len(set(result)), 8 if len(set(result))+free_color > 8 else len(set(result))+free_color)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
color=[0]*9
ac=0
for i in range(N):
    rate=min(a[i]//400,8)
    color[rate]+=1
for i in range(8):
    if color[i]>=1:
        ac+=1
min_ans=max(ac,1)
max_ans=min(8,ac+color[8])
print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
color=[0]*9
ac=0
for i in range(N):
    rate=min(a[i]//400,8)
    color[rate]+=1
for i in range(8):
    if color[i]>=1:
        ac+=1
min_ans=max(ac,color[8])
max_ans=min(8,ac+color[8])
print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
color=[0]*9
ac=0
for i in range(N):
    rate=min(a[i]//400,8)
    color[rate]+=1
for i in range(8):
    if color[i]>=1:
        ac+=1
min_ans=min(ac,color[8])
max_ans=min(8,ac+color[8])
print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
color=[0]*9
ac=0
for i in range(N):
    rate=min(a[i]//400,8)
    color[rate]+=1
for i in range(8):
    if color[i]>=1:
        ac+=1
if ac<color[8]:
    min_ans=color[8]
else:
    min_ans=ac
max_ans=min(8,ac+color[8])
print(min_ans,max_ans)

Submission status: Wrong Answer

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

b=[0,0,0,0,0,0,0,0]
cnt=0

for i in range(n):
    if a[i]//400==0:
        b[0]+=1
    if a[i]//400==1:
        b[1]+=1
    if a[i]//400==2:
        b[2]+=1
    if a[i]//400==3:
        b[3]+=1
    if a[i]//400==4:
        b[4]+=1
    if a[i]//400==5:
        b[5]+=1
    if a[i]//400==6:
        b[6]+=1
    if a[i]//400==7:
        b[7]+=1
    if a[i]//400>=8:
        cnt+=1
    
print(len(b)-b.count(0),len(b)-b.count(0)+cnt)

Submission status: Wrong Answer

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

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

if cnt.count(0) == 8 and count > 0:
    ans_min = 1
else:
    ans_min = len([s for s in cnt if s != 0])

ans_max = ans_min + count
if ans_max > 8:
    ans_max = 8
else:
    pass

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

Submission status: Wrong Answer

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

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
if ans_min == 0 and count >0:
    ans_min = 1
else:
    if ans_max > 8:
        ans_max = 8

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

Submission status: Wrong Answer

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(ans_min, ans_max))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
C = [a//400 for a in A if a<3200]
M = len(set(C))
print(max(1,M),min(8,M+N-len(C)))

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()
# print(a)
tmp = []
for i in range(n):
    if 1 <= a[i] and a[i] <= 399:
        tmp.append('ha')
    if 400 <= a[i] and a[i] <= 799:
        tmp.append('cha')
    if 800 <= a[i] and a[i] <= 1199:
        tmp.append('mi')
    if 1200 <= a[i] and a[i] <= 1599:
        tmp.append('mizu')
    if 1600 <= a[i] and a[i] <= 1999:
        tmp.append('ao')
    if 2000 <= a[i] and a[i] <= 2399:
        tmp.append('ki')
    if 2400 <= a[i] and a[i] <= 2799:
        tmp.append('da')
    if 2800 <= a[i] and a[i] <= 3199:
        tmp.append('aka')
    if 3200 <= a[i]:
        tmp.append('nanndemo')
# print(tmp)
z = 0
for i in range(len(tmp)-1):
    if tmp[i] == tmp[i+1]:
        z += 1
if z == len(tmp)-1:
    print(1, len(tmp))
    exit()

cnt = 0
tmp2 = list(set(tmp))
for i in range(len(tmp2)):
    if tmp2[i] != 'nanndemo':
        cnt += 1
min_x = cnt
#print('min', min_x)
cnt2 = 0
for i in range(len(tmp)):
    if tmp[i] == 'nanndemo':
        cnt2 += 1
# print(cnt2)
if cnt2 == 0:
    max_x = len(set(tmp))
    print(min_x, max_x)
    exit()
cnt3 = 0
if cnt2 != 0:
    for i in range(len(tmp2)):
        if tmp2[i] != 'nanndemo':
            cnt3 += 1
max_xx = cnt3+cnt2
print(min_x, max_xx)

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()
# print(a)
tmp = []
for i in range(n):
    if 1 <= a[i] and a[i] <= 399:
        tmp.append('ha')
    if 400 <= a[i] and a[i] <= 799:
        tmp.append('cha')
    if 800 <= a[i] and a[i] <= 1199:
        tmp.append('mi')
    if 1200 <= a[i] and a[i] <= 1599:
        tmp.append('mizu')
    if 1600 <= a[i] and a[i] <= 1999:
        tmp.append('ao')
    if 2000 <= a[i] and a[i] <= 2399:
        tmp.append('ki')
    if 2400 <= a[i] and a[i] <= 2799:
        tmp.append('da')
    if 2800 <= a[i] and a[i] <= 3199:
        tmp.append('aka')
    if 3200 <= a[i]:
        tmp.append('nanndemo')
# print(tmp)
cnt = 0
tmp2 = list(set(tmp))
for i in range(len(tmp2)):
    if tmp2[i] != 'nanndemo':
        cnt += 1
min_x = cnt
#print('min', min_x)
cnt2 = 0
for i in range(len(tmp)):
    if tmp[i] == 'nanndemo':
        cnt2 += 1
# print(cnt2)
if cnt2 == 0:
    max_x = len(set(tmp))
    print(min_x, max_x)
    exit()
cnt3 = 0
if cnt2 != 0:
    for i in range(len(tmp2)):
        if tmp2[i] != 'nanndemo':
            cnt3 += 1
max_xx = cnt3+cnt2
print(min_x, max_xx)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
C = [0]*9
for e in a:
    if e < 400:
        C[0] += 1
    elif e < 800:
        C[1] += 1
    elif e < 1200:
        C[2] += 1
    elif e < 1600:
        C[3] += 1
    elif e < 2000:
        C[4] += 1
    elif e < 2400:
        C[5] += 1
    elif e < 2800:
        C[6] += 1
    elif e < 3200:
        C[7] += 1
    else:
        C[8] += 1
ans = 0
for k in range(8):
    if C[k] > 0:
        ans += 1
print(max(1,ans),min(8,ans+C[8]))

Submission status: Wrong Answer

Solution code:
from collections import Counter


N = int(input())
a = Counter(map(lambda x: min(8, int(x) // 400), input().split()))
print(a)
super_coders = min(8, a.pop(8, 0))
mn = len(a)
if mn == 0 and super_coders:
    mn = 1
mx = min(8, len(a) + super_coders)
print(mn, mx)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
free = 0
color = set()
for i in range(N):
    if A[i]<3200:
        color.add(A[i]//400)
    else:
        free += 1
print(len(color),len(color)+free)

Submission status: Wrong Answer

Solution code:
from collections import Counter


N = int(input())
a = Counter(map(lambda x: min(8, int(x) // 400), input().split()))
super_coders = min(8, a.pop(8, 0))
mn = len(a)
if mn == 0 and super_coders:
    mn = 1
mx = min(7, len(a) + super_coders)
print(mn, mx)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0 for i in range(8)]
a = 0
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:
    a += 1
b = sum(B)
m = b
M = b + a
if b == 0:
  m = 1
print(m, M, sep=' ')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
L = [0]*8
for a in A:
    n = a//400
    if n > 7:
        L.append(1)
    else:
        L[n] = 1
m1, m2 = int(), int()
cnt = 0
for i in range(len(L)):
    l = L[i]
    if l == 1:
        if i > 7:
            m2 += 1
            if cnt == 0:
                m1 += 1
        else:
            cnt += 1
            m1 += 1
            m2 += 1

#print(L)
print(m1, m2)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
L = [0]*8
for a in A:
    n = a//400
    if n > 7:
        L.append(1)
    else:
        L[n] = 1
m1, m2 = int(), int()
cnt = 0
for i in range(len(L)):
    l = L[i]
    if l == 1:
        if i > 7:
            m2 += 1
            if cnt == 0:
                m1 += 1
        else:
            cnt += 1
            m1 += 1
            m2 += 1

print(L)
print(m1, m2)

Submission status: Wrong Answer

Solution code:
N=int(input())

T=[0]*9

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

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

goukeimin=0
for i in range(8):
    goukeimin+=T[i]
print(goukeimin,sum(T))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(list(map(int, input().split())))
l=list()
l2=list()
i=0
for a in A:
    n=a//400
    if n<8 or n==2:
        l2.append(n)
    elif len(l2)==0:
        l2.append(8)
    if n>=8:
        n+=i
        i+=1
    l.append(n)
#print(set(l2), set(l))
print(len(set(l2)), len(set(l)))

Submission status: Wrong Answer

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

a.sort()

colors = [0,0,0,0,0,0,0,0]
mulch = 0

for i in a:
  if i < 400:
    colors[0] += 1
  elif i < 800:
    colors[1] += 1
  elif i < 1200:
    colors[2] += 1
  elif i < 1600:
    colors[3] += 1
  elif i < 2000:
    colors[4] += 1
  elif i < 2400:
    colors[5] += 1
  elif i < 2800:
    colors[6] += 1
  elif i < 3200:
    colors[7] += 1
  else:
    mulch += 1
    
if len([j for j in colors if j > 0]) > 0:
  mi = len([j for j in colors if j > 0])
else:
  mi = 1

if mulch > 0:
  if len([j for j in colors if j > 0]) == 0:
    tmp = mulch
  else:  
    tmp = mi + mulch
  
  if tmp > 8:
    ma = 8
  else:
    ma = tmp
else:
  ma = mi
  
print(mi, ma)

Submission status: Wrong Answer

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

a.sort()

colors = [0,0,0,0,0,0,0,0]
mulch = 0

for i in a:
  if i < 400:
    colors[0] += 1
  elif i < 800:
    colors[1] += 1
  elif i < 1200:
    colors[2] += 1
  elif i < 1600:
    colors[3] += 1
  elif i < 2000:
    colors[4] += 1
  elif i < 2400:
    colors[5] += 1
  elif i < 2800:
    colors[6] += 1
  elif i < 3200:
    colors[7] += 1
  else:
    mulch += 1
    
if len([j for j in colors if j > 0]) > 0:
  mi = len([j for j in colors if j > 0])
else:
  mi = 1

if mulch > 0:
  tmp = mi + mulch
  
  if tmp > 8:
    ma = 8
  else:
    ma = tmp
else:
  ma = mi
  
print(mi, ma)

Submission status: Wrong Answer

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

a.sort()

colors = [0,0,0,0,0,0,0,0]
mulch = 0

for i in a:
  if i < 400:
    colors[0] += 1
  elif i < 800:
    colors[1] += 1
  elif i < 1200:
    colors[2] += 1
  elif i < 1600:
    colors[3] += 1
  elif i < 2000:
    colors[4] += 1
  elif i < 2400:
    colors[5] += 1
  elif i < 2800:
    colors[6] += 1
  elif i < 3200:
    colors[7] += 1
  else:
    mulch += 1
  
mi = len([j for j in colors if j > 0])

if mulch > 0:
  tmp = mi + mulch
  
  if tmp > 8:
    ma = 8
  else:
    ma = tmp
else:
  ma = mi
  
print(mi, ma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a =  list(map(int,input().split()))
hai = 0
tya = 0
midori = 0
mizu = 0
ao = 0
ki = 0
tyen = 0
aka = 0
tourist = 0
for i in a:
    if 1 <= i  <= 399:
        if hai > 0:
            pass
        else:
            hai+=1
    elif 400 <= i  <= 799:
        if tya > 0:
            pass
        else:
            tya+=1
    elif 800 <= i  <= 1199:
        if midori > 0:
            pass
        else:
            midori+=1
    elif 1200 <= i  <= 1599:
        if mizu > 0:
            pass
        else:
            mizu+=1
    elif 1600 <= i  <= 1999:
        if ao > 0:
            pass
        else:
            ao+=1
    elif 2000 <= i  <= 2399:
        if ki > 0:
            pass
        else:
            ki+=1
    elif 2400 <= i  <= 2799:
        if tyen > 0:
            pass
        else:
            tyen+=1
    elif 2800 <= i  <= 3199:
        if aka > 0:
            pass
        else:
            aka+=1
    else:
        tourist+=1
Sum = hai + tya + midori + mizu + ao + ki + tyen + aka
MIN = Sum
if MIN == 0 and tourist  >= 1:
    MIN = 1
MAX = 0
if Sum < 8:
    if Sum + tourist >=  8:
        MAX = 8
    else:
        MAX = Sum + tourist
else:
    MAX = 8
print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
n = int(input())
a =  list(map(int,input().split()))
hai = 0
tya = 0
midori = 0
mizu = 0
ao = 0
ki = 0
tyen = 0
aka = 0
tourist = 0
for i in a:
    if 1 <= i  <= 399:
        if hai > 0:
            pass
        else:
            hai+=1
    elif 400 <= i  <= 799:
        if tya > 0:
            pass
        else:
            tya+=1
    elif 800 <= i  <= 1199:
        if midori > 0:
            pass
        else:
            midori+=1
    elif 1200 <= i  <= 1599:
        if mizu > 0:
            pass
        else:
            mizu+=1
    elif 1600 <= i  <= 1999:
        if ao > 0:
            pass
        else:
            ao+=1
    elif 2000 <= i  <= 2399:
        if ki > 0:
            pass
        else:
            ki+=1
    elif 2400 <= i  <= 2799:
        if tyen > 0:
            pass
        else:
            tyen+=1
    elif 2800 <= i  <= 3199:
        if aka > 0:
            pass
        else:
            aka+=1
    else:
        tourist+=1
Sum = hai + tya + midori + mizu + ao + ki + tyen + aka
MIN = Sum
MAX = 0
if Sum < 8:
    if Sum + tourist >=  8:
        MAX = 8
    else:
        MAX = Sum + tourist
else:
    MAX = 8
print(MIN,MAX)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
maxColorNum = 8
rates = [False] * maxColorNum
overRed = 0
N = int(input())
people = list(map(int, input().split()))
for i in people:
    idx = i // 400
    if idx >= maxColorNum:
        overRed += 1
    else:
        rates[idx] = True
minNum = 1 if rates.count(True) == 0 and overRed != 0 else rates.count(True)
maxNum = rates.count(True) + overRed if rates.count(True) + \
    overRed <= maxColorNum else maxColorNum

print(str(minNum) + " " + str(maxNum))

Submission status: Wrong Answer

Solution code:
maxColorNum = 8
rates = [False] * maxColorNum
overRed = 0
N = int(input())
people = list(map(int, input().split()))
for i in people:
    idx = i // 400
    if idx >= maxColorNum:
        overRed += 1
    else:
        rates[idx] = True
minNum = rates.count(True) if overRed == 0 else rates.count(True)+1
maxNum = rates.count(True) + overRed if rates.count(True) + \
    overRed <= maxColorNum else maxColorNum

print(str(minNum) + " " + str(maxNum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
maxColorNum = 8
rates = [False] * maxColorNum
overRed = 0
N = int(input())
people = list(map(int, input().split()))
for i in people:
    idx = i // 400
    if idx >= maxColorNum:
        overRed += 1
    else:
        rates[idx] = True
minNum = rates.count(True) if overRed == 0 else rates.count(True)+1
maxNum = rates.count(True) + overRed if rates.count(True) + \
    overRed <= maxColorNum else maxColorNum

print(str(minNum) + " " + str(maxColorNum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
maxColorIdx = 8
rates = [False] * maxColorIdx
overRed = 0
N = int(input())
people = list(map(int, input().split()))
for i in people:
    idx = i // 400
    if idx >= maxColorIdx:
        overRed += 1
    else:
        rates[idx] = True
maxColorNum = rates.count(True) + overRed
if maxColorNum > 8:
    maxColorNum = maxColorIdx
print(str(rates.count(True)) + " " + str(maxColorNum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
colorMaxIdx = 8
rates = [False] * colorMaxIdx
overRed = 0
N = int(input())
people = list(map(int, input().split()))
for i in people:
    idx = i // 400
    if idx >= 8:
        overRed += 1
    else:
        rates[idx] = True
maxColorNum = rates.count(
    True)+overRed if rates.count(True)+overRed <= 8 else 8
print(str(rates.count(True)) + " " + str(maxColorNum))