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:
# C - Colorful Leaderboard
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    ans = []

    for i in a:
        if i // 400 >= 8:
            cnt += 1
        else:
            ans.append(i//400)
    else:
        ans = set(ans)
        print(max(len(ans), 1), min(len(ans)+cnt, 8))



if __name__ ==  "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    ans = []

    for i in a:
        if i // 400 >= 8:
            cnt += 1
        else:
            ans.append(i//400)
    else:
        ans = set(ans)
        print(max(len(ans), 1), min(len(ans)+cnt, 9))



if __name__ ==  "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    ans = []

    for i in a:
        if i // 400 >= 8:
            cnt += 1
        else:
            ans.append(i//400)
    else:
        ans = set(ans)
        print(max(len(ans), cnt), len(ans)+cnt)



if __name__ ==  "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    ans = []

    for i in a:
        if i // 400 >= 8:
            cnt += 1
        else:
            ans.append(i//400)
    else:
        ans = set(ans)
        print(len(ans), len(ans)+cnt)



if __name__ ==  "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if CA[i]:
        num += 1

num_8 = CA[8]
saidai = min(num + num_8, 8)

saisho = max(1, num)
print(saisho, saidai)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if i in CA:
        num += 1

num_8 = CA[8]
saidai = min(num + num_8, 8)

saisho = max(1, num)
print(saisho, saidai)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if i in CA:
        num += 1

num_8 = CA[8]
saidai = min(num + num_8, 8)

saisho = min(1, num)
print(saisho, saidai)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if i in CA:
        num += 1

num_8 = CA[8]
saidai = min(num + num_8, 8)

saisho = num
if num_8 and not saisho:
    saisho += 1
print(saisho, saidai)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if i in CA:
        num += 1

num_8 = CA[8]
saidai = min(num + num_8, 9)

saisho = num
if num_8 and not saisho:
    saisho += 1
print(saisho, saidai)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
ans = []
cnt = 0
for i in range(N):
  if a[i]//400 >= 8:
    cnt += 1
  else:
    ans.append(a[i]//400)

total = len(set(ans))

if cnt > 0:
  if total != 8:
    MIN = total
  else:
    MIN = 8
else:
  MIN = total
  
if cnt > 0:
  if total != 8:
    MAX = total + cnt
    if MAX > 8:
      MAX = 8
  else:
    MAX = 8
else:
  MAX = total

print(MIN, MAX)

Submission status: Wrong Answer

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

hai = 0
tya = 0
mid = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
mu = 0

for a in A:
  if a <= 399:
    hai = 1
  elif a <= 799:
    tya = 1
  elif a <= 1199:
    mid = 1
  elif a <= 1599:
    mizu = 1
  elif a <= 1999:
    ao = 1
  elif a <= 2399:
    ki = 1
  elif a <= 2799:
    dai = 1
  elif a <= 3199:
    aka = 1
  else:
    mu += 1
    
max_num = min(8, hai + tya + mid + mizu + ao + ki + dai + aka + mu)
min_num = max(1, hai + tya + mid + mizu + ao + ki + dai + aka)
 
print(min_num, max_num)

Submission status: Wrong Answer

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

hai = 0
tya = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
mu = 0

for a in A:
  if a <= 399:
    hai = 1
  elif a <= 799:
    tya = 1
  elif a <= 1199:
    mizu = 1
  elif a <= 1599:
    ao = 1
  elif a <= 1999:
    ki = 1
  elif a <= 2399:
    dai = 1
  elif a <= 3199:
    aka = 1
  else:
    mu += 1
    
max_num = min(8, hai + tya + mizu + ao + ki + dai + aka + mu)
min_num = hai + tya + mizu + ao + ki + dai + aka

print(min_num, max_num)

Submission status: Wrong Answer

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

hai = 0
tya = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
mu = 0

for a in A:
  if a <= 399:
    hai = 1
  elif a <= 799:
    tya = 1
  elif a <= 1199:
    mizu = 1
  elif a <= 1599:
    ao = 1
  elif a <= 1999:
    ki = 1
  elif a <= 2399:
    dai = 1
  elif a <= 3199:
    aka = 1
  else:
    mu += 1
    
max_num = min(8, hai + tya + mizu + ao + ki + dai + aka + mu)
min_num = max(1, hai + tya + mizu + ao + ki + dai + aka)

print(min_num, max_num)

Submission status: Wrong Answer

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

cnt = [0]*8
c = 0
for a in A:
    if a <= 399:
        cnt[0] += 1
    elif a >= 400 and a <= 799:
        cnt[1] += 1
    elif a >= 800 and a <= 1199:
        cnt[2] += 1
    elif a >= 1200 and a <= 1599:
        cnt[3] += 1
    elif a >= 1600 and a <= 1999:
        cnt[4] += 1
    elif a >= 2000 and a <= 2399:
        cnt[5] += 1
    elif a >= 2400 and a <= 2799:
        cnt[6] += 1
    elif a >= 2800 and a <= 3199:
        cnt[7] += 1
    else:
        c += 1
        
Min = len([i for i in cnt if i != 0])
if c == 0:
    print(Min, Min)
else:
    Max = min(8, Min+c)
    if Min == 0:
        print(1, Max)
    else:
        print(Min, Max)

Submission status: Wrong Answer

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

cnt = [0]*8
c = 0
for a in A:
    if a <= 399:
        cnt[0] += 1
    elif a >= 400 and a <= 799:
        cnt[1] += 1
    elif a >= 800 and a <= 1199:
        cnt[2] += 1
    elif a >= 1200 and a <= 1599:
        cnt[3] += 1
    elif a >= 1600 and a <= 1999:
        cnt[4] += 1
    elif a >= 2000 and a <= 2399:
        cnt[5] += 1
    elif a >= 2400 and a <= 2799:
        cnt[6] += 1
    elif a >= 2800 and a <= 3199:
        cnt[7] += 1
    else:
        c += 1
        
Min = len([i for i in cnt if i != 0])
if c == 0:
    print(Min, Min)
else:
    Max = min(9, Min+c)
    print(Min, Max)

Submission status: Wrong Answer

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

cnt = [0]*8
c = 0
for a in A:
    if a <= 399:
        cnt[0] += 1
    elif a >= 400 and a <= 799:
        cnt[1] += 1
    elif a >= 800 and a <= 1199:
        cnt[2] += 1
    elif a >= 1200 and a <= 1599:
        cnt[3] += 1
    elif a >= 1600 and a <= 1999:
        cnt[4] += 1
    elif a >= 2000 and a <= 2399:
        cnt[5] += 1
    elif a >= 2400 and a <= 2799:
        cnt[6] += 1
    elif a >= 2800 and a <= 3199:
        cnt[7] += 1
    else:
        c += 1
        
Min = len([i for i in cnt if i != 0])
if c == 0:
    print(Min, Min)
else:
    Max = min(8, Min+c)
    print(Min, Max)

Submission status: Wrong Answer

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

mi = 8-c.count(0)
ma = mi+over
print(mi,ma)

Submission status: Wrong Answer

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

mi = 8-c.count(0)
if mi+over>8:
    ma = 8
else:
    ma = mi+over
print(mi,ma)

Submission status: Wrong Answer

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

mi = 8-c[0:8].count(0)
if mi+c[8]>8:
    ma = 8
else:
    ma = mi+c[8]
print(mi,ma)

Submission status: Wrong Answer

Solution code:
N = int(input())
R = list(map(int, input().split()))
X = [0]*8
p = 0
for r in R:
  if r >= 3200:
    p += 1
  else:
    X[r//400] = 1

s = sum(X)
if s == 0:
  print(str(1) + ' ' + str(min(p,8)))
else:
  print(str(s) + ' ' + str(s+min(8-s,p)))

Submission status: Wrong Answer

Solution code:
N = int(input())
R = list(map(int, input().split()))
X = [0]*8
p = 0
for r in R:
  if r >= 3200:
    p += 1
  else:
    X[r//400] = 1

s = sum(X)
if s == 0:
  print(1, min(p,8))
else:
  print(s, s+min(8-s,p))

Submission status: Wrong Answer

Solution code:
N = int(input())
Color = ['Gray','Brown','Green','LBlue','Blue','Yellow','Orange','Red']
Rate = list(map(int,input().split()))
D = dict(zip(Color,[0]*8))
pro = 0

for r in Rate:
  if 1 <= r <= 399: D['Gray'] += 1
  elif 400 <= r <= 799: D['Brown'] += 1
  elif 800 <= r <= 1199: D['Green'] += 1
  elif 1200 <= r <= 1599: D['LBlue'] += 1
  elif 1600 <= r <= 1999: D['Blue'] += 1
  elif 2000 <= r <= 2399: D['Yellow'] += 1
  elif 2400 <= r <= 2799: D['Orange'] += 1
  elif 2800 <= r <= 3199: D['Red'] += 1
  else: pro += 1
    
used = sum(i > 0 for i in D.values())
unused = (8-used)

if pro > 0 and used > 0:
  print(used, used+min(unused,pro))
elif pro > 0 and used == 0:
  print(1, pro)
else:
  print(used, used)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
X = [0 for i in range(8)]
cnt = 0
for a in A:
  if a >= 3200:
    cnt += 1
  else:
    X[a // 400] = 1
s = sum(X)
if s == 0:
  print(str(1) + " " + str(min(8, cnt)))
else:
  print(str(s) + " " + str(min(8, s + cnt)))

Submission status: Wrong Answer

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

if cnt == 0:
        cnt = 1
print(cnt,cnt+l[8])

Submission status: Wrong Answer

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

if cnt == 0 and l[8] >= 8:
        print(1,8)
elif cnt == 0 and l[8] < 8:
        print(1,l[8])
elif cnt !=0 and cnt +l[8] >= 8:
        print(cnt,8)
elif cnt != 0 and cnt + l[8] <8:
        print(cnt,cnt + l[8])

Submission status: Wrong Answer

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

if cnt == 0 and l[8] >= 8:
        print(1,8)
elif cnt == 0 and l[8] < 8:
        print(1,l[8])
elif cnt !=0 and l[8] >= 8:
        print(cnt,8)
else:
        print(cnt,cnt + l[8])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
a = list(map(int,input().split()))
d = defaultdict(int)
for x in a:
    d[min(x//400, 8)] += 1
mi = len(d.keys())
if d[8] > 0 and mi > 2:
    mi -= 1
mx = d[8]+len([i for i in range(8) if i in d])
print(mi, mx)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a1=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
ans=0
for i in range(n):
  if 1<=a[i]<=399:
    a1=1
  elif 400<=a[i]<=799:
    b=1
  elif 800<=a[i]<=1199:
    c=1
  elif 1200<=a[i]<=1599:
    d=1
  elif 1600<=a[i]<=1999:
    e=1
  elif 2000<=a[i]<=2399:
    f=1
  elif 2400<=a[i]<=2799:
    g=1
  elif 2800<=a[i]<=3199:
    h=1
  else:
    ans+=1

x=a1+b+c+d+e+f+g+h
print(x,x+ans)

Submission status: Wrong Answer

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

sp = [400,800,1200,1600,2000,2400,2800,3200]
rank = ["gray","brown","green","cyan","blue","yellow","orange","red","highest"]
cnt = [0]*len(rank)

import bisect as b

for score in S:
  cnt[b.bisect(sp,score)] += 1
  
mid = sum([1 for n in cnt[:-1] if n > 0])
t = cnt[-1]
print(max(mid,t),mid+t)
#print(cnt)

Submission status: Wrong Answer

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

sp = [400,800,1200,1600,2000,2400,2800,3200]
rank = ["gray","brown","green","cyan","blue","yellow","orange","red","highest"]
cnt = [0]*len(rank)

import bisect as b

for score in S:
  cnt[b.bisect(sp,score)] += 1
  
mid = sum([1 for n in cnt[:-1] if n > 0])
t = cnt[-1]
print(mid,mid+t)
#print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [ int(v) for v in input().split(" ") ]

l = [0] * 9

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

uniq_n = 0
for i in range(8):
  if l[i] != 0:
    uniq_n += 1

min_v = 1 if uniq_n == 0 else uniq_n
max_v = 8 if uniq_n + l[8] > 8 else uniq_n + l[8]
print(min_v, max_v)

Submission status: Wrong Answer

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

upper = [399, 799, 1199, 1599, 1999, 2399, 2799,3199, 4800]
lower = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

cnt = 0
tops = 0
for color in range(9)[::-1]:
    for i in range(n):
        if color == 8:
            if lower[color] <= a[i] <= upper[color]:
                tops += 1
        else:
            if lower[color] <= a[i] <=upper[color]:
                cnt += 1
                break

print(max(1, cnt), min(cnt + tops, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [ int(v) for v in input().split(" ") ]

l = [0] * 9

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

uniq_n = 0
for i in range(8):
  if l[i] != 0:
    uniq_n += 1

min_v = l[8] if uniq_n == 0 else uniq_n
max_v = 8 if uniq_n + l[8] > 8 else uniq_n + l[8]
print(min_v, max_v)

Submission status: Wrong Answer

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

upper = [399, 799, 1199, 1599, 1999, 2399, 2799,3199, 4800]
lower = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

cnt = 0
tops = 0
for color in range(9)[::-1]:
    for i in range(n):
        if color == 8:
            if lower[color] <= a[i] <= upper[color]:
                tops += 1
        else:
            if lower[color] <= a[i] <=upper[color]:
                cnt += 1
                break

print(cnt, min(cnt + tops, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [ int(v) for v in input().split(" ") ]

l = [0] * 9

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

uniq_n = 0
for i in range(8):
  if l[i] != 0:
    uniq_n += 1

min_v = uniq_n
max_v = 8 if uniq_n + l[8] > 8 else uniq_n + l[8]
print(min_v, max_v)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
A = [math.floor(a/400) if a < 3200 else 3200 for a in list(map(int, input().split()))]

set_A = set([a for a in A if a != 3200])
print(*[max(1, len(set_A)), min(8, len(set_A) + A.count(3200))], sep=" ")

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
A = [math.floor(a/400) if a < 3200 else 3200 for a in list(map(int, input().split()))]

set_A = set([a for a in A if a != 3200])
print(*[max(1, len(set_A)), min(9, len(set_A) + A.count(3200))], sep=" ")

Submission status: Wrong Answer

Solution code:
with open(0) as f:
    N, *a = map(int, f.read().split())
from collections import Counter
Set = set()
free = 0
for x in a:
    x //= 400
    if x < 8:
        Set.add(x)
    else:
        free += 1

Ans = [max(1, len(Set)), min(8, len(Set)+free)]
print(*Ans)

Submission status: Wrong Answer

Solution code:
with open(0) as f:
    N, *a = map(int, f.read().split())
from collections import Counter
Set = set()
free = 0
for x in a:
    x //= 400
    if x < 8 and x:
        Set.add(x)
    else:
        free += 1

Ans = [max(1, len(Set)), min(8, len(Set)+free)]
print(*Ans)

Submission status: Wrong Answer

Solution code:
with open(0) as f:
    N, *a = map(int, f.read().split())
from collections import Counter
Set = set()
free = 0
for x in a:
    x //= 400
    if x < 8 and x:
        Set.add(x)
    else:
        free += 1

Ans = [max(1, len(Set), free), min(8, len(Set)+free)]
print(*Ans)

Submission status: Wrong Answer

Solution code:
with open(0) as f:
    N, *a = map(int, f.read().split())
from collections import Counter
Set = set()
free = 0
for x in a:
    x //= 400
    if x < 8 and x:
        Set.add(x)
    else:
        free += 1

Ans = [max(len(Set), free), min(8, len(Set)+free)]
print(*Ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    rate_list = [0] * 9

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

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

    print(min_cnt, min_cnt + rate_list[-1])


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# ABC 064: C – Colorful Leaderboard
N = int(input())
a = [int(i) for i in input().split()]

colors = [0] * 8

for rate in a:
    if rate < 3200:
        colors[rate // 400] += 1

a_min = 1 if sum(colors) == 0 else len([i for i in colors if i > 0])
print(a_min, a_min + len([j for j in a if j >= 3200]))

Submission status: Wrong Answer

Solution code:
# ABC 064: C – Colorful Leaderboard
N = int(input())
a = [int(i) for i in input().split()]

colors = [0] * 8

for rate in a:
    if rate < 3200:
        colors[rate // 400] += 1

a_min = len([i for i in colors if i > 0]) if sum(colors) != 0 else 1
print(a_min, a_min + len([j for j in a if j >= 3200]))

Submission status: Wrong Answer

Solution code:
# ABC 064: C – Colorful Leaderboard
N = int(input())
a = [int(i) for i in input().split()]

colors = [0] * 8

for rate in a:
    if rate < 3200:
        colors[rate // 400] += 1

a_min = len([i for i in colors if i > 0])
print(a_min, a_min + len([j for j in a if j >= 3200]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rates = [0] * 8
cnt = 0

for i in range(n):
  if a[i] < 3200:
    rates[a[i] // 400] += 1
  else:
    cnt += 1
    
cn = len(rates) - rates.count(0) #color number
cmin = cn #color min

if all([x < 3200 for x in a]):
  cmax = cn #color max
else:
  cmax = cn + cnt
  
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
N=int(input())
p=list(map(int,input().split()))
s=set()
z=0
for i in range(N):
  p[i]//=400
  if p[i]<8:
    s.add(p[i])
  else:
    z+=1
print(len(s),end=' ')
print(len(s)+z)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

N = int(input())
A = lint()
S = set()
pro = 0
for a in A:
    if a//400<8:
        S.add(a//400)
    else:
        pro += 1
print(max(1,len(S)),min(8,len(S)+pro))

Submission status: Wrong Answer

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

for n in range(N):
  if 1 <= a[n] < 400:
    color.add("gray")
  elif 400 <= a[n] < 800:
    color.add("brown")
  elif 800 <= a[n] < 1200:
    color.add("green")
  elif 1200<= a[n] < 1600:
    color.add("water")
  elif 1600 <= a[n] < 2000:
    color.add("blue")
  elif 2000 <= a[n] < 2400:
    color.add('yellow')
  elif 2400 <= a[n] < 2800:
    color.add('orange')
  elif 2800 <= a[n] < 3200:
    color.add('red')
  else:
    rainbow += 1

color_min = max([len(color), 1])  
color_max = color_min + rainbow

    
print(f'{color_min} {color_max}')

Submission status: Wrong Answer

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

for n in range(N):
  if 1 <= a[n] < 400:
    color.add("gray")
  elif 400 <= a[n] < 800:
    color.add("brown")
  elif 800 <= a[n] < 1200:
    color.add("green")
  elif 1200<= a[n] < 1600:
    color.add("water")
  elif 1600 <= a[n] < 2000:
    color.add("blue")
  elif 2000 <= a[n] < 2400:
    color.add('yellow')
  elif 2400 <= a[n] < 2800:
    color.add('orange')
  elif 2800 <= a[n] < 3200:
    color.add('red')
  else:
    rainbow += 1

if len(color) < rainbow:
  color_min = rainbow
else:
  color_min = max([len(color), 1])
  
color_max = color_min + rainbow

    
print(f'{color_min} {color_max}')

Submission status: Wrong Answer

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

for n in range(N):
  if 1 <= a[n] < 400:
    color.add("gray")
  elif 400 <= a[n] < 800:
    color.add("brown")
  elif 800 <= a[n] < 1200:
    color.add("green")
  elif 1200<= a[n] < 1600:
    color.add("water")
  elif 1600 <= a[n] < 2000:
    color.add("blue")
  elif 2000 <= a[n] < 2400:
    color.add('yellow')
  elif 2400 <= a[n] < 2800:
    color.add('orange')
  elif 2800 <= a[n] < 3200:
    color.add('red')
  else:
    rainbow += 1

if len(color) < rainbow:
  color_min = rainbow
else:
  color_min = max(len(color), 1)
  
color_max = color_min + rainbow

    
print(f'{color_min} {color_max}')

Submission status: Wrong Answer

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

for n in range(N):
  if 1 <= a[n] < 400:
    color.add("gray")
  elif 400 <= a[n] < 800:
    color.add("brown")
  elif 800 <= a[n] < 1200:
    color.add("green")
  elif 1200<= a[n] < 1600:
    color.add("water")
  elif 1600 <= a[n] < 2000:
    color.add("blue")
  elif 2000 <= a[n] < 2400:
    color.add('yellow')
  elif 2400 <= a[n] < 2800:
    color.add('orange')
  elif 2800 <= a[n] < 3200:
    color.add('red')
  elif 3200 <= a[n] <= 4800:
    rainbow += 1


color_min = len(color)  
color_max = color_min + rainbow

    
print(f'{color_min} {color_max}')

Submission status: Wrong Answer

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

for n in range(N):
  if 1 <= a[n] < 400:
    color.add("gray")
  elif 400 <= a[n] < 800:
    color.add("brown")
  elif 800 <= a[n] < 1200:
    color.add("green")
  elif 1200<= a[n] < 1600:
    color.add("water")
  elif 1600 <= a[n] < 2000:
    color.add("blue")
  elif 2000 <= a[n] < 2400:
    color.add('yellow')
  elif 2400 <= a[n] < 2800:
    color.add('orange')
  elif 2800 <= a[n] < 3200:
    color.add('red')
  else:
    rainbow += 1

if len(color) < rainbow:
  color_min = rainbow
else:
  color_min = len(color)
  
color_max = color_min + rainbow

    
print(f'{color_min} {color_max}')

Submission status: Wrong Answer

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

for n in range(N):
  if 1 <= a[n] < 400:
    color.add("gray")
  elif 400 <= a[n] < 800:
    color.add("brown")
  elif 800 <= a[n] < 1200:
    color.add("green")
  elif 1200<= a[n] < 1600:
    color.add("water")
  elif 1600 <= a[n] < 2000:
    color.add("blue")
  elif 2000 <= a[n] < 2400:
    color.add('yellow')
  elif 2400 <= a[n] < 2800:
    color.add('orange')
  elif 2800 <= a[n] < 3200:
    color.add('red')
  else:
    rainbow += 1

color_min = len(color)
color_max = color_min + rainbow
    
print(f'{color_min} {color_max}')

Submission status: Wrong Answer

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

ans=[0]*8
rate=0

for i in l:
  if i<400:
    ans[0]=1
  elif 400<=i<800:
    ans[1]=1
  elif 800<=i<1200:
    ans[2]=1
  elif 1200<=i<1600:
    ans[3]=1
  elif 1600<=i<2000:
    ans[4]=1
  elif 2000<=i<2400:
    ans[5]=1
  elif 2400<=i<2800:
    ans[6]=1
  elif 2800<=i<3200:
    ans[7]=1
  elif i<=3200:
    rate+=1
    
ans1 = 8-ans.count(0)
ans2 = ans1+rate
if ans1 == 0 and rate != 0:
    ans1 = 1
 
 
print(ans1, ans2)

Submission status: Wrong Answer

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

ans=[0]*8
rate_3200=0

for i in l:
  if i<400:
    ans[0]=1
  elif 400<=i<800:
    ans[1]=1
  elif 800<=i<1200:
    ans[2]=1
  elif 1200<=i<1600:
    ans[3]=1
  elif 1600<=i<2000:
    ans[4]=1
  elif 2000<=i<2400:
    ans[5]=1
  elif 2400<=i<2800:
    ans[6]=1
  elif 2800<=i<3200:
    ans[7]=1
  elif i<=3200:
    rate_3200+=1
    
ans1 = 8-ans.count(0)
ans2 = ans1+rate_3200
if ans1 == 0 and rate_3200 != 0:
    ans1 = 1
 
 
print(ans1, ans2)

Submission status: Wrong Answer

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

ans=[0]*8
rate_3200=0

for i in l:
  if i<400:
    ans[0]+=1
  elif 400<=i<800:
    ans[1]+=1
  elif 800<=i<1200:
    ans[2]+=1
  elif 1200<=i<=1600:
    ans[3]+=1
  elif 1600<=i<2000:
    ans[4]+=1
  elif 2000<=i<2400:
    ans[5]+=1
  elif 2400<=i<2800:
    ans[6]+=1
  elif 2800<=i<3200:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
ans1 = 8-ans.count(0)
ans2 = ans1+rate_3200
if ans1 == 0 and rate_3200 != 0:
    ans1 = 1
 
 
print(ans1, ans2)