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())
arr = list(map(int, input().split()))
mx = 0
mn = 0
d = {}
colors = ["gray", "brown", "green", "cyan", "blue", "yellow", "orange", "red"]
for i in colors:
  d[i] = 0
for i in arr:
  if i in range(1, 400):
    if d["gray"] == 0:
      mx += 1
      mn += 1
    d["gray"] = 1
  elif i in range(400, 800):
    if d["brown"] == 0:
      mx += 1
      mn += 1
    d["brown"] = 1
  elif i in range(800, 1200):
    if d["green"] == 0:
      mx += 1
      mn += 1
    d["green"] = 1
  elif i in range(1200, 1600):
    if d["cyan"] == 0:
      mx += 1
      mn += 1
    d["cyan"] = 1
  elif i in range(1600, 2000):
    if d["blue"] == 0:
      mx += 1
      mn += 1
    d["blue"] = 1
  elif i in range(2000, 2400):
    if d["yellow"] == 0:
      mx += 1
      mn += 1
    d["yellow"] = 1
  elif i in range(2400, 2800):
    if d["orange"] == 0:
      mx += 1
      mn += 1
    d["orange"] = 1
  elif i in range(2800, 3200):
    if d["red"] == 0:
      mx += 1
      mn += 1
    d["red"] = 1
  else:
    for k, v in d.items():
      if v == 0:
        mx += 1
        d[k] = 1
        break
print(mx, mn)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(result_min, result_max)

Submission status: Wrong Answer

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

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

print(result_min, result_max)

Submission status: Wrong Answer

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

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

print(result_min, result_max)

Submission status: Wrong Answer

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

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

print(result_min, result_max)

Submission status: Wrong Answer

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

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

print(result_min, result_max)

Submission status: Wrong Answer

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

c = [0] * 8
r = 0

for i in a:
    col = i // 400
    if col <= 7:
        c[col] = 1
    else:
        r += 1

c = sum(c)

print(max(1, c))
print(min(8,r+c))

Submission status: Wrong Answer

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

c = [0] * 8
r = 0

for i in a:
    col = i // 400
    if col <= 7:
        c[col] = 1
    else:
        r += 1

c = sum(c)

print(c)
print(min(8,r+c))

Submission status: Wrong Answer

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

c = [0] * 8
r = 0

for i in a:
    col = i // 400
    if col <= 7:
        c[col] = 1
    else:
        r += 1

c = sum(c)

print(min(8, r) if r>c else c)
print(min(8,r+c))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(lambda x:int(x)//400, input().split()))

r = len(set(range(8)) & set(a))
cnt = 0
for i in a:
    if i >= 8: cnt += 1

x, y = r, r+cnt
print(x, y)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
colors = [a // 400 for a in A]
fixed_colors = len(set(c for c in colors if c <= 7))
free = sum(c >= 8 for c in colors)
if fixed_colors == 0:
    print(1, min(free, 8))
else:
    print(fixed_colors, min(fixed_colors + free, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
colors = [a // 400 for a in A]
fixed_colors = len(set(c for c in colors if c <= 7))
free = sum(c >= 8 for c in colors)
print(max(fixed_colors, 1), min(fixed_colors + free, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
colors = [a // 400 for a in A]
fixed_colors = set(c for c in colors if c <= 7)
free = sum(c >= 8 for c in colors)
print(len(fixed_colors), min(len(fixed_colors) + free, 8))

Submission status: Wrong Answer

Solution code:
_ = input()
A = list(map(int,input().rstrip().split(" ")))
ans = [0,0]
q = [0 for i in range(9)]
for i in A:
    q[min(8,i // 400)] += 1
for i in range(9):
    if i == 8:
        ans[1] += q[i]
    else:
        if q[i] != 0:
            ans[0] += 1
            ans[1] += 1
print(str(ans[0]) + " " + str(ans[1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(N):
  if A[i]<=399:
    color.add(1)
  elif A[i]<=799:
    color.add(2)
  elif A[i]<=1199:
    color.add(3)
  elif A[i]<=1599:
    color.add(4)
  elif A[i]<=2399:
    color.add(5)
  elif A[i]<=2799:
    color.add(5)
  elif A[i]<=3199:
    color.add(6)
  else:
    over_3200+=1
    
print(len(color),len(color)+over_3200)

Submission status: Wrong Answer

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

colors = [0] * 9
for a in A:
    idx = a // 400
    if idx >= 8:
        idx = 8
    colors[idx] += 1
ans = 0
for i in range(8):
    if colors[i] > 0:
        ans += 1
max_ans = ans
if colors[8] > 0:
    max_ans += colors[8]
print(ans, max_ans)

Submission status: Wrong Answer

Solution code:

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

colors = [0] * 9
for a in A:
    idx = a // 400
    if idx > 8:
        idx = 8
    colors[idx] += 1
ans = 0
for i in range(8):
    if colors[i] > 0:
        ans += 1
max_ans = ans
if colors[8] > 0:
    max_ans += colors[8]
max_ans = min(8, max_ans)
print(ans, max_ans)

Submission status: Wrong Answer

Solution code:

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

colors = [0] * 9

for a in A:
    idx = a // 400
    if idx > 8:
        idx = 8
    colors[idx] += 1

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

max_ans = ans
if colors[8] > 0:
    max_ans += colors[8]
print(ans, max_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(T) for T in input().split()]
Color = [T//400 for T in A if T<3200]
MIN = len(set(Color))
MAX = len(set(Color))+(N-len(Color))
print('{} {}'.format(MIN,MAX))

Submission status: Wrong Answer

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

d = {'gry':0,'brw':0,'grn':0,'miz':0,'blu':0,'yel':0,'dai':0,'red':0,'any':0}
for i in a:
    if 1 <= i <= 399:
        d['gry'] += 1
    elif 400 <= i <= 799:
        d['brw'] += 1
    elif 800 <= i <= 1199:
        d['grn'] += 1
    elif 1200 <= i <= 1599:
        d['miz'] += 1
    elif 1600 <= i <= 1999:
        d['blu'] += 1
    elif 2000 <= i <= 2399:
        d['yel'] += 1
    elif 2400 <= i <= 2799:
        d['dai'] += 1
    elif 2800 <= i <= 3199:
        d['red'] += 1
    else: #any
        d['any'] += 1

ans = 0
zero = 0
for k,v in d.items():
    if k == 'any':
        pass
    else:
        if v == 0:
            zero += 1
        else:
            ans += 1

print (max(1,ans),ans+min(zero,d['any']))

Submission status: Wrong Answer

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

d = {'gry':0,'brw':0,'grn':0,'miz':0,'blu':0,'yel':0,'dai':0,'red':0,'any':0}
for i in a:
    if 1 <= i <= 399:
        d['gry'] += 1
    elif 400 <= i <= 799:
        d['brw'] += 1
    elif 800 <= i <= 1199:
        d['grn'] += 1
    elif 1200 <= i <= 1599:
        d['miz'] += 1
    elif 1600 <= i <= 1999:
        d['blu'] += 1
    elif 2000 <= i <= 2399:
        d['yel'] += 1
    elif 2400 <= i <= 2799:
        d['dai'] += 1
    elif 2800 <= i <= 3199:
        d['red'] += 1
    else: #any
        d['any'] += 1

ans = 0
zero = 0
for k,v in d.items():
    if k == 'any':
        pass
    else:
        if v == 0:
            zero += 1
        else:
            ans += 1

print (ans,ans+min(zero,d['any']))

Submission status: Wrong Answer

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

d = {'gry':0,'brw':0,'grn':0,'miz':0,'blu':0,'yel':0,'dai':0,'red':0,'any':0}
for i in a:
    if 1 <= i <= 399:
        d['gry'] += 1
    elif 400 <= i <= 799:
        d['brw'] += 1
    elif 800 <= i <= 1199:
        d['grn'] += 1
    elif 1200 <= i <= 1599:
        d['miz'] += 1
    elif 1600 <= i <= 1999:
        d['blu'] += 1
    elif 2000 <= i <= 2399:
        d['yel'] += 1
    elif 2400 <= i <= 2799:
        d['dai'] += 1
    elif 2800 <= i <= 3199:
        d['red'] += 1
    else: #any
        d['any'] += 1

ans = 0
zero = 0
for k,v in d.items():
    if k == 'any':
        pass
    else:
        if v == 0:
            zero += 1
        else:
            print (k)
            ans += 1

print (ans,ans+min(zero,d['any']))

Submission status: Wrong Answer

Solution code:
n = int(input())
et=0
arr = list(map(int , input().split()))
count = [0 for i in range(0,10)]
for i in range(0 , n):
	if arr[i]>=1 and arr[i]<=399:
		count[0]=count[0]+1
	elif arr[i]>=400 and arr[i]<=799:
		count[1]=count[1]+1
	elif arr[i]>=800 and arr[i]<=1199:
		count[2]=count[2]+1
	elif arr[i]>=1200 and arr[i]<=1599:
		count[3]=count[3]+1
	elif arr[i]>=1600 and arr[i]<=1999:
		count[4]=count[4]+1
	elif arr[i]>=2000 and arr[i]<=2399:
		count[5]=count[5]+1
	elif arr[i]>=2400 and arr[i]<=2799:
		count[6]=count[6]+1
	elif arr[i]>=2800 and arr[i]<=3199:
		count[7]=count[7]+1
	else:
		et = et+1
mn =1000
mx =0
tot=0
for i in range(0, 8):
	if count[i]>0:
		tot=tot+1
if tot==0:
	print(1)
else:
	print(tot , tot+et)

Submission status: Wrong Answer

Solution code:
n = int(input())
et=0
arr = list(map(int , input().split()))
count = [0 for i in range(0,10)]
for i in range(0 , n):
	if arr[i]>=1 and arr[i]<=399:
		count[0]=count[0]+1
	elif arr[i]>=400 and arr[i]<=799:
		count[1]=count[1]+1
	elif arr[i]>=800 and arr[i]<=1199:
		count[2]=count[2]+1
	elif arr[i]>=1200 and arr[i]<=1599:
		count[3]=count[3]+1
	elif arr[i]>=1600 and arr[i]<=1999:
		count[4]=count[4]+1
	elif arr[i]>=2000 and arr[i]<=2399:
		count[5]=count[5]+1
	elif arr[i]>=2400 and arr[i]<=2799:
		count[6]=count[6]+1
	elif arr[i]>=2800 and arr[i]<=3199:
		count[7]=count[7]+1
	else:
		et = et+1
mn =1000
mx =0
tot=0
for i in range(0, 8):
	if count[i]>0:
		tot=tot+1
if tot==0 :
	print(1)
else:
	print(tot , min(tot+et, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
et=0
arr = list(map(int , input().split()))
count = [0 for i in range(0,10)]
for i in range(0 , n):
	if arr[i]>=1 and arr[i]<=399:
		count[0]=count[0]+1
	elif arr[i]>=400 and arr[i]<=799:
		count[1]=count[1]+1
	elif arr[i]>=800 and arr[i]<=1199:
		count[2]=count[2]+1
	elif arr[i]>=1200 and arr[i]<=1599:
		count[3]=count[3]+1
	elif arr[i]>=1600 and arr[i]<=1999:
		count[4]=count[4]+1
	elif arr[i]>=2000 and arr[i]<=2399:
		count[5]=count[5]+1
	elif arr[i]>=2400 and arr[i]<=2799:
		count[6]=count[6]+1
	elif arr[i]>=2800 and arr[i]<=3199:
		count[7]=count[7]+1
	else:
		et = et+1
mn =1000
mx =0
tot=0
for i in range(0, 8):
	if count[i]>0:
		tot=tot+1
print(tot , min(tot+et, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
et=0
arr = list(map(int , input().split()))
count = [0 for i in range(0,10)]
for i in range(0 , n):
	if arr[i]>=1 and arr[i]<=399:
		count[0]=count[0]+1
	elif arr[i]>=400 and arr[i]<=799:
		count[1]=count[1]+1
	elif arr[i]>=800 and arr[i]<=1199:
		count[2]=count[2]+1
	elif arr[i]>=1200 and arr[i]<=1599:
		count[3]=count[3]+1
	elif arr[i]>=1600 and arr[i]<=1999:
		count[4]=count[4]+1
	elif arr[i]>=2000 and arr[i]<=2399:
		count[5]=count[5]+1
	elif arr[i]>=2400 and arr[i]<=2799:
		count[6]=count[6]+1
	elif arr[i]>=2800 and arr[i]<=3199:
		count[7]=count[7]+1
	else:
		et = et+1
mn =1000
mx =0
tot=0
for i in range(1, 9):
	if count[i]>0:
		tot=tot+1
print(tot , min(tot+et, 8))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
o=0
m=0
u=[0]*8
for i in a:
    if 3199<i:
        o+=1
    else:
        if u[i//400]==0:
            u[i//400]+=1
            m+=1
print(m,m+o)

Submission status: Wrong Answer

Solution code:
#8
n = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(8)]
cnt = 0

for i in a:
    x = i//400
    if x >=8:
        cnt +=1
    else:
        if num[x] == 0:
            num[x] +=1
    
if cnt == 0:
    print(sum(num),sum(num))
else:
    print(sum(num),sum(num)+cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(lambda x:int(x)//400, input().split()))

cnt = 0
for i in a:
    if i >= 8: cnt += 1

x = len(set(a))-(cnt>0)
y = len(set(a))+cnt-(cnt>0)
print(x, y)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum == 0 and cnt8 > 0:
    print(1, end=' ')
else:
    print(sum, end=' ')
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
print(cnt8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum == 0 and cnt8 > 0:
    print(1, end=' ')
else:
    print(sum, end=' ')
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum > cnt8:
    print(sum, end=' ')
else:
    if cnt8 > 8:
        print(8, end=' ')
    else:
        print(cnt8, end=' ')
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum > cnt8:
    print(sum, end=' ')
else:
    if cnt8 > 8:
        print(8)
    else:
        print(cnt8)
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum > cnt8:
    print(sum, end=' ')
else:
    print(cnt8, end=' ')
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum > cnt8:
    print(sum, end=' ')
else:
    print(cnt8)
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
print(sum, end=' ')
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
check = []
every = 0

for a in A:
    if a < 400:
        check.append(1)
    elif a < 800:
        check.append(2)
    elif a < 1200:
        check.append(3)
    elif a < 1600:
        check.append(4)
    elif a < 2000:
        check.append(5)
    elif a < 2400:
        check.append(6)
    elif a < 2800:
        check.append(7)
    elif a < 3200:
        check.append(8)
    else:
        every += 1
length = len(set(check))

print(length,length+every)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n=input()
A=[int(i) for i in input().split()]
c=defaultdict(int)
free=0
for a in A:
  if a > 3199:
    free+=1
  else:
    c[a//400]+=1
print(len(c),len(c)+free)

Submission status: Wrong Answer

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

rate = [0]*8
f = 0

for a in A:
    if a >= 3200:
        f += 1
    else:
        rate[a//400] = 1

if sum(rate) > 0:
    print(f"{sum(rate)} {sum(rate)+f}")
else:
    print(f"{f} {f}")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
count = {i:0 for i in range(9)}
for a in A:
    if a < 3200:
        count[a//400] = 1
    else:
        count[8] += 1
# print(count)
hp = sum([count[i] for i in count if i != 8])
print(hp + int(count[8] != 0 and hp == 0), min(8, hp + count[8]))

Submission status: Wrong Answer

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    vec = [0] * 8
    over_red = 0
    for a in A:
        if a >= 3200:
            over_red += 1
        else:
            vec[a // 400] += 1

    c = 0
    for v in vec:
        if v > 0:
            c += 1
    print(c, c + over_red)

    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

i=0
f1=f2=f3=f4=f5=f6=f7=f8=f9=0

while i<n:

    if 1<=a[i]<=399:

        f1=1

    elif 400<=a[i]<=799:

        f2=1

    elif 800<=a[i]<=1199:

        f3=1

    elif 1200<=a[i]<=1599:

        f4=1

    elif 1600<=a[i]<=1999:

        f5=1

    elif 2000<=a[i]<=2399:

        f6=1

    elif 2400<=a[i]<=2799:

        f7=1

    elif 2800<=a[i]<=3199:

        f8=1

    elif 3200<=a[i]:

        f9+=1

    i+=1

ans1 = f1+f2+f3+f4+f5+f6+f7+f8
ans2 = f1+f2+f3+f4+f5+f6+f7+f8+f9

print(str(ans1)+' '+str(ans2))

Submission status: Wrong Answer

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

i=0
f1=f2=f3=f4=f5=f6=f7=f8=f9=0

while i<n:

    if a[i] <= 399:

        f1=1

    elif 400<=a[i]<=799:

        f2=1

    elif 800<=a[i]<=1199:

        f3=1

    elif 1200<=a[i]<=1599:

        f4=1

    elif 1600<=a[i]<=1999:

        f5=1

    elif 2000<=a[i]<=2399:

        f6=1

    elif 2400<=a[i]<=2799:

        f7=1

    elif 2800<=a[i]<=3199:

        f8=1

    elif 3200<=a[i]:

        f9+=1

    i+=1

ans1 = f1+f2+f3+f4+f5+f6+f7+f8
ans2 = f1+f2+f3+f4+f5+f6+f7+f8+f9

if ans2>=8:
    print(str(ans1)+' 8')

else:
    print(str(ans1)+' '+str(ans2))

Submission status: Wrong Answer

Solution code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(input())
    return x

def int_map():
    return map(int,input().split())

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

N = int(input())
a = int_list()

color = set()

cnt = 0

for ai in a:
    for i in range(0,8):
        if 400*i <= ai and ai < 400*(i+1):
            color.add(i)
    if ai > 3199:
        cnt += 1

if cnt > 0:
    if len(color) == 0:
        cmin = 1
    else:
        cmin = len(color)
    
    cmax = min(8,len(color) + cnt)
else:
    cmin = len(color)
    cmax = len(color)

print(" ".join([str(cmin),str(cmax)]))

Submission status: Wrong Answer

Solution code:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
r=Counter([min(x//400,8) for x in a])
l=len(list(iter(r)))
if r[8]==0:
  print(l,l)
else:
  print(l-1,l-1+r[8])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
count = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        count[a[i]//400] += 1
    else:
        free += 1
print(7 - count.count(0) + 1, 7 - count.count(0) + free + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
col = [0]*8
over_cnt = 0
cnt_min = 0
cnt_max = 0
for i in range(n):
	if a[i] < 3200:
		col[(a[i])//400] += 1
		#print(col)
	else:
		over_cnt += 1
for j in range(8):
	#print(j)
	if col[j] > 0:
		cnt_min += 1
if cnt_min == 0:
	cnt_min = 1
	cnt_max = min(8,over_cnt)
else:
	cnt_max = min(8,(cnt_min+over_cnt))
print(cnt_min,cnt_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
col = [0]*8
over_cnt = 0
cnt_min = 0
cnt_max = 0
for i in range(n):
	if a[i] < 3200:
		col[(a[i])//400] += 1
	else:
		over_cnt += 1
for j in range(8):
	#print(j)
	if col[j] > 0:
		cnt_min += 1
if cnt_min == 0:
	cnt_min += 1
	cnt_max = min(8,over_cnt)
else:
	cnt_max = min(8,(cnt_min+over_cnt))
print(cnt_min,cnt_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
col = [0]*8
over_cnt = 0
cnt_min = 0
cnt_max = 0
for i in range(n):
	if a[i] < 3200:
		col[(a[i])//400] += 1
	else:
		over_cnt += 1
for j in col:
	#print(j)
	if j > 0:
		cnt_min += 1
if cnt_min == 0:
	cnt_min += 1
	cnt_max = min(8,over_cnt)
else:
	cnt_max = min(8,(cnt_min+over_cnt))
print(cnt_min,cnt_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
col = [0]*8
over_cnt = 0
cnt_min = 0
for i in range(n):
	if a[i] < 3200:
		col[(a[i])//400] += 1
	else:
		over_cnt += 1
for j in col:
	if j > 0:
		cnt_min += 1
if cnt_min == 0:
	cnt_min += 1
	cnt_max = min(8,over_cnt)
else:
	cnt_max = min(8,(cnt_min+ over_cnt))
print(cnt_min,cnt_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
col = [0]*8
over_cnt = 0
cnt_min = 0
for i in range(n):
	if a[i] < 3200:
		col[(a[i])//400] += 1
	else:
		over_cnt += 1
for j in col:
	if j > 0:
		cnt_min += 1
if cnt_min == 0:
	cnt_min += 1
cnt_max = min(8,(cnt_min+ over_cnt))
print(cnt_min,cnt_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
col = [0]*8
over_cnt = 0
cnt_min = 0
for i in range(n):
	if a[i] < 3200:
		col[(a[i])//400] += 1
	else:
		over_cnt += 1
for j in col:
	if j > 0:
		cnt_min += 1
cnt_max = min(8,(cnt_min+ over_cnt))
print(cnt_min,cnt_max)

Submission status: Wrong Answer

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

num_free = 0
num_color = [False] * 8
for rate in nums:
    if rate < 3200:
        num_color[rate // 400] = True
    else:
        num_free += 1

ans = sum(num_color)
print('{} {}'.format(ans, ans + num_free))

Submission status: Wrong Answer

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

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

rate = [400,800,1200,1600,2000,2400,2800,3200]
R = [False]*len(rate)
red_plus = 0

for a in A:
    if a >= rate[-1]:
        red_plus += 1
    else:
        for i,r in enumerate(rate):
            if a < r:
                R[i] = True
                break

print(R.count(True), R.count(True)+red_plus)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
count = {i:0 for i in range(9)}
for a in A:
    if a < 3200:
        count[a//400] = 1
    else:
        count[8] += 1
hp = sum([count[i] for i in count if i != 8])
print(hp + int(count[8] != 0 and hp == 0), min(8, hp + count[8]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
count = {i:0 for i in range(9)}
for a in A:
    if a < 3200:
        count[a//400] = 1
    else:
        count[8] += 1
hp = sum([count[i] for i in count if i != 8])
print(hp, min(8, hp + count[8]))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int,input().split()))
 
maxans = 0
minans = 0
 
color = [0]*8
red = 0
 
for i in s:
    if i>3199:
        red += 1
    else:
        color[(i-1)//400] = 1
        
x = sum(color)
 
print(x,x+red)

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)):
        #print((400*j),400*(j+1))
        if (400*j) <= i < 400*(j+1):
            lstc[j] += 1
            break
        elif i > 3600:
            lstc[-1] += 1
            
#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1

if lstc[-1] == 0:
    print(n,n)
elif nx == 0:
    print(1,lstc[-1])
else:
    print(nx,nx+lstc[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)):
        if (400*j+1) <= i < 400*(j+1):
            lstc[j] += 1
            break
#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1

if lstc[-1] == 0:
    print(n,n)
elif nx == 0:
    print(1,lstc[-1])
else:
    print(nx,nx+lstc[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)):
        if abs(i-lst[j]) < 400:
            lstc[j] += 1
            break

n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1

if lstc[-1] == 0:
    print(n,n)
elif nx == 0:
    print(1,lstc[-1])
else:
    print(nx,nx+lstc[-1])