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()))

t = [0] * 8
over = 0
for x in a:
    if x >= 3200:
        over += 1
    else:
        t[x // 400] = 1
print(*[max(sum(t), 0 if over == 0 else 1), min(sum(t) + over, 8)])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
dic = {}
cnt = 0
for i in range(N):
  if A[i] < 400:
    dic[0] = 1
  elif A[i] < 800:
    dic[1] = 1
  elif A[i] < 1200:
    dic[2] = 1
  elif A[i] < 1600:
    dic[3] = 1
  elif A[i] < 2000:
    dic[4] = 1
  elif A[i] < 2400:
    dic[5] = 1
  elif A[i] < 2800:
    dic[6] = 1
  elif A[i] < 3200:
    dic[7] = 1
  else:
    dic[8] = 1
    cnt += 1
if cnt > 0:
  print(len(dic) - 1,len(dic) + cnt - 1)
else:
  print(len(dic),len(dic))

Submission status: Wrong Answer

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

over_count = 0
gray = 0
brawn = 0
green = 0
lightblue = 0
blue = 0
yellow = 0
orange = 0
red = 0

for a in As:
  if 1 <= a <= 399:
    gray = 1
  elif 400 <= a <= 799:
    brawn = 1
  elif 800 <= a <= 1199:
    green = 1
  elif 1200 <= a <= 1599:
    lightblue = 1
  elif 1600 <= a <= 1999:
    blue = 1
  elif 2000 <= a <= 2399:
    yellow = 1
  elif 2400 <= a <= 2799:
    orange = 1
  elif 2800 <= a <= 3199:
    red = 1
  elif a >= 3200:
    over_count += 1
    
min_count = gray + brawn + green + lightblue + blue + yellow + orange + red
max_count = min_count + over_count

print("{} {}".format(min_count, max_count))

Submission status: Wrong Answer

Solution code:
def rank(n):
    n = int(n)
    if n < 400:
        return 'a'
    if n < 800:
        return 'b'
    if n < 1200:
        return 'c'
    if n < 1600:
        return 'd'
    if n < 2000:
        return 'e'
    if n < 2400:
        return 'f'
    if n < 2800:
        return 'g'
    if n < 3200:
        return 'h'
    else:
        return 'x'


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

normal = [i for i in a if i != 'x']
ans_max = min(8, len(set(normal)) + a.count('x'))
if len(normal) == 0:
    ans_min = 1
else:
    ans_min = len(set(normal))
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
def rank(n):
    n = int(n)
    if n < 400:
        return 'a'
    if n < 800:
        return 'b'
    if n < 1200:
        return 'c'
    if n < 1600:
        return 'd'
    if n < 2000:
        return 'e'
    if n < 2400:
        return 'f'
    if n < 2800:
        return 'g'
    if n < 3200:
        return 'h'
    else:
        return 'x'


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

normal = [i for i in a if i != 'x']
if len(a) == len(normal):
    ans1 = len(set(normal))
    ans2 = len(set(normal))
elif len(normal) == 0:
    ans1 = 1
    ans2 = min(8, a.count('x'))
else:
    ans1 = len(set(normal))
    ans2 = min(8, len(set(normal)) + a.count('x'))
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
clst = [0, 0, 0, 0, 0, 0, 0, 0, 0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(9):
    if 0 < clst[i] and i != 8:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]
if sum(a[:8]) == 0:
    maxans -= 1

print(minans, maxans)

Submission status: Wrong Answer

Solution code:
clst = [0, 0, 0, 0, 0, 0, 0, 0, 0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(9):
    if 0 < clst[i]:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]
if sum(a[:8]) == 0:
    maxans -= 1

print(minans, maxans)

Submission status: Wrong Answer

Solution code:
clst = [0, 0, 0, 0, 0, 0, 0, 0,  0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(9):
    if 0 < clst[i]:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]

print(minans, maxans)

Submission status: Wrong Answer

Solution code:
clst = [0, 0, 0, 0, 0, 0, 0, 0,  0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(9):
    if 0 < clst[i]:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]
if sum(clst[:8]) == 0:
    maxans -= 1
print(minans, maxans)

Submission status: Wrong Answer

Solution code:
clst = [0, 0, 0, 0, 0, 0, 0, 0,  0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(9):
    if 0 < clst[i]:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]
if sum(clst[:8]):
    maxans -= 1
print(minans, maxans)

Submission status: Wrong Answer

Solution code:
clst = [0, 0, 0, 0, 0, 0, 0, 0,  0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(8):
    if 0 < clst[i]:
        minans += 1

maxans = minans + clst[8]
print(minans, maxans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = tourist
else:
    minrate = sum(li[:8])

print(minrate, maxrate)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = 1
else:
    minrate = sum(li[:8])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

minrate = sum(li[:8])
maxrate = minrate + tourist

print(minrate, maxrate)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

minrate = sum(li[:8])
maxrate = 0
if minrate + tourist > 8:
    maxrate = 8
else:
    maxrate = minrate + tourist

print(minrate, maxrate)

Submission status: Wrong Answer

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

ans = 0
free = 0
tmp = a[0] // 400
for i in a:
    if i >= 3200:
        free += 1
    elif i >= 400 * tmp:
        tmp += 1
        ans += 1
if ans > 0:
    print(ans, ans+free)
else:
    print(1, ans+free)

Submission status: Wrong Answer

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

ans = 0
free = 0
tmp = a[0]//400
for i in a:
    if i >= 3200:
        free += 1
    elif i > 400 * tmp:
        tmp += 1
        ans += 1
if ans > 0:
    print(ans, ans+free)
else:
    print(1, ans+free)

Submission status: Wrong Answer

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

ans = 0
free = 0
tmp = a[0]//400
for i in a:
    if i >= 3200:
        free += 1
    elif i > 400 * tmp:
        tmp += 1
        ans += 1
print(ans, ans+free)

Submission status: Wrong Answer

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

ans = 0
free = 0
tmp = a[0]//400
for i in a:
    if i >= 3200:
        free += 1
    elif i > 400 * tmp:
        tmp += 1
        ans += 1
print(ans, ans+free)

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
DP = [0]*8
tmp = 0

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

ans1 = sum(DP)

if ans1 < tmp:
    tmp = sum(DP)
elif ans1 == 0:
    ans1 = 1
else:
    pass

ans1 = sum(DP)
ans2 = sum(DP)+tmp
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
DP = [0]*8
tmp = 0

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

if sum(DP) < tmp:
    tmp = sum(DP)
else:
    pass

ans1 = sum(DP)
ans2 = sum(DP)+tmp
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
DP = [0]*8
tmp = 0

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

if sum(DP) < 1:
    tmp = sum(DP)
else:
    pass

ans1 = sum(DP)
ans2 = sum(DP)+tmp
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
DP = [0]*8
tmp = 0

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

ans1 = sum(DP)
ans2 = sum(DP)+tmp
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
k = [0]*N
ans = 0
ans_2 = 0
color = 0
for i in range(N):
  k[i] = a[i]//400
  if a[i]>=3200:
    color = 1
s = set(k)
ans += len(s)-color
ans_2 += len(s)-color
if max(k) == 8:
  ans_2 += k.count(8)
print(ans,ans_2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
k = [0]*N
ans = 0
ans_2 = 0
color = 0
for i in range(N):
  k[i] = a[i]//400
  if a[i]>=3200:
    k[i] = 10
    color = 1
s = set(k)
ans += len(s)-color
ans_2 += len(s)-color
if max(k) == 10:
  ans_2 += k.count(10)
print(ans,ans_2)

Submission status: Wrong Answer

Solution code:
def color(x):
  if(1 <= x and x <= 399):
    return "灰色"
  if(400 <= x and x <= 799):
    return "茶色"
  if(800 <= x and x <= 1199):
    return "緑色"
  if(1200 <= x and x <= 1599):
    return "水色"
  if(1600 <= x and x <= 1999):
    return "青色"
  if(2000 <= x and x <= 2399):
    return "黄色"
  if(2400 <= x and x <= 2799):
    return "橙色" 
  if(2800 <= x and x <= 3199):
    return "赤色"
  if(3200 <= x):
    return "free"

from collections import defaultdict
d = defaultdict(int)
n = int(input())
a = list(map(int, input().split()))
free = 0
for score in a:
  if color(score) == "free":
    free +=1
  else:
    d[color(score)] += 1
print(len(d), len(d) + free)

Submission status: Wrong Answer

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

colors = [0]*8
higher = 0
for a in A:
    if a <=399:
        colors[0] = 1
    elif a<= 799:
        colors[1] =1
    elif a<= 1199:
        colors[2] =1
    elif a<= 1599:
        colors[3] =1
    elif a<= 1999:
        colors[4] =1
    elif a<= 2399:
        colors[5] =1
    elif a<= 2799:
        colors[6] =1
    elif a<= 3199:
        colors[7] =1
    else:
        higher +=1
print(sum(colors),sum(colors)+higher)

Submission status: Wrong Answer

Solution code:
participant = int(input())
rate = list(map(int, input().split()))
ratecolorCheck = [0] *8
maxColor, minColor = 0, 0
for i in range(participant):
  if 1 <= rate[i] and rate[i] <= 399:
    ratecolorCheck[0] = 1
  elif 400 <= rate[i] and rate[i] <= 799:
    ratecolorCheck[1] = 1
  elif 800 <= rate[i] and rate[i] <= 1199:
    ratecolorCheck[2] = 1
  elif 1200 <= rate[i] and rate[i] <= 1599:
    ratecolorCheck[3] = 1
  elif 1600 <= rate[i] and rate[i] <= 1999:
    ratecolorCheck[4] = 1
  elif 2000 <= rate[i] and rate[i] <= 2399:
    ratecolorCheck[5] = 1
  elif 2400 <= rate[i] and rate[i] <= 2799:
    ratecolorCheck[6] = 1
  elif 2800 <= rate[i] and rate[i] <= 3199:
    ratecolorCheck[7] = 1
  else:
    maxColor += 1
for i in range(8):
  if ratecolorCheck[i] == 1:
    minColor += 1
    maxColor += 1
if minColor == 0:
  minColor = maxColor
print(str(minColor) + " " + str(maxColor))

Submission status: Wrong Answer

Solution code:
participant = int(input())
rate = list(map(int, input().split()))
ratecolorCheck = [0] *8
maxColor, minColor = 0, 0
for i in range(participant):
  if 1 <= rate[i] and rate[i] <= 399:
    ratecolorCheck[0] = 1
  elif 400 <= rate[i] and rate[i] <= 799:
    ratecolorCheck[1] = 1
  elif 800 <= rate[i] and rate[i] <= 1199:
    ratecolorCheck[2] = 1
  elif 1200 <= rate[i] and rate[i] <= 1599:
    ratecolorCheck[3] = 1
  elif 1600 <= rate[i] and rate[i] <= 1999:
    ratecolorCheck[4] = 1
  elif 2000 <= rate[i] and rate[i] <= 2399:
    ratecolorCheck[5] = 1
  elif 2400 <= rate[i] and rate[i] <= 2799:
    ratecolorCheck[6] = 1
  elif 2800 <= rate[i] and rate[i] <= 3199:
    ratecolorCheck[7] = 1
  else:
    maxColor += 1
for i in range(8):
  if ratecolorCheck[i] == 1:
    minColor += 1
    maxColor += 1
if minColor == 1:
  minColor = maxColor
print(str(minColor) + " " + str(maxColor))

Submission status: Wrong Answer

Solution code:
participant = int(input())
rate = list(map(int, input().split()))
ratecolorCheck = [0] *8
maxColor, minColor = 0, 0
for i in range(participant):
  if 1 <= rate[i] and rate[i] <= 399:
    ratecolorCheck[0] = 1
  elif 400 <= rate[i] and rate[i] <= 799:
    ratecolorCheck[1] = 1
  elif 800 <= rate[i] and rate[i] <= 1199:
    ratecolorCheck[2] = 1
  elif 1200 <= rate[i] and rate[i] <= 1599:
    ratecolorCheck[3] = 1
  elif 1600 <= rate[i] and rate[i] <= 1999:
    ratecolorCheck[4] = 1
  elif 2000 <= rate[i] and rate[i] <= 2399:
    ratecolorCheck[5] = 1
  elif 2400 <= rate[i] and rate[i] <= 2799:
    ratecolorCheck[6] = 1
  elif 2800 <= rate[i] and rate[i] <= 3199:
    ratecolorCheck[7] = 1
  else:
    maxColor += 1
for i in range(8):
  if ratecolorCheck[i] == 1:
    minColor += 1
    maxColor += 1
print(str(minColor) + " " + str(maxColor))

Submission status: Wrong Answer

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

for i in a:
    color[min(i, 3200) // 400] += 1

x = 8 - color[:-1].count(0)
ans = [max(0, x), x + color[8]]
print(' '.join(map(str, ans)))

Submission status: Wrong Answer

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

for i in a:
    color[min(i, 3200) // 400] += 1

x = 8 - color[:-1].count(0)
ans = [x, x + color[8]]
print(' '.join(map(str, ans)))

Submission status: Wrong Answer

Solution code:
N=input()
N=int(N)
a=input()
a=a.split()
score=[0]*8
legend=0
inrank=0
a=[int(item) for item in a]
for i in range(0,N):
    p=int(a[i]/400)
    if p >= 8:
        legend+=1
    else:
        score[p]=1
inrank=score.count(1)
if legend!=0:
    if inrank==0:
        t_max=legend
        t_min=0
    else:
        t_max=inrank+legend
        t_min=inrank
else:
    t_max=inrank
    t_min=inrank
print(str(t_min)+" "+str(t_max))

Submission status: Wrong Answer

Solution code:
N=input()
N=int(N)
a=input()
a=a.split()
score=[0]*8
legend=0
inrank=0
a=[int(item) for item in a]
for i in range(N):
    p=int(a[i]/400)
    if p >= 8:
        legend+=1
    else:
        score[p]=1
inrank=score.count(1)
if legend!=0:
    if inrank==0:
        t_max=legend
        t_min=0
    else:
        t_max=inrank+legend
        t_min=inrank
else:
    t_max=inrank
    t_min=inrank
print(str(t_min)+" "+str(t_max))

Submission status: Wrong Answer

Solution code:
N=input()
N=int(N)
a=input()
a=a.split()
score=[0]*8
legend=0
a=[int(item) for item in a]
for i in range(N):
    p=int(a[i]/400)
    if p >= 8:
        legend+=1
    else:
        score[p]=1
   
print(str(score.count(1))+" "+str(score.count(1)+legend))

Submission status: Wrong Answer

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

print(str(score.count(1))+" "+str(score.count(1)+legend))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

d = defaultdict(int)
for a in A:
    if a < 400:
        d[0] += 1
    elif 400 <= a < 800:
        d[1] += 1
    elif 800 <= a < 1200:
        d[2] += 1
    elif 1200 <= a < 1600:
        d[3] += 1
    elif 1600 <= a < 2000:
        d[4] += 1
    elif 2000 <= a < 2400:
        d[5] += 1
    elif 2400 <= a < 2800:
        d[6] += 1
    elif 2800 <= a < 3200:
        d[7] += 1
    else:
        d[8] += 1

cnt = 0
for i in range(8):
    if d[i]:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

d = defaultdict(int)
for a in A:
    if a < 400:
        d[0] += 1
    elif 400 <= a < 800:
        d[1] += 1
    elif 800 <= a < 1200:
        d[2] += 1
    elif 1200 <= a < 1600:
        d[3] += 1
    elif 1600 <= a < 2000:
        d[4] += 1
    elif 2000 <= a < 2400:
        d[5] += 1
    elif 2400 <= a < 2800:
        d[6] += 1
    elif 2800 <= a < 3200:
        d[7] += 1
    else:
        d[8] += 1

cnt = 0
for i in range(8):
    if d[i]:
        cnt += 1

print(cnt, cnt+d[8])

Submission status: Wrong Answer

Solution code:
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    color = [0]*8
    ans_max = 0
    for i in a:
        if 1<= i <= 399:
            color[0] = 1
        elif i <= 799:
            color[1]=1
        elif i <= 1199:
            color[2] = 1
        elif i <= 1599:
            color[3] = 1
        elif i <= 1999:
            color[4] = 1
        elif i <= 2399:
            color[5] = 1
        elif i <= 2799:
            color[6] = 1
        elif i <= 3199:
            color[7] = 1
        else:
            ans_max += 1
    print(max(1,sum(color)),min(8,ans_max+sum(color)))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    a = sorted(a)
    color=[0]*8
    over = 0
    ans_min = 0
    ans_max = 0
    for i in a:
        if i <3200:
            color[i//400]=1
        else:
            over += 1
    if sum(color):
        for i in color:
            if i:
                ans_min += 1
                ans_max += 1
        for j in range(over):
            if ans_max < 8:
                ans_max += 1
    else:
        ans_min = 1
        ans_max = 1
        for i in range(over-1):
            if ans_max <8:
                ans_max += 1
    print(ans_min,ans_max)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    color=[0]*8
    ather = 0
    for i in a:
        if i <3200:
            color[i//400]=1
        else:
            ather += 1
    print(max(sum(color),1),min(8,sum(color)+ather))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    color=[0]*8
    ather = 0
    for i in a:
        if i <3200 and not color[i//400]:
            color[i//400]=1
        else:
            ather += 1
    print(max(sum(color),1),min(8,sum(color)+ather))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n=int(input())
    a=list(map(int,input().split(' ')))
    color=[0]*8
    ather = 0
    for i in a:
        if i <3200 and not color[i//400]:
            color[i//400]=1
        else:
            ather += 1
    print(max(sum(color),1),sum(color)+ather)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

score_list = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
counter = [0] * 9
for i in range(len(a)):
    if a[i] >= 3200:
        counter[8] += 1
    for j in range(8):
        if a[i] < score_list[j]:
            counter[j] += 1
            break
ans_min = 0
for i in range(len(counter) - 1):
    if counter[i] != 0:
        ans_min += 1

if counter[8] >= 1:
    ans_max = ans_min + counter[8]
else:
    ans_max = ans_min
print(ans_min, ans_max)

Submission status: Wrong Answer

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

score_list = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
counter = [0] * 9
for i in range(len(a)):
    if a[i] >= 3200:
        counter[8] += 1
    for j in range(8):
        if a[i] < score_list[j]:
            counter[j] += 1
            break
ans_min = 0
for i in range(len(counter) - 1):
    if counter[i] != 0:
        ans_min += 1

if counter[8] >= 1:
    ans_max = min(ans_min + counter[8], 8)
else:
    ans_max = ans_min
print(ans_min, ans_max)

Submission status: Wrong Answer

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

score_list = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
counter = [0] * 9
for i in range(len(a)):
    if a[i] >= 3200:
        counter[8] += 1
    for j in range(8):
        if a[i] < score_list[j]:
            counter[j] += 1
            break
ans_min = 0
for i in range(len(counter) - 1):
    if counter[i] != 0:
        ans_min += 1

if counter[8] >= 2:
    ans_max = min(ans_min + counter[8], 8)
else:
    ans_max = ans_min
print(ans_min, ans_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]
cmin = 0
cmax = 0

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

if cmin == 0 :
    cmin = 1
    cmax = color[8]
elif cmin == 8 :
    cmax = 8
else :
    cmax = cmin + color[8]
if cmax > 8 :
    cmax = 8
print (cmin, cmax)

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]
cmin = 0
cmax = 0

for i in range(n) :
    if a[i] < 400 :
        color[0] += 1
    elif a[i] < 800 :
        color[1] += 1
    elif a[i] < 1200 :
        color[2] += 1
    elif a[i] < 1600 : 
        color[3] += 1
    elif a[i] < 2000 :
        color[4] += 1
    elif a[i] < 2400 :
        color[5] += 1
    elif a[i] < 2800 :
        color[6] += 1
    elif a[i] < 3200 :
        color[7] += 1
    else :
        color[8] += 1
        
for i in range(len(color)-1) :
    if color[i] > 0 :
        cmin  += 1

if cmin == 0 :
    cmin = 1
    cmax = color[8]
else :
    cmax = cmin + color[8]
if cmax > 8 :
    cmax = 8
print (cmin, cmax)

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]
cmin = 0
cmax = 0

for i in range(n) :
    if a[i] < 400 :
        color[0] += 1
    elif a[i] < 800 :
        color[1] += 1
    elif a[i] < 1200 :
        color[2] += 1
    elif a[i] < 1600 : 
        color[3] += 1
    elif a[i] < 2000 :
        color[4] += 1
    elif a[i] < 2400 :
        color[5] += 1
    elif a[i] < 2800 :
        color[6] += 1
    elif a[i] < 3200 :
        color[7] += 1
    else :
        color[8] += 1
        
for i in range(len(color)-1) :
    if color[i] > 0 :
        cmin  += 1
        
if cmin == 0 :
    cmin = 1
    if color[8] > 8 :
        cmax = 8
    else :
        cmax = color[8]
else :
    if cmin + color[8] > 8 :
        cmax = 8
    else :
        cmax = cmin + color[8]
print (cmin, cmax)

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]
cmin = 0
cmax = 0

for i in range(n) :
    if a[i] < 400 :
        color[0] += 1
    elif a[i] < 800 :
        color[1] += 1
    elif a[i] < 1200 :
        color[2] += 1
    elif a[i] < 1600 : 
        color[3] += 1
    elif a[i] < 2000 :
        color[4] += 1
    elif a[i] < 2400 :
        color[5] += 1
    elif a[i] < 2800 :
        color[6] += 1
    elif a[i] < 3200 :
        color[7] += 1
    else :
        color[8] += 1
for i in range(len(color)-1) :
    if color[i] > 0 :
        cmin  += 1
if cmin + color[8] > 8 :
    cmax = 8
else :
    cmax = cmin + color[8]
print (cmin, cmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
color = [0,0,0,0,0,0,0,0,0]
cmin = 0
cmax = 0

for i in range(n) :
    if a[i] < 400 :
        color[0] += 1
    elif a[i] < 800 :
        color[1] += 1
    elif a[i] < 1200 :
        color[2] += 1
    elif a[i] < 1600 : 
        color[3] += 1
    elif a[i] < 2000 :
        color[4] += 1
    elif a[i]< 2400:
        color[5] += 1
    elif a[i] < 2800 :
        color[6] += 1
    elif a[i] < 3200 :
        color[7] += 1
    else :
        color[8] += 1
for i in range(len(color)-1) :
    if color[i] > 0 :
        cmin  += 1
if cmin + color[8] > 8 :
    cmax = 8
else :
    cmax = cmin + color[8]
print (cmin, cmax)

Submission status: Wrong Answer

Solution code:
n = int(input());l = [0]*9
for i in map(int, input().split()):l[min(8,i//400)]+=1
mn = len(list(filter(lambda x:x>0, l[:8])))
print(max(1, mn), min(8, mn+l[8]))

Submission status: Wrong Answer

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

t1 = []
t2 = []
t3 = []
t4 = []
t5 = []
t6 = []
t7 = []
t8 = []
t9 = []
counter = 0

for i in range(n):
    if 1 <= a[i] <= 399:
        t1.append(a[i])
    elif 400 <= a[i] <= 799:
        t2.append(a[i])
    elif 800 <= a[i] <= 1199:
        t3.append(a[i])
    elif 1200 <= a[i] <= 1599:
        t4.append(a[i])
    elif 1600 <= a[i] <= 1999:
        t5.append(a[i])
    elif 2000 <= a[i] <= 2399:
        t6.append(a[i])
    elif 2400 <= a[i] <= 2799:
        t7.append(a[i])
    elif 2800 <= a[i] <= 3199:
        t8.append(a[i])
    else:
        t9.append(a[i])
        
if t1:
    counter +=1
if t2:
    counter +=1
if t3:
    counter +=1
if t4:
    counter +=1
if t5:
    counter +=1
if t6:
    counter +=1
if t7:
    counter +=1
if t8:
    counter +=1

niji = len(t9)
print(max(counter,1),min(8,counter + niji))