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())
l = list(map(int,input().split()))
color = [0]*9
def col(x):
  if 1<=x<=399:
    return 0
  elif 400<=x<=799:
    return 1
  elif 800<=x<=1199:
    return 2
  elif 1200<=x<=1599:
    return 3
  elif 1600<=x<=1999:
    return 4
  elif 2000<=x<=2399:
    return 5
  elif 2400<=x<=2799:
    return 6
  elif 2800<=x<=3199:
    return 7
  else:
    return 8
  
for i in l:
  a = col(i)
  color[a] += 1
color2 = [i for i in color if i!=0]
if color[8]==0:
  print(len(color2),len(color2))
else:
  print(len(color2)-1,min(len(color2)-1+color[8],8))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
def main():
    N = int(input())
    p = [int(a) for a in input().split()]
    rate = defaultdict(int)
    for i in range(N):
        score = p[i]
        if 1 <= score <= 399:
            rate["GRAY"] += 1
        elif 400  <= score <= 799:
            rate["BROWN"] += 1
        elif 800  <= score <= 1199:
            rate["GREEN"] += 1
        elif 1200 <= score <= 1599:
            rate["LBLUE"] += 1
        elif 1600 <= score <= 1999:
            rate["BLUE"] += 1
        elif 2000 <= score <= 2399:
            rate["YELLOW"] += 1
        elif 2400 <= score <= 2799:
            rate["ORANGE"] += 1
        elif 2800 <= score <= 3199:
            rate["RED"] += 1
        elif 3200 <= score:
            rate["FREE"] += 1
    color = 0
    free  = 0
    for k, v in rate.items():
        if k != "FREE":
            if rate[k] > 0:
                color += 1
        else:
            free += rate[k]
    print(color , color + free)
main()

Submission status: Wrong Answer

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

print(len(ans),len(ans)+cnt)

Submission status: Wrong Answer

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

n=int(input())
a=list(map(int, input().split()))
a.sort()
d=[0 for _ in range(8)]

flg=False
minim=-1
for i in range(n):
    if a[i]<400:
        d[0]=1
    elif a[i]<800:
        d[1]=1
    elif a[i]<1200:
        d[2]=1
    elif a[i]<1600:
        d[3]=1
    elif a[i]<2000:
        d[4]=1
    elif a[i]<2400:
        d[5]=1
    elif a[i]<2800:
        d[6]=1
    elif a[i]<3200:
        d[7]=1
    else:
        if flg==False:
            minim=sum(d)
            flg=True
        d[0]+=1

if minim==-1:
    minim=sum(d)
print(minim,end=' ')
print(sum(d))

Submission status: Wrong Answer

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

ans = [0]*8
free = 0
for a in A:
    for i in range(8):
        if a < (i+1)*400:
            ans[i]=1
            break
    if 3200 <= a:
        free += 1
ans_max = min(8, sum(ans)+free)
ans_min = max(1, sum(ans))
print(ans_min, ans_max, sep=' ')

Submission status: Wrong Answer

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

ans = [0]*8
free = 0
for a in A:
    for i in range(8):
        if a < (i+1)*400:
            ans[i]=1
            break
    if 3200 <= a:
        free += 1
ans_max = min(8, sum(ans)+free)
ans_min = sum(ans)
print(ans_min, ans_max, sep=' ')

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
B = [0] * 9
for a in A:
  if a < 3200:
  	B[a // 400] = 1
  else:
    B[8] += 1
print(max(sum(B[:8]), 1), min(8, sum(B)))

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
B = [0] * 9
for a in A:
  if a < 3200:
  	B[a // 400] = 1
  else:
    B[8] += 1
print(max(sum(B[:8]), int(B[8]>=1)), min(8, sum(B)))

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
B = [0] * 9
for a in A:
  if a < 3200:
  	B[a // 400] = 1
  else:
    B[8] += 1
print(max(sum(B[:8]), B[8]), min(8, sum(B)))

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
B = [0] * 9
for a in A:
  if a < 3200:
  	B[a // 400] = 1
  else:
    B[8] += 1
print(min(8, sum(B)))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
r=[0]*9
for a in A:
  for i in range(8,-1,-1):
    if a >= 400*i:
      r[i]+=1
      break
ans=0
for i in range(8):
  if r[i]>0: ans+=1
print(ans, ans+r[8])

Submission status: Wrong Answer

Solution code:
import collections

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

B = []
cnt = 0
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    else:
        B.append(A[i]//400)
print(B)
c = collections.Counter(B)

small = len(c) if len(c) != 0 else 1
big = len(c)+cnt

print(small, big)

Submission status: Wrong Answer

Solution code:
import collections

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

B = []
cnt = 0
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    else:
        B.append(A[i]//400)

c = collections.Counter(B)

small = len(c) if len(c) != 0 else 1
big = min(8, len(c)+cnt)

print(small, big)

Submission status: Wrong Answer

Solution code:
import collections

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

B = []
cnt = 0
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    else:
        B.append(A[i]//400)

c = collections.Counter(B)

print(max(1, len(c)), min(8, len(c)+cnt))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split(' ')))
rate = [0]*9
for a in A:
    c = min(a//400, 8)
    rate[c] += 1
count = 0
i = 0
while i < 8:
    if rate[i] != 0:
        count += 1
    i += 1
cmax = min(count+rate[8], 8)
cmin = max(1, count)

print(str(cmin)+' '+str(cmax))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split(' ')))
rate = [0]*9
for a in A:
    c = a//400
    if c >= 9:
        c = 8
    rate[c] += 1
count = 0
i = 0
while i < 8:
    if rate[i] != 0:
        count += 1
    i += 1
if rate[8] == 0:
    cmin, cmax = count, count
else:
    if count == 0:
        cmin, cmax = 1, min(rate[8], 8)
    else:
        cmin, cmax = count, min(8, count + rate[8])
print(str(cmin)+' '+str(cmax))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
ans = [0]*8
count = 0
for i in a:
    if i < 400:
        ans[0] += 1
    elif i < 800:
        ans[1] += 1
    elif i < 1200:
        ans[2] += 1
    elif i < 1600:
        ans[3] += 1
    elif i < 2000:
        ans[4] += 1
    elif i < 2400:
        ans[5] += 1
    elif i < 2800:
        ans[6] += 1
    elif i < 3200:
        ans[7] += 1
    else:
        count += 1
count1 = 0
for i in ans:
    if i!=0:
        count1 += 1
mn = count1
mx = count1 + count
print(mn,mx)

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
lightblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for rate in a:
    if 1 <= rate <= 399:
        gray += 1
    elif 400 <= rate <= 799:
        brown += 1
    elif 800 <= rate <= 1199:
        green += 1
    elif 1200 <= rate <= 1599:
        lightblue += 1
    elif 1600 <= rate <= 1999:
        blue += 1
    elif 2000 <= rate <= 2399:
        yellow += 1
    elif 2400 <= rate <= 2799:
        orange += 1
    elif 2800 <= rate <= 3199:
        red += 1
    else:
        other += 1

s = [gray, brown, green, lightblue, blue, yellow, orange, red]
s = list(filter(lambda x: x > 0, s))

cnt = len(s)

cnt1 = max(1, cnt)

print('{} {}'.format(cnt1,  cnt1+other))

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
lightblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for rate in a:
    if 1 <= rate <= 399:
        gray += 1
    elif 400 <= rate <= 799:
        brown += 1
    elif 800 <= rate <= 1199:
        green += 1
    elif 1200 <= rate <= 1599:
        lightblue += 1
    elif 1600 <= rate <= 1999:
        blue += 1
    elif 2000 <= rate <= 2399:
        yellow += 1
    elif 2400 <= rate <= 2799:
        orange += 1
    elif 2800 <= rate <= 3199:
        red += 1
    else:
        other += 1

s = [gray, brown, green, lightblue, blue, yellow, orange, red]
s = list(filter(lambda x: x > 0, s))

minimum = len(s)
maximum = len(s) + other

print('{} {}'.format(minimum, maximum))

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
lightblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for rate in a:
    if 1 <= rate <= 399:
        gray += 1
    elif 400 <= rate <= 799:
        brown += 1
    elif 800 <= rate <= 1199:
        green += 1
    elif 1200 <= rate <= 1599:
        lightblue += 1
    elif 1600 <= rate <= 1999:
        blue += 1
    elif 2000 <= rate <= 2399:
        yellow += 1
    elif 2400 <= rate <= 2799:
        orange += 1
    elif 2800 <= rate <= 3199:
        red += 1
    else:
        other += 1

s = [gray, brown, green, lightblue, blue, yellow, orange, red]
s = list(filter(lambda x: x > 0, s))

minimum = len(s)
maximum = len(s) + other if len(s)+other <= 8 else 8

print('{} {}'.format(minimum, maximum))

Submission status: Wrong Answer

Solution code:
N=int(input()); A=list(map(int,input().split()))
L=[[1,399],[400,799],[800,1199],[1200,1599],[1600,1999],[2000,2399],[2400,2799],[2800,3199],[3200,4800]]
S=[0]*9;cnt=0
for i in range(N):
  for j in range(9):
    if L[j][0]<=A[i]<=L[j][1]:
      S[j]=S[j]+1
for i in range(8):
  if S[i]!=0:
    cnt=cnt+1
cnt=max(1,cnt)
print(cnt,cnt+S[-1])

Submission status: Wrong Answer

Solution code:
N=int(input()); A=list(map(int,input().split()))
L=[[1,399],[400,799],[800,1199],[1200,1599],[1600,1999],[2000,2399],[2400,2799],[2800,3199],[3200,4800]]
S=[0]*9;cnt=0
for i in range(N):
  for j in range(9):
    if L[j][0]<=A[i]<=L[j][1]:
      S[j]=S[j]+1
for i in range(8):
  if S[i]!=0:
    cnt=cnt+1
print(cnt,cnt+S[-1])

Submission status: Wrong Answer

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

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

mini = len([i for i in color if i])
maxi = mini + free
print(mini, maxi)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0 for i in range(15)]
for some in a:
    b[some//400]+=1
ans=0
for i in range(8):
    if b[i]>0:
        ans+=1
mini=ans
for i in range(8,15):
    ans+=b[i]
print(mini,ans)

Submission status: Wrong Answer

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

colors = set()
other = 0
for num in list_A:
    num //= 400
    if num > 7:
        other += 1
    else:
        colors.add(num)

max_value = len(colors) + other
min_value = len(colors)

if max_value > 8:
    max_value = 8
    
if len(colors) == 0:
    min_value = 1

print(min_value, max_value)

Submission status: Wrong Answer

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

colors = set()
other = 0
for num in list_A:
    num //= 400
    if num > 7:
        other += 1
    else:
        colors.add(num)
print(colors)
max_value = len(colors) + other
min_value = len(colors)

if max_value > 8:
    max_value = 8
if len(colors) == 0:
    min_value = 1

print(min_value, max_value)

Submission status: Wrong Answer

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

colors = set()
other = 0
for num in list_A:
    num //= 400
    if num > 7:
        other += 1
    else:
        colors.add(num)

max_value = len(colors) + other
min_value = len(colors)

if max_value > 8:
    max_value = 8

print(min_value, max_value)

Submission status: Wrong Answer

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

colors = set()
other = 0
for num in list_A:
    num //= 400
    if num > 7:
        other += 1
    else:
        if num not in colors:
            colors.add(num)

max_value = len(colors) + other
min_value = len(colors)

if max_value > 8:
    max_value = 8

print(min_value, max_value)

Submission status: Wrong Answer

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

colors = set()
other = 0
for num in list_A:
    num //= 400
    if num > 7:
        other += 1
    else:
        if num not in colors:
            colors.add(num)

max_value = len(colors) + other
min_value = len(colors)

if max_value > 8:
    max_value = 7

print(min_value, max_value)

Submission status: Wrong Answer

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

colors = set()
other = 0
for num in list_A:
    num //= 400
    if num > 7:
        other += 1
    else:
        if num not in colors:
            colors.add(num)

max_value = len(colors)
min_value = len(colors)

if len(colors) < 7:
    max_value += other

if max_value > 7:
    max_value = 7

print(min_value, max_value)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
H = 0
C = 0
M = 0
W = 0
B = 0
Y = 0
O = 0
R = 0

tuyo = 0

for i in range(N):
  if 0 < a[i] < 400 and H == 0:
    H += 1
  elif 399 < a[i] < 800 and C == 0:
    C += 1
  elif 799 < a[i] < 1200 and M == 0:
    M += 1
  elif 1199 < a[i] < 1600 and W == 0:
    W += 1
  elif 1599 < a[i] < 2000 and B == 0:
    B += 1
  elif 1999 < a[i] < 2400 and Y == 0:
    Y += 1
  elif 2399< a[i] < 2800 and O == 0:
    O += 1
  elif 2799 < a[i] < 3200 and R == 0:
    R += 1
  elif a[i] > 3199:
    tuyo += 1
min = H + C + M + W + B + Y + O + R 
if min == 0:
  min = 1
  tuyo -= 1
if min + tuyo < 8:
  max = min + tuyo
else:
  max = 8
print(min,max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
H = 0
C = 0
M = 0
W = 0
B = 0
Y = 0
O = 0
R = 0

tuyo = 0

for i in range(N):
  if 0 < a[i] < 400 and H == 0:
    H += 1
  elif 399 < a[i] < 800 and C == 0:
    C += 1
  elif 799 < a[i] < 1200 and M == 0:
    M += 1
  elif 1199 < a[i] < 1600 and W == 0:
    W += 1
  elif 1599 < a[i] < 2000 and B == 0:
    B += 1
  elif 1999 < a[i] < 2400 and Y == 0:
    Y += 1
  elif 2399< a[i] < 2800 and O == 0:
    O += 1
  elif 2799< a[i] < 3200 and R == 0:
    R += 1
  elif a[i] > 3199:
    tuyo += 1
min = H + C + M + W + B + Y + O + R 
if min == 0:
  min = 1
  tuyo -= 1
if min + tuyo < 8:
  max = min + tuyo
else:
  max = 8
print(min,max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
H = 0
C = 0
M = 0
W = 0
B = 0
Y = 0
O = 0
R = 0

tuyo = 0

for i in range(N):
  if 0 < a[i] < 400 and H == 0:
    H += 1
  elif 399 < a[i] < 800 and C == 0:
    C += 1
  elif 799 < a[i] < 1200 and M == 0:
    M += 1
  elif 1199 < a[i] < 1600 and W == 0:
    W += 1
  elif 1599 < a[i] < 2000 and B == 0:
    B += 1
  elif 1999 < a[i] < 2400 and Y == 0:
    Y += 1
  elif 2399< a[i] < 2800 and O == 0:
    O += 1
  elif 2799< a[i] < 3200 and R == 0:
    R += 1
  elif a[i] > 3199:
    tuyo += 1
min = H + C + M + W + B + Y + O + R 
if min + tuyo < 8:
  max = min + tuyo
else:
  max = 8
print(min,max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
col1 = []
col2 = []
for i in a:
    if i//400<8:
        col1.append(i//400)
    else:
        col2.append(i//400)
min = len(set(col1))
if min == 0:
    min = 1

max = len(set(col1))+len(col2)
if max>8:
    max = 8

print(min, max)

Submission status: Wrong Answer

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

cou = 0
for i in range(8):
    if p[i] == 1:
        cou += 1

if cou != 0 and cou + p[8] >= 8:
    print(str(cou) + " " + str(8))
elif cou == 0 and p[8] >= 8:
    print(str(1) + " " + str(8))
elif cou != 0 and cou + p[8] < 8:
    print(str(cou) + " " + str(cou + p[8]))
elif cou == 0 and p[8] < 8:
    print(str(1) + " " + str(p[8]))

Submission status: Wrong Answer

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

cou = 0
for i in range(8):
    if p[i] == 1:
        cou += 1

if cou != 0 and cou + p[8] >= 7:
    print(str(cou) + " " + str(7))
elif cou == 0 and p[8] >= 7:
    print(str(1) + " " + str(7))
elif cou != 0 and cou + p[8] < 7:
    print(str(cou) + " " + str(cou + p[8]))
elif cou == 0 and p[8] < 7:
    print(str(1) + " " + str(p[8]))

Submission status: Wrong Answer

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

c = []
xn = 0
TF = [False for _ in range(8)]
for r in a:
    if r <= 399:
        TF[0] = True
    elif 400 <= r <= 799:
        TF[1] = True
    elif 800 <= r <= 1199:
        TF[2] = True
    elif 1200 <= r <= 1599:
        TF[3] = True
    elif 1600 <= r <= 1999:
        TF[4] = True
    elif 2000 <= r <= 2399:
        TF[5] = True
    elif 2400 <= r <= 2799:
        TF[6] = True
    elif 2800 <= r <= 3199:
        TF[7] = True
    else:
        xn += 1
truenum = sum(1 for i in TF if i)
minv = truenum
maxv = truenum + xn
print(minv, maxv)

Submission status: Wrong Answer

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

c = []
xn = 0
TF = [False for _ in range(8)]
for r in a:
    if r <= 399:
        c.append(0)
        TF[0] = True
    elif 400 <= r <= 799:
        c.append(1)
        TF[1] = True
    elif 800 <= r <= 1199:
        c.append(2)
        TF[2] = True
    elif 1200 <= r <= 1599:
        c.append(3)
        TF[3] = True
    elif 1600 <= r <= 1999:
        c.append(4)
        TF[4] = True
    elif 2000 <= r <= 2399:
        c.append(5)
        TF[5] = True
    elif 2400 <= r <= 2799:
        c.append(6)
        TF[6] = True
    elif 2800 <= r <= 3199:
        c.append(7)
        TF[7] = True
    else:
        c.append(100)
        xn += 1
truenum = sum(1 for i in TF if i)
minv = truenum
maxv = truenum + xn
if maxv > 8:
    maxv = 8
print(minv, maxv)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(lambda x:min(int(x)//400,8),input().split()))
cat=[0]*8
f=0
for ai in a:
    if ai < 8:
        cat[ai]=1
    if ai == 8:
        f+=1
print(str(max(sum(cat),1))+' '+str(min(sum(cat)+f,8)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(lambda x:int(x)//400,input().split()))
cat=[0]*13
"""
cat=[0]*9
for ai in a:
    if ai < 8:
        cat[ai]=1
    else:
        cat[8]+=1
print(str(max(sum(cat[:8]),1))+' '+str(min(sum(cat),8)))
"""
for ai in a:
    cat[ai]+=1
print(str(max(sum([x > 0 for x in cat[:8]]),1))+' '+str(min(sum([x > 0 for x in cat[:8]])+sum(cat[8:]),8)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(lambda x:int(x)//400,input().split()))
cat=[0]*9
for ai in a:
    if ai < 8:
        cat[ai]=1
    else:
        cat[8]+=1
print(str(max(sum(cat[:8]),1))+' '+str(min(sum(cat),8)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list((map(int,input().split())))
l=[0 for _ in range(8)]
f=0
for i in range(n):
    r=a[i]//400
    if r<8:
        l[r]+=1
    else:
        f+=1
amin=0
amax=0
for i in range(len(l)):
    if l[i]>=1:
        amin+=1
        
print(amin,amin+f)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
L = [0 for _ in range(8)]
N = int(input())
A = list(map(int, input().split()))
v = 0
for i in range(N):
    idx = A[i] // 400
    if idx >= 8:
        v += 1
    else:
        L[idx] += 1
amin, amax = 0, 0
for i in range(len(L)):
    if L[i] > 0:
        amin += 1
    # if L[i] == 0 and v > 0:
    #     L[i] += 1
    #     v -= 1
amin = max(1, amin)
# for i in range(len(L)):
#     if L[i] > 0:
#         amax += 1
print(amin, amin + v)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
L = [0 for _ in range(8)]
N = int(input())
A = list(map(int, input().split()))
v = 0
for i in range(N):
    idx = A[i] // 400
    if idx >= 8:
        v += 1
    else:
        L[idx] += 1
amin, amax = 0, 0
for i in range(len(L)):
    if L[i] > 0:
        amin += 1
    if L[i] == 0 and v > 0:
        L[i] += 1
        v -= 1
amin = max(1, amin)
for i in range(len(L)):
    if L[i] > 0:
        amax += 1
print(amin, amax)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = [0,0,0,0,0,0,0,0,0]

for i in a:

    count[0] += 1 if i in range(1, 400)     and count[0] == 0 else 0
    count[1] += 1 if i in range(400, 800)   and count[1] == 0 else 0
    count[2] += 1 if i in range(800, 1200)  and count[2] == 0 else 0
    count[3] += 1 if i in range(1200, 1600) and count[3] == 0 else 0
    count[4] += 1 if i in range(1600, 2000) and count[4] == 0 else 0
    count[5] += 1 if i in range(2000, 2400) and count[5] == 0 else 0
    count[6] += 1 if i in range(2400, 2800) and count[6] == 0 else 0
    count[7] += 1 if i in range(2800, 3200) and count[7] == 0 else 0

    count[8] += 1 if i >= 3200 else 0


print("{} {}".format(sum(count[:-1]), sum(count)))

Submission status: Wrong Answer

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

count = [0,0,0,0,0,0,0,0,0]

for i in a:

    count[0] += 1 if i in range(1, 400)     and count[0] == 0 else 0
    count[1] += 1 if i in range(400, 800)   and count[1] == 0 else 0
    count[2] += 1 if i in range(800, 1200)  and count[2] == 0 else 0
    count[3] += 1 if i in range(1200, 1600) and count[3] == 0 else 0
    count[4] += 1 if i in range(1600, 2000) and count[4] == 0 else 0
    count[5] += 1 if i in range(2000, 2400) and count[5] == 0 else 0
    count[6] += 1 if i in range(2400, 2800) and count[6] == 0 else 0
    count[7] += 1 if i in range(2800, 3200) and count[7] == 0 else 0

    count[8] += 1 if i >= 3200 else 0

print(sum(count[:-1]), sum(count))

Submission status: Wrong Answer

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

count = [0,0,0,0,0,0,0,0,0]

for i in a:

    count[0] += 1 if i in range(1, 400)     and count[0] == 0 else 0
    count[1] += 1 if i in range(400, 800)   and count[1] == 0 else 0
    count[2] += 1 if i in range(800, 1200)  and count[2] == 0 else 0
    count[3] += 1 if i in range(1200, 1600) and count[3] == 0 else 0
    count[4] += 1 if i in range(1600, 2000) and count[4] == 0 else 0
    count[5] += 1 if i in range(2000, 2400) and count[5] == 0 else 0
    count[6] += 1 if i in range(2400, 2800) and count[6] == 0 else 0
    count[7] += 1 if i in range(2800, 3200) and count[7] == 0 else 0

    count[8] += 1 if i >= 3200 else 0

Submission status: Wrong Answer

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

color = [0 for j in range(9)]

for i in range(N):
    if a[i] >= 3200:
        color[8] += 1
    else:
        for j in range(8):
            if a[i] // 400 == j:
                color[j] += 1

color_min = 8 - color[:8].count(0)
if 8 - color_min <= color[8]:
    color_max = 8
else:
    color_max = color_min + color[8]
if color_min == 0:
        color_min = 1
print(color_min, color_max)

Submission status: Wrong Answer

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

color = [0 for j in range(9)]

for i in range(N):
    if a[i] >= 3200:
        color[8] += 1
    else:
        for j in range(8):
            if a[i] // 400 == j:
                color[j] += 1

color_min = 8 - color[:8].count(0)
if 8 - color_min <= color[8]:
    if color_min == 0:
        color_min = 1
    color_max = 8
else:
    color_max = color_min + color[8]
print(color_min, color_max)

Submission status: Wrong Answer

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

color = [0 for j in range(9)]

for i in range(N):
    if a[i] >= 3200:
        color[8] += 1
    else:
        for j in range(8):
            if a[i] // 400 == j:
                color[j] += 1

color_min = 8 - color[:8].count(0)
if 8 - color_min <= color[8]:
    color_max = 8
else:
    color_max = color_min + color[8]
print(color_min, color_max)

Submission status: Wrong Answer

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

color = [0 for j in range(9)]

for i in range(N):
    if a[i] >= 3200:
        color[8] += 1
    else:
        for j in range(8):
            if a[i] // 400 == j:
                color[j] += 1

color_min = 8 - color[:8].count(0)
if color.count(0) <= color[8]:
    color_max = 8
else:
    color_max = color_min + color[8]
print(color_min, color_max)

Submission status: Wrong Answer

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

rates = set()
NUM_RATES = 8
cnt = 0
for a in A:
    if (a < 400):
        rates.add(0)
    elif (400 <= a and a < 800):
        rates.add(1)
    elif (800 <= a and a < 1200):
        rates.add(2)
    elif (1200 <= a and a < 1600):
        rates.add(3)
    elif (1600 <= a and a < 2000):
        rates.add(4)
    elif (2000 <= a and a < 2400):
        rates.add(5)
    elif (2400 <= a and a < 2800):
        rates.add(6)
    elif (2800 <= a and a < 3200):
        rates.add(7)
    else:
        cnt += 1

print(len(rates), len(rates) + cnt)

Submission status: Wrong Answer

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

rates = set()
NUM_RATES = 8
cnt = 0
for a in A:
    if (a < 400):
        rates.add(0)
    elif (400 <= a and a < 800):
        rates.add(1)
    elif (800 <= a and a < 1200):
        rates.add(2)
    elif (1200 <= a and a < 1600):
        rates.add(3)
    elif (1600 <= a and a < 2000):
        rates.add(4)
    elif (2000 <= a and a < 2400):
        rates.add(5)
    elif (2400 <= a and a < 2800):
        rates.add(6)
    elif (2800 <= a and a < 3200):
        rates.add(7)
    else:
        cnt += 1

print(len(rates), min(NUM_RATES, len(rates) + cnt))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
red = 0
ans = 0
cnt = [0]*10
for x in a:
    if x < 3200:
        cnt[x//400] +=1
    else:
        red+=1
for x in cnt:
    if x >0:ans+=1

if red == n:ans = 1
print(ans)
ans+=max(red,8)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
red = 0
ans = 0
cnt = [0]*10
for x in a:
    if x < 3200:
        cnt[x//400] +=1
    else:
        red+=1
for x in cnt:
    if x >0:ans+=1

if red == n:ans = 1
print(ans)
ans+=red
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
red = 0
ans = 0
cnt = [0]*10
for x in a:
    if x < 3200:
        cnt[x//400] +=1
    else:
        red+=1
for x in cnt:
    if x >0:ans+=1


print(ans)
if red >0:ans+=red
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
red = 0
ans = 0
cnt = [0]*10
for x in a:
    if x < 2800:
        cnt[x//400] +=1
    else:
        red+=1
for x in cnt:
    if x >0:ans+=1
if red >0:ans+=1

print(ans)
if red >0:ans+=red-1
print(ans)

Submission status: Wrong Answer

Solution code:
N= int(input())
A = list(map(int, input().split()))
che = []
free = 0
for i in range(N):
    if A[i] <= 399:
        che.append("hai")
    elif A[i] >= 400 and A[i] <= 799:
        che.append("cha")
    elif A[i] > 799 and A[i] <= 1199:
        che.append("mid")
    elif A[i] > 1199 and A[i] <= 1599:
        che.append("miz")
    elif A[i] > 1599 and A[i] <= 1999:
        che.append("ao")
    elif A[i] > 1999 and A[i] <= 2399:
        che.append("kii")
    elif A[i] > 2399 and A[i] <= 2799:
        che.append("dau")
    elif A[i] > 2799 and A[i] <= 3199:
        che.append("aka")
    else:
        free += 1
#print(che)
result = set(che)
print(len(result),len(result)+free)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
o=0
x=[]
for i in range(n):
  if a[i]>=3200:
    o+=1
  else:
    x.append(a[i]//400)
p=len(set(x))
print(p,o+p)