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())
s = list(map(int, input().split()))
a = [0]*9
mn = 400
mx = 399
for i in s:
    if 1 <= i <= mx:
        a[0] = 1
    elif mn <= i <= mx+mn:
        a[1] = 1
    elif mn*2 <= i <= mx+mn*2:
        a[2] = 1
    elif mn*3 <= i <= mx+mn*3:
        a[3] = 1
    elif mn*4 <= i <= mx+mn*4:
        a[4] = 1
    elif mn*5 <= i <= mx+mn*5:
        a[5] = 1
    elif mn*6 <= i <= mx+mn*6:
        a[6] = 1
    elif mn*7 <= i <= mx+mn*7:
        a[7] = 1
    elif  mn*8 <= i <= mn*12:
        a[8] += 1
if a[8] > 0:
    print(sum(a)-a[8],sum(a))
else:
    print(sum(a), sum(a))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int, input().split()))
a = [0]*9
mn = 400
mx = 399
for i in s:
    if 1 <= i <= mx:
        a[0] = 1
    elif mn <= i <= mx+mn:
        a[1] = 1
    elif mn*2 <= i <= mx+mn*2:
        a[2] = 1
    elif mn*3 <= i <= mx+mn*3:
        a[3] = 1
    elif mn*4 <= i <= mx+mn*4:
        a[4] = 1
    elif mn*5 <= i <= mx+mn*5:
        a[5] = 1
    elif mn*6 <= i <= mx+mn*6:
        a[6] = 1
    elif mn*7 <= i <= mx+mn*7:
        a[7] = 1
    elif i >= mn*8:
        a[8] += 1
if a[8] > 0:
    print(sum(a)-a[8],sum(a))
else:
    print(sum(a), sum(a))

Submission status: Wrong Answer

Solution code:
def ratecount(n , a):

    ansmin = 0
    ansmax = 0
    highrater = 0
    leftnumeral = [1 , 400 , 800 , 1200 , 1600 , 2000 , 2400 , 2800]
    rightnumeral = [399 , 799 , 1199 , 1599 , 1999 , 2399 , 2799 , 3199]
    count = [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0]

    for i in range(len(leftnumeral)):
        for w in range(n):
            if int(a[w]) >= int(leftnumeral[i]) and int(a[w]) <= int(rightnumeral[i]) and int(count[i]) == 0:
                count[i] = 1

    for i in range(n):
        if int(a[i]) >= 3200:
            highrater += 1

    if sum(count) == 0:
        ansmin = 1
        ansmax = highrater if highrater <= 8 else 8
    else:
        ansmin = sum(count)
        ansmax = (sum(count) + highrater) if sum(count) + highrater <= len(leftnumeral) else 8

    return str(ansmin) + " " + str(ansmax)

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(ratecount(n , a))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def ratecount(n , a):

    ansmin = 0
    ansmax = 0
    highrater = 0
    leftnumeral = [1 , 400 , 800 , 1200 , 1600 , 2000 , 2400 , 2800]
    rightnumeral = [399 , 799 , 1199 , 1599 , 1999 , 2399 , 2799 , 3199]
    count = [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0]

    for i in range(len(leftnumeral)):
        for w in range(n):
            if int(a[w]) >= int(leftnumeral[i]) and int(a[w]) <= int(rightnumeral[i]) and int(count[i]) == 0:
                count[i] = 1

    for i in range(n):
        if int(a[i]) >= 3200:
            highrater += 1

    if sum(count) == 0:
        ansmin = 1
        ansmax = highrater
    else:
        ansmin = sum(count)
        ansmax = (sum(count) + highrater) if sum(count) + highrater <= len(leftnumeral) else 8

    return str(ansmin) + " " + str(ansmax)

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(ratecount(n , a))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def ratecount(n , a):

    ansmin = 0
    ansmax = 0
    highrater = 0
    leftnumeral = [1 , 400 , 800 , 1200 , 1600 , 2000 , 2400 , 2800]
    rightnumeral = [399 , 799 , 1199 , 1599 , 1999 , 2399 , 2799 , 3199]
    count = [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0]

    for i in range(len(leftnumeral)):
        for w in range(n):
            if int(a[w]) >= int(leftnumeral[i]) and int(a[w]) <= int(rightnumeral[i]) and int(count[i]) == 0:
                count[i] = 1

    for i in range(n):
        if int(a[i]) >= 3200:
            highrater += 1

    if sum(count) == 0:
        ansmin = highrater
        ansmax = highrater
    else:
        ansmin = sum(count)
        ansmax = (sum(count) + highrater) if sum(count) + highrater <= len(leftnumeral) else 8

    return str(ansmin) + " " + str(ansmax)

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(ratecount(n , a))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = [0 for i in range(8)]
over = 0
for i in range(n):
  if a[i] >= 3200:
    over += 1
  else:
    ans[a[i]//400] = 1
    
print(str(max(1, sum(ans))) + " " + str(min(9, sum(ans)+over)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = [0 for i in range(9)]
over = 0
for i in range(n):
  if a[i] >= 3200:
    over += 1
  else:
    ans[a[i]//400] = 1
    
print(str(sum(ans)) + " " + str(min(9, sum(ans)+over)))

Submission status: Wrong Answer

Solution code:
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

N=one_int()

A=many_int()

def color_check(num):
    if 1<=num<=399:
        return "hai"
    elif 400<=num<=799:
        return "tya"
    elif 800<=num<=1199:
        return "midori"
    elif 1200<=num<=1599:
        return "mizu"
    elif 1600<=num<=1999:
        return "ao"
    elif 2000<=num<=2399:
        return "ki"
    elif 2400<=num<=2799:
        return "dai"
    elif 2800<=num<=3199:
        return "aka"
    return ""

output = []
overs = 0
for a in A:
    if a >= 3200:
        overs+=1
    else:
        output.append(color_check(a))

cols = len(set(output))
print(cols, cols+overs)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
rate = [0]*9
ans = 0

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

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

if rate[8] != 0:
    print(ans, ans+rate[8])
elif ans == 0:
    print("1", rate[8])
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
rate = [0]*9
ans = 0

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

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

if rate[8] != 0:
    print(ans, ans+rate[8])
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0 for i in range(13)]
for i in map(int, input().split()):
    a[i // 400] += 1
ans = 0
add = 0
for i in range(8):
    if a[i]:
        ans += 1
for i in range(8,13):
    if a[i]:
        add += a[i]
if ans == 0:
    print(1, min(add, 8))
else:
    print(ans, min(ans+add, 8))
# print(add, a)

Submission status: Wrong Answer

Solution code:
int_n = int(input())
arr_int_a = list(map(int, input().split()))

w_s = set()
counter = 0
for i in arr_int_a:
    if i < 3200:
        w_s.add(i // 400)
    else:
        counter += 1

print(len(w_s), len(w_s) + counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
color = [0] * 9
flag = False
for i in range(len(A)):
	flag = False
	for j in range(8):
		if 400 * j <= A[i] and A[i] <= 400 * (j + 1) - 1:
			color[j] = 1
			flag = True
	if flag == False:
		color[-1] += 1
print(sum(color[:-1]),sum(color))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
color = [0] * 9
flag = False
for i in range(len(A)):
	flag = False
	for j in range(8):
		if 400 * j <= A[i] and A[i] <= 400 * (j + 1) - 1:
			color[j] = 1
			flag = True
	if flag == False:
		color[-1] += 1
print(sum(color[:-1]),min(sum(color),8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a=list(map(int,input().split()))
b=[0]*8
x=0
for i in range(0,N):
    if a[i]>=3200:
        x=x+1
        continue
    b[a[i]//400]=1
y=x
for i in range(0,8):
    x=x+b[i]
print(x-y,x)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
rate = [0] * 8
rate_big = 0
for i in range(N):
    if A[i] < 3200:
        rate[A[i] // 400] += 1
    else:
        rate_big += 1
ans_min = 0
ans_max = 0
for j in range(8):
    if rate[j] > 0:
        ans_min += 1
if ans_min == 0:
    ans_min = 1
    ans_max = min(8, rate_big)
else:
    ans_max = min(8, ans_min+rate_big)
print(ans_min, ans_max, sep=" ")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
rate = [0] * 8
rate_big=0
for i in range(N):
    if A[i] < 3200:
        rate[A[i] // 400] += 1
    else:
        rate_big+=1
ans_min = 0
ans_max=0
for j in range(8):
    if rate[j] > 0:
        ans_min += 1
ans_max=min(8,ans_min+rate_big)
print(ans_min,ans_max,sep=" ")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
rate = [0] * 8
rate_big=0
for i in range(N):
    if A[i] < 3200:
        rate[A[i] // 400] += 1
    else:
        rate_big+=1
ans_min = 0
ans_max=0
for j in range(8):
    if rate[j] > 0:
        ans_min += 1
ans_max=min(8,ans_min+rate_big)
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
n=int(input())
ci=[0]*8
ov=0
a=list(map(int,input().split()))
for pt in a:
  if pt>=3200:
    ov+=1
  else:
    ci[pt//400]=1
ans = sum(ci)
print(max(1,ans),min(ans+ov,8))

Submission status: Wrong Answer

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

colors = [0 for _ in range(8)]
over = 0

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        over += 1

c = colors.count(1)

if over == 0:
    maxi = c
else:
    maxi = min(c + over, 7)

if c == 0:
    mini = 1
else:
    mini = c

print(mini, maxi)

Submission status: Wrong Answer

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

colors = [0 for _ in range(8)]
over = 0

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        over += 1

c = colors.count(1)
if over == 0:
    maxi = c
else:
    maxi = min(c + over, 8)

if c == 0:
    mini = 1
else:
    mini = c

print(mini, maxi)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

c = colors[:-1].count(1)

maxi = min(c + colors[-1], 8)

if c == 0:
    mini = 1
else:
    mini = c

print(mini, maxi)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = colors[:-1].count(1)
if minimum == 0:
    minimum += 1
    colors[8] -= 1

maximum = minimum
if colors[-1] != 0:
    zero_count = colors[:-1].count(0)
    over_count = colors[-1]
    maximum += min(zero_count, over_count)
    maximum = min(maximum, 8)

print(minimum, maximum)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = colors[:-1].count(1)
if minimum == 0:
    minimum += 1
    colors[8] -= 1

maximum = minimum
if colors[-1] != 0:
    zero_count = colors.count(0)
    over_count = colors[-1]
    maximum += min(zero_count, over_count)
    maximum = min(maximum, 8)

print(minimum, maximum)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = colors[:-1].count(1)
if minimum == 0:
    minimum += 1
    colors[8] -= 1

maximum = minimum
if colors[:-1] != 0:
    zero_count = colors.count(0)
    over_count = colors[-1]
    maximum += min(zero_count, over_count)

maximum = min(maximum, 8)

print(minimum, maximum)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = colors[:-1].count(1)
if minimum == 0:
    minimum += 1
    colors[8] -= 1

maximum = minimum
if colors[:-1] != 0:
    zero_count = colors.count(0)
    over_count = colors[-1]
    maximum += min(zero_count, over_count)

maximum = min(maximum, 7)

print(minimum, maximum)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = colors[:-1].count(1)
if minimum == 0:
    minimum += 1
    colors[8] -= 1
    
max = minimum
if colors[:-1] != 0:
    zero_count = colors.count(0)
    over_count = colors[-1]
    max += min(zero_count, over_count)

print(minimum, max)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1 <= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = colors[:-1].count(1)
max = minimum
if colors[:-1] != 0:
    zero_count = colors.count(0)
    over_count = colors[-1]
    max += min(zero_count, over_count)

print(minimum, max)

Submission status: Wrong Answer

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

colors = [0 for _ in range(9)]

for a in A:
    if 1<= a < 400:
        colors[0] = 1
    if 400 <= a < 800:
        colors[1] = 1
    if 800 <= a < 1200:
        colors[2] = 1
    if 1200 <= a < 1600:
        colors[3] = 1
    if 1600 <= a < 2000:
        colors[4] = 1
    if 2000 <= a < 2400:
        colors[5] = 1
    if 2400 <= a < 2800:
        colors[6] = 1
    if 2800 <= a < 3200:
        colors[7] = 1
    if 3200 <= a:
        colors[8] += 1

minimum = sum(colors[:-1])
zero_count = colors.count(0)
over_count = colors[-1]

max = 0
max = min(zero_count, over_count) + minimum

print(minimum, max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

## define
class ColorRank():
    def __init__(self, color, low, high):
        self.color = color
        self.low = low
        self.high = high
        self.cnt = 0

rate_list = [ ColorRank( "hai", 1, 399 )
             ,ColorRank( "cha", 400, 799 )
             ,ColorRank( "midori", 800, 1199 )
             ,ColorRank( "mizu", 1200, 1599 )
             ,ColorRank( "ao", 1600, 1999 )
             ,ColorRank( "ki", 2000, 2399 )
             ,ColorRank( "daidai", 2400, 2799 )
             ,ColorRank( "aka", 2800, 3199 )
             ,ColorRank( "top", 3200, 4800 )
             ]

## main
for an in An_list:
    for i,rate in enumerate( rate_list ):
        if rate.low <= an <= rate.high:
            rate_list[i].cnt += 1
            break

rateN = len([ color_rank for color_rank in rate_list if color_rank.cnt > 0 and color_rank.color != "top" ])
N_min = 1 if rate_list[8].cnt > 0 else 0
N_max = rate_list[8].cnt if rate_list[8].cnt > 0 else 0
rateN_min = rateN + N_min
rateN_max = rateN + N_max
print( ' '.join( [ str(rateN_min), str(rateN_max) ] ) )

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0

for i in a:
  if i > 0 and i < 400:
    gray += 1
  if i > 399 and i < 800:
    brown += 1
  if i > 799 and i < 1200:
    green += 1
  if i > 1199 and i < 1600:
    water += 1
  if i > 1599 and i < 2000:
    blue += 1
  if i > 1999 and i < 2400:
    yellow += 1
  if i > 2399 and i < 2800:
    orange += 1
  if i > 2799 and i < 3200:
    red += 1
  if i >= 3200:
    god += 1

l = [gray, brown, green, water, blue, yellow, orange, red]
count = 0
for i in l:
  if i > 0:
    count += 1

if count == 0 and god > 0:
  print("1" + " " + str(god - 1))
else:
  print(str(count) + " " + str(count + god))

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0

for i in a:
  if i > 0 and i < 400:
    gray += 1
  if i > 399 and i < 800:
    brown += 1
  if i > 799 and i < 1200:
    green += 1
  if i > 1199 and i < 1600:
    water += 1
  if i > 1599 and i < 2000:
    blue += 1
  if i > 1999 and i < 2400:
    yellow += 1
  if i > 2399 and i < 2800:
    orange += 1
  if i > 2799 and i < 3200:
    red += 1
  if i >= 3200:
    god += 1

l = [gray, brown, green, water, blue, yellow, orange, red]
count = 0
for i in l:
  if i > 0:
    count += 1

print(str(count) + " " + str(count + god))

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0

for i in a:
  if i > 1 and i < 400:
    gray += 1
  if i > 399 and i < 800:
    brown += 1
  if i > 799 and i < 1200:
    green += 1
  if i > 1199 and i < 1600:
    water += 1
  if i > 1599 and i < 2000:
    blue += 1
  if i > 1999 and i < 2400:
    yellow += 1
  if i > 2399 and i < 2800:
    orange += 1
  if i > 2799 and i < 3200:
    red += 1
  if i >= 3200:
    god += 1

l = [gray, brown, green, water, blue, yellow, orange, red]
count = 0
for i in l:
  if i > 0:
    count += 1

print(str(count) + " " + str(count + god))

Submission status: Wrong Answer

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

maximum = 0
minimum = 0
used = [0]*9
for i in A:
    i //= 400
    if i >= 8:
        maximum += 1
        if used[8] == 0:
            used[8] = 1
            minimum += 1
    elif used[i] == 0:
        maximum += 1
        minimum += 1
        used[i] = 1
if minimum == 0:
    minimum += 1
print(minimum, maximum)

Submission status: Wrong Answer

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

maximum = 0
minimum = 0
used = [0]*9
for i in A:
    i //= 400
    if i >= 8:
        maximum += 1
    elif used[i] == 0:
        maximum += 1
        minimum += 1
        used[i] = 1

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
 
maximum = 0
minimum = 0
for i in range(N):
    A[i] //= 400
for i in range(13):
    if i not in A:
        continue
    if i <= 6:
        minimum += 1
        maximum += 1
    else:
        maximum += A.count(i)
if maximum > minimum:
    minimum += 1
print(minimum, maximum)

Submission status: Wrong Answer

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

maximum = 0
minimum = 0
for i in range(N):
    A[i] //= 400

for i in range(12):
    if i not in A:
        continue
    if i <= 6:
        minimum += 1
        maximum += 1
    else:
        maximum += A.count(i)

if maximum > minimum:
    minimum += 1
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    scores = [i*400 for i in range(1, 8)]
    scores.reverse()

    scores_d = {}
    input()
    god = []
    for a in map(int,input().split()):
        if a >= 3200:
            god.append(a)
            break
        for i in scores:
            if a >= i:
                scores_d[i] = 1
                break
        if a < 400:
            scores_d[0] = 1

    counts = sum(scores_d.values())
    print(counts if counts > 0 else 1, counts + len(god))

main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    scores = [i*400 for i in range(1, 8)]
    scores.reverse()

    scores_d = {}
    input()
    god = []
    for a in map(int,input().split()):
        if a >= 3200:
            god.append(a)
        for i in scores:
            if a >= i:
                scores_d[i] = 1
                break
        if a < 400:
            scores_d[0] = 1

    counts = sum(scores_d.values())
    print(counts if counts > 0 else 1, counts + len(god))

main()

Submission status: Wrong Answer

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

color = [0] * 8
cnt = 0
for val in a:
    for i in range(8):
        if 400 * i <= val < 400 * (i + 1):
            color[i] = 1
    if val >= 3200:
            cnt += 1

s = sum(color)
l = sum(color) + cnt

print(s, l)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    scores = [i*400 for i in range(1, 8)]
    scores.reverse()

    scores_d = {}
    input()
    god = []
    for a in map(int,input().split()):
        if a >= 3200:
            god.append(a)
        for i in scores:
            if a >= i:
                scores_d[i] = 1
                break
        if a < 400:
            scores_d[0] = 1

    counts = sum(scores_d.values())
    print(counts, counts + len(god))

main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    scores = [i*400 for i in range(1, 8)]
    scores.reverse()

    scores_d = {}
    input()
    god = []
    for a in map(int,input().split()):
        if a >= 3200:
            god.append(a)
        for i in scores:
            if a >= i:
                scores_d[i] = 1
                break
        if a < 400:
            scores_d[0] = 1

    counts = sum(scores_d.values())
    print(counts, counts + min(len(god), 8))

main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    scores = [i*400 for i in range(1, 8)]
    scores.reverse()

    scores_d = {}
    input()
    god = []
    for a in map(int,input().split()):
        if a >= 3200:
            god.append(a)
        for i in scores:
            if a >= i:
                scores_d[i] = 1
                break

    counts = sum(scores_d.values())
    print(counts, counts + min(len(god), 8))

main()

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
C=[]
cnt=0
for i in A:
  if 1<=i<=399:
    C.append('a')
  elif 400<=i<=799:
    C.append('b')
  elif 800<=i<=1199:
    C.append('c')
  elif 1200<=i<=1599:
    C.append('d')
  elif 1600<=i<=1999:
    C.append('e')
  elif 2000<=i<=2399:
    C.append('f')
  elif 2400<=i<=2799:
    C.append('g')
  elif 2800<=i<=3199:
    C.append('h')
  else:
    cnt+=1
D=len(set(C))
if D==0:
  print(1,min(8,cnt))
else:
  minc=D
  maxc=min(8,minc+cnt)
  print(minc,maxc)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
C=[]
cnt=0
for i in A:
  if 1<=i<=399:
    C.append('a')
  elif 400<=i<=799:
    C.append('b')
  elif 800<=i<=1199:
    C.append('c')
  elif 1200<=i<=1599:
    C.append('d')
  elif 1600<=i<=1999:
    C.append('e')
  elif 2000<=i<=2399:
    C.append('f')
  elif 2400<=i<=2799:
    C.append('g')
  elif 2800<=i<=3199:
    C.append('h')
  else:
    cnt+=1

minc=max(len(set(C)),1)
maxc=min(8,minc+cnt)
print(minc,maxc)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
C=[]
cnt=0
for i in A:
  if 1<=i<=399:
    C.append('a')
  elif 400<=i<=799:
    C.append('b')
  elif 800<=i<=1199:
    C.append('c')
  elif 1200<=i<=1599:
    C.append('d')
  elif 1600<=i<=1999:
    C.append('e')
  elif 2000<=i<=2399:
    C.append('f')
  elif 2400<=i<=2799:
    C.append('g')
  elif 2800<=i<=3199:
    C.append('h')
  else:
    cnt+=1

minc=len(set(C))
maxc=min(8,minc+cnt)
print(minc,maxc)

Submission status: Wrong Answer

Solution code:
# 2020/01/30
# AtCoder Beginner Contest 064 - C

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

# Count
ans = 0

a.sort()
wk_r = -1
a_max = 0
cnt = 0
for i in range(n):
    if a[i] >= 3200:
        a_max = cnt + (n - i)
        break
    
    rank = a[i] // 400
    if wk_r != rank:
        cnt = cnt + 1
        wk_r = rank

a_min = cnt
if a[n-1] < 3200:
    a_max = cnt

# Output
print(a_min, a_max)

Submission status: Wrong Answer

Solution code:
# 2020/01/30
# AtCoder Beginner Contest 064 - C

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

# Count
ans = 0

a.sort()
wk_r = 0
a_max = 0
cnt = 0
for i in range(n):
    if a[i] >= 3200:
        a_max = cnt + (n - i)
        break
    
    rank = a[i] // 400
    if wk_r != rank:
        cnt = cnt + 1
        wk_r = rank

a_min = cnt
if a[n-1] < 3200:
    a_max = cnt

# Output
print(a_min, a_max)

Submission status: Wrong Answer

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

l = [0 for i in range(9)]
for a in A:
  ind = 0
  while ind < 8:
    if a < (ind+1)*400:
      break
    ind += 1
  l[ind] += 1

ans_max = 0
ans_min = 0
for i in range(0, 8):
  if l[i] > 0:
    ans_max += 1
    ans_min += 1
if l[-1] > 0:
  ans_max = min(ans_max + l[-1] , 9)
  ans_min = max(ans_min, 1)
print(ans_min, ans_max)