Problem:


Score : 300 points

Problem Statement

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:  

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.

Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.

Find the minimum and maximum possible numbers of different colors of the users.  

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.  

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.  

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red".

If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors.

If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.  

Sample Input 3

20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990

Sample Output 3

1 1

All the users are "green", and thus there is one color.



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

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

ans1 = max(1,8-x.count(0))
ans2 = min(8,ans1+m)
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
x = [0]*9
for i in a:
    x[min(i//400,8)]+=1
if x[8]==0:
    print(9-x.count(0),9-x.count(0))
else:
    print(max(1,8-x.count(0)),min(8,8-x.count(0)+x[8]))

Submission status: Wrong Answer

Solution code:

import math
import itertools
import statistics
#import collections
n = int(input())
a = list(map(int, input().split()))
a.sort()

#rate = [400, 800, 1200, 1600, 2000, 24000, 2800, 3200]
count = [0]*9
for i in range(n):
    if a[i] < 400:
        count[0] += 1
    elif a[i] < 800:
        count[1] += 1
    elif a[i] < 1200:
        count[2] += 1
    elif a[i] < 1600:
        count[3] += 1
    elif a[i] < 2000:
        count[4] += 1
    elif a[i] < 2400:
        count[5] += 1
    elif a[i] < 2800:
        count[6] +=1
    elif a[i] < 3200:
        count[7] +=1
    else:
        count[8] += 1


ans = 0
for i in range(0, 8):
    if count[i] > 0:
        ans += 1
ans_max = 0
if ans+count[8] <= 8:
    ans_max = ans+count[8]
else:
    ans_max = 8

print(str(ans)+" "+str(ans_max))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
x = [0]*9
for i in a:
    x[min(i//400,8)]+=1

if x[8]==0:
    print(9-x.count(0),9-x.count(0))
else:
    print(9-x.count(0)-1,min(8,9-x.count(0)+x[8]-1))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l = []
rcoder = 0
for i in a:
  if i<400:
    l.append("gray")
  elif i>399 and i<800:
    l.append("brown")
  elif i>799 and i<1200:
    l.append("green")
  elif i>1199 and i<1600:
    l.append("light")
  elif i>1599 and i<2000:
    l.append("blue")
  elif i>1999 and i<2400:
    l.append("yellow")
  elif i>2399 and i<2800:
    l.append("orange")
  elif i>2799:
    l.append("red")
    if i>3199:
      rcoder+=1
print(len(set(l)),len(set(l))+rcoder)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l = []
rcoder = 0
for i in a:
  if i<400:
    l.append("gray")
  elif i>399 and i<800:
    l.append("brown")
  elif i>799 and i<1200:
    l.append("green")
  elif i>1199 and i<1600:
    l.append("light")
  elif i>1599 and i<2000:
    l.append("blue")
  elif i>1999 and i<2400:
    l.append("yellow")
  elif i>2399 and i<2800:
    l.append("orange")
  elif i>2799:
    l.append("red")
    if 3199<i:
      rcoder+=1
print(len(set(l)),len(set(l))+rcoder)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l = []
rcoder = 0
for i in a:
  if i<400:
    l.append("gray")
  elif i>399 and i<800:
    l.append("brown")
  elif i>799 and i<1200:
    l.append("green")
  elif i>1199 and i<1600:
    l.append("light")
  elif i>1599 and i<2000:
    l.append("blue")
  elif i>1999 and i<2400:
    l.append("yellow")
  elif i>2399 and i<2800:
    l.append("orange")
  elif i>2799 and i<3200:
    l.append("red")
  elif 3199<i:
    rcoder+=1
print(len(set(l)),len(set(l))+rcoder)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
from collections import Counter

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

rate = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

idx = []

for a in A:
    idx.append(bisect_right(rate, a))

print(idx)

c = Counter(idx)

print(c)

min_c = len(c.keys())
if (7 in c.keys()) and (8 in c.keys()):
    min_c -= 1
max_c = 0
for i in range(8):
    if i in c.keys():
        max_c += 1
if 8 in c.keys():
    # min_c -= 1
    # max_c += min(8, c[8])
    max_c += c[8]
    # if max_c > 8:
    #     max_c = 8

print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
from collections import Counter

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

rate = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

idx = []

for a in A:
    idx.append(bisect_right(rate, a))

# print(idx)

c = Counter(idx)

# print(c)

min_c = len(c.keys())
if (7 in c.keys()) and (8 in c.keys()):
    min_c -= 1
max_c = 0
for i in range(8):
    if i in c.keys():
        max_c += 1
if 8 in c.keys():
    # min_c -= 1
    # max_c += min(8, c[8])
    max_c += c[8]
    if max_c > 8:
        max_c = 8

print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
from collections import Counter

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

rate = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

idx = []

for a in A:
    idx.append(bisect_right(rate, a))

# print(idx)

c = Counter(idx)

# print(c)

min_c = len(c.keys())
max_c = 0
for i in range(8):
    if i in c.keys():
        max_c += 1
if 8 in c.keys():
    min_c -= 1
    # max_c += min(8, c[8])
    max_c += c[8]
    if max_c > 8:
        max_c = 8

print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
from collections import Counter

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

rate = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

idx = []

for a in A:
    idx.append(bisect_right(rate, a))

# print(idx)

c = Counter(idx)

# print(c)

min_c = len(c.keys())
max_c = 0
for i in range(8):
    if i in c.keys():
        max_c += 1
if 8 in c.keys():
    min_c -= 1
    max_c += min(8, c[8])

print(min_c, max_c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    _ = int(input())
    a = list(map(int, input().split()))
    
    counter = [0] * 9
    for ai in a:
        counter[min(8, ai // 400)] += 1
    
    ans_min = 0
    for i in range(8):
        if 0 < counter[i]:
            ans_min += 1
    
    ans_max = min(8, ans_min + counter[-1])
    if ans_min == 0 and 0 < counter[-1]:
        ans_min = 1
    print(ans_min, ans_max)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def solve():
    _ = int(input())
    a = list(map(int, input().split()))
    
    counter = [0] * 9
    for ai in a:
        counter[min(8, ai // 400)] += 1
    
    ans_min = 0
    for i in range(8):
        if 0 < counter[i]:
            ans_min += 1
    
    ans_max = min(8, ans_min + counter[-1])
    print(ans_min, ans_max)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

for p in a:
  if p<=399:
    con.add("灰")
  elif p<=799:
    con.add("茶")
  elif p<=1199:
    con.add("緑")
  elif p<=1599:
    con.add("水")
  elif p<=1999:
    con.add("青")
  elif p<=2399:
    con.add("黄")
  elif p<=2799:
    con.add("橙")
  elif p<=3199:
    con.add("赤")
  else:
    wild +=1

    
mini=len(con)
maxi=mini+wild
print(mini,maxi)

Submission status: Wrong Answer

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

for p in a:
  if p<=399:
    con.add("灰")
  elif p<=799:
    con.add("茶")
  elif p<=1199:
    con.add("緑")
  elif p<=1599:
    con.add("水")
  elif p<=1999:
    con.add("青")
  elif p<=2399:
    con.add("黄")
  elif p<=2799:
    con.add("橙")
  elif p<=3199:
    con.add("赤")
  else:
    wild +=1
    
mini=len(con)
maxi=min(8,mini+wild)
print(mini,maxi)

Submission status: Wrong Answer

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

scores = [0, 0, 0, 0, 0, 0, 0, 0]
x = 0

def evaluation(list):
    for i in list:
        if 0 <= i <= 399:
            scores[0] = 1
        elif 400 <= i <= 799:
            scores[1] = 1
        elif 800 <= i <= 1199:
            scores[2] = 1
        elif 1200 <= i <= 1599:
            scores[3] = 1
        elif 1600 <= i <= 1999:
            scores[4] = 1
        elif 2000 <= i <= 2399:
            scores[5] = 1
        elif 2400 <= i <= 2799:
            scores[6] = 1
        elif 2800 <= i <= 3199:
            scores[7] = 1

for j in range(n):
    if l[j] >= 3200:
        x += 1

evaluation(l)
y = sum(scores)

if n==1:
    print(1,1)
else:
    print(y, y + x)

Submission status: Wrong Answer

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

scores = [0, 0, 0, 0, 0, 0, 0, 0]
x = 0

def evaluation(list):
    for i in list:
        if 0 <= i <= 399:
            scores[0] = 1
        elif 400 <= i <= 799:
            scores[1] = 1
        elif 800 <= i <= 1199:
            scores[2] = 1
        elif 1200 <= i <= 1599:
            scores[3] = 1
        elif 1600 <= i <= 1999:
            scores[4] = 1
        elif 2000 <= i <= 2399:
            scores[5] = 1
        elif 2400 <= i <= 2799:
            scores[6] = 1
        elif 2800 <= i <= 3199:
            scores[7] = 1

for j in range(n):
    if l[j] >= 3200:
        x += 1

evaluation(l)
y = sum(scores)

print(y, y + x)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 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:
		red += 1
c = 0
print(b)
for i in b:
	if i > 0:
		c += 1
if c == 0:
	mn = 1
else:
	mn = c
mx = c + red
print (mn, mx)

Submission status: Wrong Answer

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

b = [0]*8
over = 0

for i in range(n):
    if a[i] >= 3200:
        over += 1
    elif 1 <= a[i] <= 399:
        b[0] += 1
    elif 400 <= a[i] <= 799:
        b[1] += 1
    elif 800 <= a[i] <= 1199:
        b[2] += 1
    elif 1200 <= a[i] <= 1599:
        b[3] += 1
    elif 1600 <= a[i] <= 1999:
        b[4] += 1
    elif 2000 <= a[i] <= 2399:
        b[5] += 1
    elif 2400 <= a[i] <= 2799:
        b[6] += 1
    elif 2800 <= a[i] <= 3199:
        b[7] += 1

#bの中で、０ではない要素数をカウントする
low = 0
for i in range(8):
    if b[i] == 0:
        pass
    else:
        low += 1

if over == 0:
    print(low,low)
else:
    if low == 0:
        if over < 8:
            print(1,over)
        else:
            print(1,8)
    else:
        if over < 8 - low:
            print(low,low + over)
        else:
            print(low,8)

Submission status: Wrong Answer

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

b = [0]*8
over = 0

for i in range(n):
    if a[i] >= 3200:
        over += 1
    elif 1 <= a[i] <= 399:
        b[0] += 1
    elif 400 <= a[i] <= 799:
        b[1] += 1
    elif 800 <= a[i] <= 1199:
        b[2] += 1
    elif 1200 <= a[i] <= 1599:
        b[3] += 1
    elif 1600 <= a[i] <= 1999:
        b[4] += 1
    elif 2000 <= a[i] <= 2399:
        b[5] += 1
    elif 2400 <= a[i] <= 2799:
        b[6] += 1
    elif 2800 <= a[i] <= 3199:
        b[7] += 1

#bの中で、０ではない要素数をカウントする
low = 0
for i in range(8):
    if b[i] == 0:
        pass
    else:
        low += 1

if over == 0:
    print(low,low)
elif over < 8-low:
    print(low,low+over)
else:
    print(low,8)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

def f( num):
  if 1<=num<=399:
    return 1
  elif 400<=num<=799:
    return 2
  elif num<= 1199:
    return 3
  elif num<=1599:
    return 4
  elif num<=1999:
    return 5
  elif num <= 2399:
    return 6
  elif num<= 2799:
    return 7
  elif num <= 3199:
    return 8
  else :
    return 9
a_set = [ f(i) for i in a]
a_number_set = set(a_set)
kind_num_max = 8


flag = 0

if 9 in a_number_set:
  flag = 1
  nine_num = a_set.count(9)
  
result_min = len(a_number_set)
result_max = len(a_number_set)

if flag == 1:
  result_min -= 1
  result_max = min( kind_num_max, result_min + nine_num)
  
  if result_min == 0:
    result_min =1
print('{} {}'.format( result_min, result_max))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

def f( num):
  if 1<=num<=399:
    return 1
  elif 400<=num<=799:
    return 2
  elif num<= 1199:
    return 3
  elif num<=1599:
    return 4
  elif num<=1999:
    return 5
  elif num <= 2399:
    return 6
  elif num<= 2799:
    return 7
  elif num <= 3199:
    return 8
  else :
    return 9
a_set = [ f(i) for i in a]
a_number_set = set(a_set)
kind_num_max = 8


flag = 0

if 9 in a_number_set:
  flag = 1
  nine_num = a_set.count(9)
  
result_min = len(a_number_set)
result_max = len(a_number_set)

if flag == 1:
  result_min -= 1
  result_max = min( kind_num_max, result_min + nine_num)

print('{} {}'.format( result_min, result_max))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=1
c=1
d=0
if a[1]>=3200:
    
    b-=1
for i in range(n-1):
        

    for j in range(n):
        if a[i+1]>=3200:
            d+=1
            break
        if a[i]-a[j]>=400 or a[j]-a[i]>=400:
            pass
            
            
        else:
            break
    b+=1

c=b
if c+d>=8:
    print(b,8)
else:
    print(b,c+d)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
lis = [0,0,0,0,0,0,0,0]
for i in a:
    if i<400:
        lis[0] = 1
    elif i<800:
        lis[1] = 1
    elif i<1200:
        lis[2] = 1
    elif i<1600:
        lis[3] = 1
    elif i<2000:
        lis[4] = 1
    elif i<2400:
        lis[5] = 1
    elif i<2800:
        lis[6] = 1
    else:
        lis[7] += 1
if lis[7] == 0:
    print(lis.count(1), lis.count(1))
elif lis[0:6].count(1) < lis[7]:
    n = lis[7]
    if lis[7]>(6-lis[0:6].count(1)):
        print(lis[0:6].count(1)+(lis[7]-lis[0:6].count(1)), lis[0:6].count(1)+(6-lis[0:6].count(1))+1)
    else:
        print(lis[0:6].count(1)+(lis[7]-lis[0:6].count(1)),lis[0:6].count(1)+lis[7])
else:
    n = lis[7]
    print(lis[0:6].count(1)-n, lis[0:6].count(1)+n)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=1
c=1
d=0
if a[1]>=3200:
    d+=1
for i in range(n-1):
        

    for j in range(i,n-1):
        if a[i+1]>=3200:
            d+=1
            break
        if a[i]-a[j]>=400 or a[j]-a[i]>=400:
            b+=1
            c+=1
            break
        else:
            pass

if c+d>=8:
    print(b,8)
else:
    print(b,c+d)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=1
c=1
d=0
if a[1]==3200:
    d+=1
for i in range(n-1):
        

    for j in range(i,n-1):
        if a[i+1]>=3200:
            d+=1
            break
        if a[i]-a[j]>=400 or a[j]-a[i]>=400:
            b+=1
            c+=1
            break
        else:
            pass

if c+d>=8:
    print(b,8)
else:
    print(b,c+d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=1
c=1
d=0
for i in range(n-1):
        

    for j in range(i,n-1):
        if a[i+1]>=3200:
            d+=1
            break
        else:
            if a[i]-a[j]>=400 or a[j]-a[i]>=400:
                b+=1
                c+=1
                break
            else:
                pass
if c+d>=8:
    print(b,8)
else:
    print(b,c+d)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    a[i] = a[i] // 400
    if a[i] >= 8:
        a[i] = 8
if 8 in a:
    min_ans = len(set(a)) - 1
else:
    min_ans = len(set(a))
max_ans = min_ans + a.count(8)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 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:
		red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
mn = c
mx = c + red
print (mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 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
	else:
		if i >= 3200:
			red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
mn = c
mx = c + red
print (mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 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
	else:
		b[7] += 1
		if i >= 3200:
			red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
mn = c
mx = c + red
print (mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 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
	else:
		b[7] += 1
		if i >= 3200:
			red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
mn = c
mx = min(c + red,8)
print (mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 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:
		red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
mn = c
mx = min(c + red,8)
print (mn, mx)

Submission status: Wrong Answer

Solution code:
N = int(input())
check = [False]*8
over = 0
a_s = list(map(int, input().split()))
for a in a_s:
  if 1 <=a<=399:
    check[0] = True
  elif 400<=a<=799:
    check[1]=True
  elif 800<=a<=1119:
    check[2]=True
  elif 1200<=a<=1599:
    check[3]=True
  elif 1600<=a<=1999:
    check[4]=True
  elif 2000<=a<=2399:
    check[5]=True
  elif 2400<=a<=2799:
    check[6]=True
  elif 2800<=a<=3199:
    check[7]=True
  else:
    over += 1
mn = check.count(True)

if mn == 0:
  print(1, over)
else:
  if mn+over < 9:
  	print(mn, mn+over)
  else:
    print(mn, 8)

Submission status: Wrong Answer

Solution code:
N = int(input())
check = [False]*8
over = 0
a_s = list(map(int, input().split()))
for a in a_s:
  if 1 <=a<=399:
    check[0] = True
  elif 400<=a<=799:
    check[1]=True
  elif 800<=a<=1119:
    check[2]=True
  elif 1200<=a<=1599:
    check[3]=True
  elif 1600<=a<=1999:
    check[4]=True
  elif 2000<=a<=2399:
    check[5]=True
  elif 2400<=a<=2799:
    check[6]=True
  elif 2800<=a<=3199:
    check[7]=True
  else:
    over += 1
mn = check.count(True)

if mn == 0:
  print(1, over)
else:
  print(mn, mn+over)

Submission status: Wrong Answer

Solution code:
N = int(input())
check = [False]*8
over = 0
a_s = list(map(int, input().split()))
for a in a_s:
  if 1 <=a<=399:
    check[0] = True
  elif 400<=a<=799:
    check[1]=True
  elif 800<=a<=1119:
    check[2]=True
  elif 1200<=a<=1599:
    check[3]=True
  elif 1600<=a<=1999:
    check[4]=True
  elif 2000<=a<=2399:
    check[5]=True
  elif 2400<=a<=2799:
    check[6]=True
  elif 2800<=a<=3199:
    check[7]=True
  else:
    over += 1
mn = check.count(True)
c = 0
for i in range(8):
  if c == over:
    break
  if check[i] == False:
    check[i] = True
    c += 1
if mn == 0:
  print(over, over)
else:
  print(mn,check.count(True))

Submission status: Wrong Answer

Solution code:
N = int(input())
check = [False]*8
over = 0
a_s = list(map(int, input().split()))
for a in a_s:
  if 1 <=a<=399:
    check[0] = True
  elif 400<=a<=799:
    check[1]=True
  elif 800<=a<=1119:
    check[2]=True
  elif 1200<=a<=1599:
    check[3]=True
  elif 1600<=a<=1999:
    check[4]=True
  elif 2000<=a<=2399:
    check[5]=True
  elif 2400<=a<=2799:
    check[6]=True
  elif 2800<=a<=3199:
    check[7]=True
  else:
    over += 1
mn = check.count(True)
if mn > 8:
  print(mn,mn)
elif mn == 0:
  print(over, over)
else:
  if mn+over>=8:
    print(mn, 8)
  else:
    print(mn, mn+over)

Submission status: Wrong Answer

Solution code:
N = int(input())
check = [False]*8
over = 0
a_s = list(map(int, input().split()))
for a in a_s:
  if 1 <=a<=399:
    check[0] = True
  elif 400<=a<=799:
    check[1]=True
  elif 800<=a<=1119:
    check[2]=True
  elif 1200<=a<=1599:
    check[3]=True
  elif 1600<=a<=1999:
    check[4]=True
  elif 2000<=a<=2399:
    check[5]=True
  elif 2400<=a<=2799:
    check[6]=True
  elif 2800<=a<=3199:
    check[7]=True
  else:
    over += 1
mn = check.count(True)
if mn > 8:
  print(mn,mn)
else:
  if mn+over>=8:
    print(mn, 8)
  else:
    print(mn, mn+over)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
a = LIST()
a.sort()
arr = [0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
r = 0
for i in range(len(arr)):
    if a[0] < arr[i]:
        r = i
        break
ans = 1
ans2 = 0
for i in range(n):
    if a[i] >= arr[r]:
        r = -1
        for j in range(len(arr)):
            if a[i] < arr[j]:
                r = j
                break
        if r == -1:
            ans2 += 1
        else:
            ans += 1
print(ans if ans > 0 else 1, ans + ans2)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
a = LIST()
a.sort()
arr = [0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
r = 0
for i in range(len(arr)):
    if a[0] < arr[i]:
        r = i
        break
ans = 1
ans2 = 0
for i in range(n):
    if a[i] >= arr[r]:
        r = -1
        for j in range(len(arr)):
            if a[i] < arr[j]:
                r = j
                break
        if r == -1:
            ans2 += 1
        else:
            ans += 1
print(ans if ans > 0 else 1, min(8, ans + ans2))

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
a = LIST()
a.sort()
arr = [0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
r = 0
for i in range(len(arr)):
    if a[0] < arr[i]:
        r = i
        break
ans = 1
ans2 = 0
for i in range(n):
    if a[i] >= arr[r]:
        r = -1
        for j in range(len(arr)):
            if a[i] < arr[j]:
                r = j
                break
        if r == -1:
            ans2 += 1
        else:
            ans += 1
print(ans, min(8, ans + ans2))

Submission status: Wrong Answer

Solution code:
num = int(input())
list = [int(x) for x in input().split()]

count = 0
any = 0

color = []

for i in range(num):
    if 1 <= list[i] < 400:
        color.append("gray")
    elif 400 <= list[i] < 800:
        color.append("brown")
    elif 800 <= list[i] < 1200:
        color.append("green")
    elif 1200 <= list[i] < 1600:
        color.append("sky")
    elif 1600 <= list[i] < 2000:
        color.append("blue")
    elif 2000 <= list[i] < 2400:
        color.append("yellow")
    elif 2400 <= list[i] < 2800:
        color.append("orange")
    elif 2800 <= list[i] < 3200:
        color.append("red")
    else:
        color.append("any")



if "gray" in color:
    count += 1
else:
    None


if "brown" in color:
    count += 1
else:
    None


if "green" in color:
    count += 1
else:
    None


if "sky" in color:
    count += 1
else:
    None


if "blue" in color:
    count += 1
else:
    None


if "yellow" in color:
    count += 1
else:
    None


if "orange" in color:
    count += 1
else:
    None


if "red" in color:
    count += 1
else:
    None



if count == 0:
    print(color.count("any"),color.count("any"))
else:
    print(count,count+color.count("any"))

Submission status: Wrong Answer

Solution code:
num = int(input())
list = [int(x) for x in input().split()]

count = 0
any = 0

color = []

for i in range(num):
    if 1 <= list[i] < 400:
        color.append("gray")
    elif 400 <= list[i] < 800:
        color.append("brown")
    elif 800 <= list[i] < 1200:
        color.append("green")
    elif 1200 <= list[i] < 1600:
        color.append("sky")
    elif 1600 <= list[i] < 2000:
        color.append("blue")
    elif 2000 <= list[i] < 2400:
        color.append("yellow")
    elif 2400 <= list[i] < 2800:
        color.append("orange")
    elif 2800 <= list[i] < 3200:
        color.append("red")
    else:
        color.append("any")



if "gray" in color:
    count += 1
else:
    None


if "brown" in color:
    count += 1
else:
    None


if "green" in color:
    count += 1
else:
    None


if "sky" in color:
    count += 1
else:
    None


if "blue" in color:
    count += 1
else:
    None


if "yellow" in color:
    count += 1
else:
    None


if "orange" in color:
    count += 1
else:
    None


if "red" in color:
    count += 1
else:
    None



if count == 0:
    print(color.count("any"))
else:
    print(count,count+color.count("any"))

Submission status: Wrong Answer

Solution code:
num = int(input())
list = [int(x) for x in input().split()]

count = 0
any = 0

color = []

for i in range(num):
    if 1 <= list[i] < 400:
        color.append("gray")
    elif 400 <= list[i] < 800:
        color.append("brown")
    elif 800 <= list[i] < 1200:
        color.append("green")
    elif 1200 <= list[i] < 1600:
        color.append("sky")
    elif 1600 <= list[i] < 2000:
        color.append("blue")
    elif 2000 <= list[i] < 2400:
        color.append("yellow")
    elif 2400 <= list[i] < 2800:
        color.append("orange")
    elif 2800 <= list[i] < 3200:
        color.append("red")
    else:
        color.append("any")



if "gray" in color:
    count += 1
else:
    None


if "brown" in color:
    count += 1
else:
    None


if "green" in color:
    count += 1
else:
    None


if "sky" in color:
    count += 1
else:
    None


if "blue" in color:
    count += 1
else:
    None


if "yellow" in color:
    count += 1
else:
    None


if "orange" in color:
    count += 1
else:
    None


if "red" in color:
    count += 1
else:
    None






print(count,count+color.count("any"))