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()))
B = [x//400 for x in A if x//400 <= 7]
num_l = len(B)
var_l = len(set(B))
print(max(1,var_l),min(8,var_l+N-num_l))

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
a = list(map(lambda a: int(a) // 400, input().split()))
for i in range(n):
    if a[i] >= 8:
        a[i] = 8
c = Counter(a)
if 8 in c:
    print("{} {}".format(
        max(len(c) - 1, 1),
        min(len(c) - 1 + c[8], 8)))
else:
    print("{} {}".format(
        len(c), len(c)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
rate=[0,0,0,0,0,0,0,0,0]
for i in a:
    if i<400:
        rate[0]=1
    elif 400<=i<800:
        rate[1]=1
    elif 800<=i<1200:
        rate[2]=1
    elif 1200<=i<1600:
        rate[3]
    elif 1600<=i<2000:
        rate[4]=1
    elif 2000<=i<2400:
        rate[5]=1
    elif 2400<=i<2800:
        rate[6]=1
    elif 2800<=i<3200:
        rate[7]=1
    else:
        rate[8]+=1
color=rate[:8]
x=color.count(1)
color_max=x+rate[8]
if x==0 and rate[8]>0:
    color_min=1
else:
    color_min=x
print('{} {}'.format(color_min,color_max))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
rate=[0,0,0,0,0,0,0,0,0]
for i in a:
    if i<400:
        rate[0]=1
    elif 400<=i<800:
        rate[1]=1
    elif 800<=i<1200:
        rate[2]=1
    elif 1200<=i<1600:
        rate[3]
    elif 1600<=i<2000:
        rate[4]=1
    elif 2000<=i<2400:
        rate[5]=1
    elif 2400<=i<2800:
        rate[6]=1
    elif 2800<=i<3200:
        rate[7]=1
    else:
        rate[8]+=1
color=rate[:8]
x=color.count(1)
color_max=min(x+rate[8],8)
if x==0 and rate[8]>0:
    color_min=1
else:
    color_min=x
print('{} {}'.format(color_min,color_max))

Submission status: Wrong Answer

Solution code:
import sys
import copy
import  math
from _bisect import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def judge(num):
    return bisect_right(rate, num) - 1


rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, float("inf")]
li = [0] * 9
n = ni()
aaa = na()
for a in aaa:
    idx = judge(a)
    if idx == 8:
        li[idx] += 1
    else:
        li[idx] = 1
c = max(sum(li[:-1]), 1)
if sum(li[:-1]) == 0:
    print(c, min(8, li[-1]))
else:
    print(c, c + min(8 - c, li[-1]))

Submission status: Wrong Answer

Solution code:
import sys
import copy
import  math
from _bisect import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def judge(num):
    return bisect_right(rate, num) - 1


rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, float("inf")]
li = [0] * 9
n = ni()
aaa = na()
for a in aaa:
    idx = judge(a)
    if idx == 8:
        li[idx] += 1
    else:
        li[idx] = 1
c = sum(li[:-1])
print(c, c + min(8 - c, li[-1]))

Submission status: Wrong Answer

Solution code:
import sys
import copy
import  math
from _bisect import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def judge(num):
    return bisect_right(rate, num) - 1


rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, float("inf")]
li = [0] * 9
n = ni()
aaa = na()
for a in aaa:
    idx = judge(a)
    if idx == 8:
        li[idx] += 1
    else:
        li[idx] = 1
c = sum(li[:-1])
if li[-1] > 0:
    print(c, c + min(8 - c, li[-1]))
else:
    print(c, c)

Submission status: Wrong Answer

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

for i in range(N):
    if 1 <= a[i] <= 399:
        color[0] = 1
    elif 400 <= a[i] <= 799:
        color[1] = 1
    elif 800 <= a[i] <= 1199:
        color[2] = 1
    elif 1200 <= a[i] <= 1599:
        color[3] = 1
    elif 1600 <= a[i] <= 1999:
        color[4] = 1
    elif 2000 <= a[i] <= 2399:
        color[5] = 1
    elif 2400 <= a[i] <= 2799:
        color[6] = 1
    elif 2800 <= a[i] <= 3199:
        color[7] = 1
    else:
        color[8] += 1
co = color[:8]
zero = co.count(0)
min = co.count(1)

if min != 8 and zero < color[8]:
    max = min + color[8]

elif min != 8 and zero >= color[8]:
    max = min + color[8]

print("{} {}".format(min, max))

Submission status: Wrong Answer

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

for i in range(N):
    if 1 <= a[i] <= 399:
        color[0] = 1
    elif 400 <= a[i] <= 799:
        color[1] = 1
    elif 800 <= a[i] <= 1199:
        color[2] = 1
    elif 1200 <= a[i] <= 1599:
        color[3] = 1
    elif 1600 <= a[i] <= 1999:
        color[4] = 1
    elif 2000 <= a[i] <= 2399:
        color[5] = 1
    elif 2400 <= a[i] <= 2799:
        color[6] = 1
    elif 2800 <= a[i] <= 3199:
        color[7] = 1
    else:
        color[8] += 1
co = color[:8]
zero = co.count(0)
min = co.count(1)

if min != 8 and zero < color[8]:
    max = min + zero

elif min != 8 and zero >= color[8]:
    max = min + color[8]

print("{} {}".format(min, max))

Submission status: Wrong Answer

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

for i in range(N):
    if 1 <= a[i] <= 399:
        color[0] = 1
    elif 400 <= a[i] <= 799:
        color[1] = 1
    elif 800 <= a[i] <= 1199:
        color[2] = 1
    elif 1200 <= a[i] <= 1599:
        color[3] = 1
    elif 1600 <= a[i] <= 1999:
        color[4] = 1
    elif 2000 <= a[i] <= 2399:
        color[5] = 1
    elif 2400 <= a[i] <= 2799:
        color[6] = 1
    elif 2800 <= a[i] <= 3199:
        color[7] = 1
    else:
        color[8] += 1
co = color[:8]
zero = co.count(0)
min = co.count(1)

if min != 8 and zero <= color[8]:
    max = min + zero

elif min != 8 and zero > color[8]:
    max = min + color[8]

print("{} {}".format(min, max))

Submission status: Wrong Answer

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

for i in range(N):
    if 1 <= a[i] <= 399:
        color[0] = 1
    elif 400 <= a[i] <= 799:
        color[1] = 1
    elif 800 <= a[i] <= 1199:
        color[2] = 1
    elif 1200 <= a[i] <= 1599:
        color[3] = 1
    elif 1600 <= a[i] <= 1999:
        color[4] = 1
    elif 2000 <= a[i] <= 2399:
        color[5] = 1
    elif 2400 <= a[i] <= 2799:
        color[6] = 1
    elif 2800 <= a[i] <= 3199:
        color[7] = 1
    else:
        color[8] += 1
co = color[:8]
zero = co.count(0)
min = co.count(1)

if min != 9 and zero <= color[8]:
    max = min + zero

elif min != 9 and zero > color[8]:
    max = min + color[8]

print("{} {}".format(min, max))

Submission status: Wrong Answer

Solution code:
n=int(input())
def f(x):
  return x//400 if x<3200 else 8
l=list(map(f,list(map(int,input().split()))))
ds=l.count(8)
sl=set(l)
if ds==0:
  print(len(sl),len(sl))
elif len(sl)==1:print(1,min(8,ds))
else:
  print(len(sl)-1,min(8,len(sl)+ds-1))

Submission status: Wrong Answer

Solution code:
n=int(input())
def f(x):
  return x//400 if x<3200 else 8
l=list(map(f,list(map(int,input().split()))))
ds=l.count(8)
l=set(l)
if 8 not in l:
  print(len(l),len(l))
elif len(l)==1:print(1,min(8,ds))
else:
  print(len(l)-1,min(8,len(l)+ds-1))

Submission status: Wrong Answer

Solution code:
n=int(input())
def f(x):
  return x//400 if x<3200 else 8
l=list(map(f,list(map(int,input().split()))))
ds=l.count(8)
l=set(l)
if 8 not in l:
  print(len(l),len(l))
else:
  print(len(l)-1,min(8,len(l)+ds-1))

Submission status: Wrong Answer

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

cr = []
MAxans = 0

for i in A:
    c = i // 400
    if c < 8 and not c in cr:
        cr.append(c)
    elif c >= 8:
        MAxans += 1


if len(cr)>0:
    Minans = len(cr)
    MAxans = min(8, MAxans + Minans)
else:
    Minans = 1
    MAxans = min(8, MAxans)
print(str(Minans) + " " + str(MAxans))

Submission status: Wrong Answer

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

cr = []
MAxans = 0

for i in A:
    c = i // 400
    if c < 8 and not c in cr:
        cr.append(c)
    elif c >= 8:
        MAxans += 1

Minans = len(cr)
MAxans = min(8, MAxans + Minans)

print(str(Minans) + " " + str(MAxans))

Submission status: Wrong Answer

Solution code:
import math

n=int(input())
a=list(map(int, input().split()))  
b=[]
count=0




for i in range(n):
    if a[i]>=3200:
        count+=1
    else:
        b.append(a[i]//400)

ans=len(set(b))

if count==0:
    print(ans,ans)

else:
    if ans==0:
        print(1,min(count,8))
        
    else:
        print(ans,min(ans+count,8))

Submission status: Wrong Answer

Solution code:
from bisect import bisect
def grade(rate,breakpoints=[400,800,1200,1600,2000,2400,2800,3200],grades=["gray","brown","green","light blue","blue","yellow","orange","red","anything"]):
    i = bisect(breakpoints,rate)
    return grades[i]

n = int(input())
a = [int(i) for i in input().split()]
colors = [grade(r) for r in a]
anything_count = colors.count("anything")
ans = len(set(colors))
print(*(ans,ans) if anything_count == 0 else (ans-1,ans-1+anything_count))

Submission status: Wrong Answer

Solution code:
_ = input().strip()
kind_set = set()
rates = list(map(int, input().strip().split(' ')))

def whatcolor(rate):
  if rate < 400:
    return 0
  elif rate < 800:
    return 1
  elif rate < 1200:
    return 2
  elif rate < 1600:
    return 3
  elif rate < 2000:
    return 4
  elif rate < 2400:
    return 5
  elif rate < 2800:
    return 6
  elif rate < 3200:
    return 7
  else:
    return 'red'
  
for r in rates:
  color = whatcolor(r)
  if color == 'red':
    continue
  else:
    kind_set.add(color)

print(max(1, len(kind_set)))

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

print(max(1, ans), min(8, ans + c[8]))

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

min_ans = 8 - c[:-1].count(0)
max_ans = min(8, min_ans+c[-1])
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = {}
for i in range(0, 13):
    B[i] = 0
for i in A:
    B[i//400] += 1
ansA = 0
ansB = 0
for i in range(0, 13):
    if i < 8:
        if B[i] > 0:
            ansA += 1
            ansB += 1
    else:
        if B[i] > 0:
            ansB += B[i]
print(ansA, ansB)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

C = [0] * 9

for i in range(N):
    if 1 <= A[i] <= 399:
        C[0] = 1
    elif 400 <= A[i] <= 799:
        C[1] = 1
    elif 800 <= A[i] <= 1199:
        C[2] = 1
    elif 1200 <= A[i] <= 1599:
        C[3] = 1
    elif 1600 <= A[i] <= 1999:
        C[4] = 1
    elif 2000 <= A[i] <= 2399:
        C[5] = 1
    elif 2400 <= A[i] <= 2799:
        C[6] = 1
    elif 2800 <= A[i] <= 3199:
        C[7] = 1
    else:
        C[8] += 1

num = sum(C[0:8])

ans1 = str(max(num, 1))
ans2 = str(min(8, num + C[8]))
print(ans1 + " " + ans2)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

C = [0] * 9

for i in range(N):
    if 1 <= A[i] <= 399:
        C[0] += 1
    elif 400 <= A[i] <= 799:
        C[1] += 1
    elif 800 <= A[i] <= 1199:
        C[2] += 1
    elif 1200 <= A[i] <= 1599:
        C[3] += 1
    elif 1600 <= A[i] <= 1999:
        C[4] += 1
    elif 2000 <= A[i] <= 2399:
        C[5] += 1
    elif 2400 <= A[i] <= 2799:
        C[6] += 1
    elif 2800 <= A[i] <= 3199:
        C[7] += 1
    else:
        C[8] += 1

blank = C[0:8].count(0)

ans = str(max(8 - blank, 1))
ans2 = str(min(8, 8 - blank + C[8]))
print(ans + " " + ans2)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

C = [0] * 9

for i in range(N):
    if 1 <= A[i] <= 399:
        C[0] += 1
    elif 400 <= A[i] <= 799:
        C[1] += 1
    elif 800 <= A[i] <= 1199:
        C[2] += 1
    elif 1200 <= A[i] <= 1599:
        C[3] += 1
    elif 1600 <= A[i] <= 1999:
        C[4] += 1
    elif 2000 <= A[i] <= 2399:
        C[5] += 1
    elif 2400 <= A[i] <= 2799:
        C[6] += 1
    elif 2800 <= A[i] <= 3199:
        C[7] += 1
    else:
        C[8] += 1

blank = C[0:8].count(0)

if blank == 0:
    print("8 8")
    exit()

if C[8] == 0:
    ans = str(8 - blank)
    print(ans + " " + ans)
    exit()
else:
    ans = str(max(8 - blank, 1))
    ans2 = str(min(8, 8 - blank + C[8]))
    print(ans + " " + ans2)

Submission status: Wrong Answer

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

s = [False] * 8
r = 0

for i in a:
	if i // 400 == 0:
		s[0] = True
	elif i // 800 == 0:
		s[1] = True
	elif i // 1200 == 0:
		s[2] = True
	elif i // 1600 == 0:
		s[3] = True
	elif i // 2000 == 0:
		s[4] = True
	elif i // 2400 == 0:
		s[5] = True
	elif i // 2800 == 0:
		s[6] = True
	elif i // 3200 == 0:
		s[7] = True
	else:
		r += 1

if sum(s) == 8:
	print(8, 8)
	exit()

else:
	temp = 8 - sum(s)
	print(sum(s), sum(s) + min(temp, r))

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c
# C - Colorful Leaderboard

n = int(input().split()[0])
a_list = list(map(int, input().split()))

start, end = 0, 399
rate_dict = {}
rate_id = 0

while end < 3200:
    # 灰色が1-399ではなく0-399になるが
    # 影響はないので0-で実装
    data = dict(start=start, end=end)
    rate_dict[rate_id] = data
    rate_id += 1
    start += 400
    end += 400

count_dict = {rate_id: 0 for rate_id in rate_dict.keys()}

for a in a_list:
    for rate_id, v in rate_dict.items():
        if v['start'] <= a <= v['end']:
            count_dict[rate_id] += 1

count_over = n - sum(count_dict.values())
ALL_COLOR_N = len(count_dict.keys())  # 8色

# 0人の色数
zero_color_n = len([v for v in count_dict.values() if v == 0])

# 最小値
if count_over == n:
    # 全員オーバー
    min_n = 1
else:
    # すでに人がいる色に割り振れば良いので、色数は増えない
    min_n = ALL_COLOR_N - zero_color_n

# 最大値
if count_over >= zero_color_n:
    max_n = ALL_COLOR_N
else:
    max_n = (ALL_COLOR_N - zero_color_n) + count_over

ans = ' '.join([str(min_n), str(max_n)])
print(ans)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c
# C - Colorful Leaderboard

n = int(input().split()[0])
a_list = list(map(int, input().split()))

start, end = 0, 399
rate_dict = {}
rate_id = 0

while end < 3200:
    # 灰色が1-399ではなく0-399になるが
    # 影響はないので0-で実装
    data = dict(start=start, end=end)
    rate_dict[rate_id] = data
    rate_id += 1
    start += 400
    end += 400

count_dict = {rate_id: 0 for rate_id in rate_dict.keys()}

for a in a_list:
    for rate_id, v in rate_dict.items():
        if v['start'] <= a <= v['end']:
            count_dict[rate_id] += 1

count_over = n - sum(count_dict.values())
ALL_COLOR_N = len(count_dict.keys())  # 8色

# 0人の色数
zero_color_n = len([v for v in count_dict.values() if v == 0])

# 最小値
if count_over == n:
    # 全員オーバー
    min_n = 1
else:
    min_n = ALL_COLOR_N - zero_color_n

# 最大値
if count_over >= (ALL_COLOR_N - zero_color_n):
    max_n = ALL_COLOR_N
else:
    max_n = (ALL_COLOR_N - zero_color_n) + count_over

ans = ' '.join([str(min_n), str(max_n)])
print(ans)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c
# C - Colorful Leaderboard

n = int(input().split()[0])
a_list = list(map(int, input().split()))

start, end = 0, 399
rate_dict = {}
rate_id = 0

while end < 3200:
    # 灰色が1-399ではなく0-399になるが
    # 影響はないので0-で実装
    data = dict(start=start, end=end)
    rate_dict[rate_id] = data
    rate_id += 1
    start += 400
    end += 400

count_dict = {rate_id: 0 for rate_id in rate_dict.keys()}

for a in a_list:
    for rate_id, v in rate_dict.items():
        if v['start'] <= a <= v['end']:
            count_dict[rate_id] += 1

count_over = n - sum(count_dict.values())

# 最小値
if count_over == n:
    # 全員オーバー
    min_n = 1
else:
    min_n = len([v for v in count_dict.values() if v != 0])

# 最大値
# 0人の色
zero_color = len([v for v in count_dict.values() if v == 0])
if count_over >= zero_color:
    max_n = len(count_dict.keys())
else:
    max_n = (len(count_dict.keys()) - zero_color) + count_over

ans = ' '.join([str(min_n), str(max_n)])
print(ans)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c
# C - Colorful Leaderboard

n = int(input().split()[0])
a_list = list(map(int, input().split()))

start, end = 0, 399
rate_dict = {}
rate_id = 0

while end < 3200:
    # 灰色が1-399ではなく0-399になるが
    # 影響はないので0-で実装
    data = dict(start=start, end=end)
    rate_dict[rate_id] = data
    rate_id += 1
    start += 400
    end += 400

count_dict = {rate_id: 0 for rate_id in rate_dict.keys()}

for a in a_list:
    for rate_id, v in rate_dict.items():
        if v['start'] <= a <= v['end']:
            count_dict[rate_id] += 1

count_over = n - sum(count_dict.values())

# 最小値
if count_over == n:
    # 全員オーバー
    min_n = 0
else:
    min_n = len([v for v in count_dict.values() if v != 0])

# 最大値
# 0人の色
zero_color = len([v for v in count_dict.values() if v == 0])
if count_over >= zero_color:
    max_n = len(count_dict.keys())
else:
    max_n = (len(count_dict.keys()) - zero_color) + count_over

ans = ' '.join([str(min_n), str(max_n)])
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=map(int,input().split())
c=0
s=set()
for i in a:
    if i>=3200:
        c+=1
    else:
        s.add(i//400)
print(len(s),len(s)+c)

Submission status: Wrong Answer

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

ans = [0] * 8
free = 0

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

num = len(ans) - ans.count(0)
print(str(max(num, 1)) + ' ' + str(min(num + free, 8)))

Submission status: Wrong Answer

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

ans = [0] * 8
free = 0

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

num = len(ans) - ans.count(0)
print(str(num) + ' ' + str(min(num + free, 8)))

Submission status: Wrong Answer

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

c=[0,0,0,0,0,0,0,0]
cnt=0
for rate in rates:
  for i in range(8):
    if 400*i<=rate<400*(i+1):
      c[i]+=1
      break
  if rate>=3200:
    cnt+=1
    
ans=len(c)-c.count(0)
if ans==0:
  ans=1
print(min(8,ans),min(8,ans+cnt))

Submission status: Wrong Answer

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

ans=0
f1,f2,f3,f4,f5,f6,f7,f8,f9=0,0,0,0,0,0,0,0,0
for rate in rates:
  if f1==0 and 1<=rate<=399:
    ans+=1
    f1=1
  elif f2==0 and 400<=rate<=799:
    ans+=1
    f2=1
  elif f3==0 and 800<=rate<=1199:
    ans+=1
    f3=1
  elif f4==0 and 1200<=rate<=1599:
    ans+=1
    f4=1
  elif f5==0 and 1600<=rate<=1999:
    ans+=1
    f5=1
  elif f6==0 and 2000<=rate<=2399:
    ans+=1
    f6=1
  elif f7==0 and 2400<=rate<=2799:
    ans+=1
    f7=1
  elif f8==0 and 2800<=rate<=3199:
    ans+=1
    f8=1
  elif rate>=3200:
    f9+=1
  else:
    pass
if ans==0:
  ans=1
print(min(8,ans),min(8,ans+f9))

Submission status: Wrong Answer

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

ans=0
f1,f2,f3,f4,f5,f6,f7,f8,f9=0,0,0,0,0,0,0,0,0
for rate in rates:
  if f1==0 and 1<=rate<=399:
    ans+=1
    f1=1
  elif f2==0 and 400<=rate<=799:
    ans+=1
    f2=1
  elif f3==0 and 800<=rate<=1199:
    ans+=1
    f3=1
  elif f4==0 and 1200<=rate<=1599:
    ans+=1
    f4=1
  elif f5==0 and 1600<=rate<=1999:
    ans+=1
    f5=1
  elif f6==0 and 2000<=rate<=2399:
    ans+=1
    f6=1
  elif f7==0 and 2400<=rate<=2799:
    ans+=1
    f7=1
  elif f8==0 and 2800<=rate<=3199:
    ans+=1
    f8=1
  elif rate>=3200:
    f9+=1
  else:
    pass
print(min(8,ans),min(8,ans+f9))

Submission status: Wrong Answer

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

ans=0
f1,f2,f3,f4,f5,f6,f7,f8,f9=0,0,0,0,0,0,0,0,0
for rate in rates:
  if f1==0 and 1<=rate<=399:
    ans+=1
    f1=1
  elif f2==0 and 400<=rate<=799:
    ans+=1
    f2=1
  elif f3==0 and 800<=rate<=1199:
    ans+=1
    f3=1
  elif f4==0 and 1200<=rate<=1599:
    ans+=1
    f4=1
  elif f5==0 and 1600<=rate<=1999:
    ans+=1
    f5=1
  elif f6==0 and 2000<=rate<=2399:
    ans+=1
    f6=1
  elif f7==0 and 2400<=rate<=2799:
    ans+=1
    f7=1
  elif f8==0 and 2800<=rate<=3199:
    ans+=1
    f8=1
  elif rate>=3200:
    f9+=1
  else:
    pass
print(ans,min(8,ans+f9))

Submission status: Wrong Answer

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

ans=0
f1,f2,f3,f4,f5,f6,f7,f8,f9=0,0,0,0,0,0,0,0,0
for rate in rates:
  if f1==0 and 1<=rate<=399:
    ans+=1
    f1=1
  elif f2==0 and 400<=rate<=799:
    ans+=1
    f2=1
  elif f3==0 and 800<=rate<=1199:
    ans+=1
    f3=1
  elif f4==0 and 1200<=rate<=1599:
    ans+=1
    f4=1
  elif f5==0 and 1600<=rate<=1999:
    ans+=1
    f5=1
  elif f6==0 and 2000<=rate<=2399:
    ans+=1
    f6=1
  elif f7==0 and 2400<=rate<=2799:
    ans+=1
    f7=1
  elif f8==0 and 2800<=rate<=3199:
    ans+=1
    f8=1
  elif rate>=3200:
    f9+=1
  else:
    pass
print(ans,ans+f9)

Submission status: Wrong Answer

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

color=[0 for i in range(8)]
upper=0

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

mn=sum(color)
mx=sum(color)+upper
print(mn,mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
thresholds = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
thresholds.reverse()

counts = [0 for _ in range(len(thresholds))]
for a_i in a:
    for i, threshold in enumerate(thresholds):
        if a_i >= threshold:
            counts[i] += 1
            break

sum = 0
for i in range(1, len(counts)):
    sum += 1 if counts[i] > 0 else 0
print("{} {}".format(max(1, sum), min(len(counts) - 1, sum + counts[0])))

Submission status: Wrong Answer

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

maxs = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
nums = [0 for _ in range(len(maxs))]

count = 0
for a_i in a:
    if a_i >= maxs[-1]:
        count += 1
    else:
        for i in range(len(maxs)):
            if a_i < maxs[i]:
                nums[i] += 1
                break

min_num = len(nums) - nums.count(0)
max_num = min(min_num + count, len(maxs))
if 0 == min_num:
    min_num = 1
print("{} {}".format(min_num, max_num))

Submission status: Wrong Answer

Solution code:
import sys
import bisect
input = sys.stdin.readline
 
def main():
    n=int(input())
    a = list(map(int,input().split()))
    s=[0, 0, 0, 0, 0, 0, 0, 0, 0]
    for i in range(n):
        if(a[i]>=3200):
            s[8]+=1
        else:
            s[(a[i]//400)]=1
    ans=0
    for i in range(8):
        ans+=s[i]
    M=ans+s[8]
    if(ans==0):
        ans=1
        M-=1
    print(ans,M)
    
    
main()

Submission status: Wrong Answer

Solution code:
import sys
import bisect
input = sys.stdin.readline
 
def main():
    n=int(input())
    a = list(map(int,input().split()))
    s=[0, 0, 0, 0, 0, 0, 0, 0, 0]
    for i in range(n):
        if(a[i]<400):
            s[0]=1
        elif(a[i]<800):
            s[1]=1
        elif(a[i]<1200):
            s[2]=1
        elif(a[i]<1600):
            s[3]=1
        elif(a[i]<2000):
            s[4]=1
        elif(a[i]<2400):
            s[5]=1
        elif(a[i]<2800):
            s[6]=1
        elif(a[i]<3200):
            s[7]=1
        else:
            s[8]+=1
    ans=0
    for i in range(8):
        ans+=s[i]
    if(ans==0):
        ans=1
    M=ans+s[8]
    print(ans,M)
    
    
main()

Submission status: Wrong Answer

Solution code:
import sys
import bisect
input = sys.stdin.readline
 
def main():
    n=int(input())
    a = list(map(int,input().split()))
    s=[0, 0, 0, 0, 0, 0, 0, 0, 0]
    for i in range(n):
        if(a[i]<400):
            s[0]=1
        elif(a[i]<800):
            s[1]=1
        elif(a[i]<1200):
            s[2]=1
        elif(a[i]<1600):
            s[3]=1
        elif(a[i]<2000):
            s[4]=1
        elif(a[i]<2400):
            s[5]=1
        elif(a[i]<2800):
            s[6]=1
        elif(a[i]<3200):
            s[7]=1
        else:
            s[8]+=1
    ans=0
    for i in range(8):
        ans+=s[i]
    M=ans
    if(s[8]!=0):
        M+=s[8]
    print(ans,M)
    
    
main()

Submission status: Wrong Answer

Solution code:
import sys
import bisect
input = sys.stdin.readline
 
def main():
    n=int(input())
    a = list(map(int,input().split()))
    s=[0, 0, 0, 0, 0, 0, 0, 0, 0]
    for i in range(n):
        if(a[i]<400):
            s[0]=1
        elif(a[i]<800):
            s[1]=1
        elif(a[i]<1200):
            s[2]=1
        elif(a[i]<1600):
            s[3]=1
        elif(a[i]<2000):
            s[4]=1
        elif(a[i]<2400):
            s[5]=1
        elif(a[i]<2800):
            s[6]=1
        elif(a[i]<3200):
            s[7]=1
        else:
            s[8]+=1
    ans=0
    for i in range(8):
        ans+=s[i]
    M=ans
    if(s[8]!=0):
        M+=s[8]
        if(M>8):
            M=8
    print(ans,M)
    
    
main()

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = [int(a) for a in input().split()]

    if all(a >=3200 for a in A):
        return 1, min(len(A), 8)

    cls = set()
    count = 0
    for a in A:
        isAbove = True
        for i in range(8):
            if 400*i <= a < 400*(i+1):
                cls.add(i)
                isAbove = False
                break
        if isAbove:
            count += 1
    return len(cls), min(len(cls)+count, 8)

if __name__ == '__main__':
    output = main()
    print(" ".join(map(str, output)))

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = [int(a) for a in input().split()]

    if all(a >=3200 for a in A): return 1, min(len(A), 8)

    cls = set()
    count = 0
    for a in A:
        b = 399
        if a <= b:
            cls.add(0)
        else:
            isAbove = True
            for i in range(7):
                b += 400
                if b-400 < a <= b:
                    cls.add(i+1)
                    isAbove = False
                    break
            if isAbove:
                count += 1
    return len(cls), min(len(cls)+count, 8)

if __name__ == '__main__':
    output = main()
    print(" ".join(map(str, output)))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*10
count=0
for i in range(N):
    if A[i]>=3200:
        B[8]+=1
    else:
        B[A[i]//400]+=1


for i in range(8):
    if B[i]>=1:
        count+=1
if count==0:
    print(1, end=" ")
else:
    print(count, end=" ")
print(min(count+int(B[8]),8))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*10
count=0
for i in range(N):
    if A[i]>=3200:
        B[8]+=1
    else:
        B[A[i]//400]+=1


for i in range(8):
    if B[i]>=1:
        count+=1

print(count, end=" ")
print(min(count+int(B[8]),8))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*10
count=0
for i in range(N):
    if A[i]//400<=7:
        B[A[i]//400]+=1
    else:
        B[8]+=1

for i in range(8):
    if B[i]>=1:
        count+=1

print(count, end=" ")
print(min(count+int(B[8]),8))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*10
count=0
for i in range(N):
    if A[i]//400<7:
        B[A[i]//400]+=1
    else:
        B[8]+=1

for i in range(8):
    if B[i]>=1:
        count+=1

print(count, end=" ")
print(min(count+int(B[8]),8))

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    a = list(map(int,input().split()))
    col_list = [0]*8
    free = 0
    for i in range(N):
        if a[i] < 3200:
            col = a[i]//400
            col_list[col] += 1
        else:
            free += 1
    non_col = col_list.count(0)
    print(8-non_col,8-non_col+free)

if __name__ == "__main__":
    main()