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:
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [False] * 8
    sub_color = 0
    count = 0
    for score in a:
        if 1 <= score <= 399:
            color[0] = True
            continue
        for i in range(1,8):
            if i*400 <= score <= 399+(i*400):
                color[i] = True
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j:
            count += 1
    if count == 0:
        print(1, sub_color, sep=" ")
    else:
        if count + sub_color >= 8:
            print(count, 8, sep=" ")
        else:
            print(count, count+sub_color, sep=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [False] * 8
    sub_color = 0
    count = 0
    for score in a:
        if 1 <= score <= 399:
            color[0] = True
            continue
        for i in range(1,8):
            if i*400 <= score <= 399+(i*400):
                color[i] = True
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j:
            count += 1
    if count + sub_color >= 8:
            print(count, 8, sep=" ")
    else:
            print(count, count+sub_color, sep=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [0] * 8
    sub_color = 0
    count = 0
    for score in a:
        if 1<= score <= 399:
            color[0] += 1
            continue
        for i in range(1,8):
            if i*400 <= score <= 399+(i*400):
                color[i] += 1
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j != 0:
            count += 1
    if count + sub_color >= 8:
        if count < sub_color:
            print(sub_color, 8, sep=" ")
        else:
            print(count, 8, sep=" ")
    else:
        if count < sub_color:
            print(sub_color, count+sub_color, sep=" ")
        else:
            print(count, count+sub_color, sep=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [0] * 8
    sub_color = 0
    count = 0
    for score in a:
        if 1<= score <= 399:
            color[0] += 1
            continue
        for i in range(1,8):
            if i*400 <= score <= 399+(i*400):
                color[i] += 1
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j != 0:
            count += 1
    if count + sub_color >= 8:
        print(count, 8, sep=" ")
    else:
        print(count, count+sub_color, sep=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [0] * 8
    sub_color = 0
    count = 0
    for score in a:
        if score <= 0:
            continue
        for i in range(8):
            if i*400 < score <= 399+(i*400):
                color[i] += 1
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j != 0:
            count += 1
    if count + sub_color >= 8:
        print(count, 8, sep=" ")
    else:
        print(count, count+sub_color, sep=" ")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))
    color = [0] * 8
    sub_color = 0
    count = 0
    for score in a:
        for i in range(8):
            if i*400 <= score <= 399+(i*400):
                color[i] += 1
        if score >= 3200:
            sub_color += 1
    for j in color:
        if j != 0:
            count += 1
    if count + sub_color >= 8:
        print(count, 8, sep=" ")
    else:
        print(count, count+sub_color, sep=" ")
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

color = [False] * 8
cnt = 0
for i in range(N):
    if a[i] <= 399:
        color[0] = True
    elif a[i] <= 799:
        color[1] = True
    elif a[i] <= 1199:
        color[2] = True
    elif a[i] <= 1599:
        color[3] = True
    elif a[i] <= 1999:
        color[4] = True
    elif a[i] <= 2399:
        color[5] = True
    elif a[i] <= 2799:
        color[6] = True
    elif a[i] <= 3199:
        color[7] = True
    elif a[i] <= 4800:
        cnt += 1

print(sum(color), sum(color) + cnt)

Submission status: Wrong Answer

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

color = [False] * 8
cnt = 0
for i in range(N):
    if a[i] <= 399:
        color[0] = True
    elif a[i] <= 799:
        color[1] = True
    elif a[i] <= 1199:
        color[2] = True
    elif a[i] <= 1599:
        color[3] = True
    elif a[i] <= 1999:
        color[4] = True
    elif a[i] <= 2399:
        color[5] = True
    elif a[i] <= 2799:
        color[6] = True
    elif a[i] <= 3199:
        color[7] = True
    elif a[i] <= 4800:
        cnt += 1

print(sum(color), min(sum(color) + cnt, 9))

Submission status: Wrong Answer

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

color = [False] * 8
cnt = 0
for i in range(N):
    if a[i] <= 399:
        color[0] = True
    elif a[i] <= 799:
        color[1] = True
    elif a[i] <= 1199:
        color[2] = True
    elif a[i] <= 1599:
        color[3] = True
    elif a[i] <= 1999:
        color[4] = True
    elif a[i] <= 2399:
        color[5] = True
    elif a[i] <= 2799:
        color[6] = True
    elif a[i] <= 3199:
        color[7] = True
    elif a[i] <= 4800:
        cnt += 1

#for i in range(2):
if cnt > sum(color):
    print(sum(color) + (cnt - sum(color)), min(sum(color) + cnt, 8))
else:
    print(sum(color), min(sum(color) + cnt, 8))

Submission status: Wrong Answer

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

color = [False] * 8
cnt = 0
for i in range(N):
    if a[i] <= 399:
        color[0] = True
    elif a[i] <= 799:
        color[1] = True
    elif a[i] <= 1199:
        color[2] = True
    elif a[i] <= 1599:
        color[3] = True
    elif a[i] <= 1999:
        color[4] = True
    elif a[i] <= 2399:
        color[5] = True
    elif a[i] <= 2799:
        color[6] = True
    elif a[i] <= 3199:
        color[7] = True
    elif a[i] <= 4800:
        cnt += 1

print(sum(color), min(sum(color) + cnt, 8))

Submission status: Wrong Answer

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

ls2 = [i // 400 for i in list(s)]
ls3 = [ 8 if i >8 else i for i in ls2]
ls4 = [i for i in ls3 if i  != 8 ]
ls5 = [i for i in ls3 if i  == 8 ]

import collections
c3 = collections.Counter(ls3)
c4 = collections.Counter(ls4)
print(str(max(len(c4),1)) + " " + str(min(8,len(c4)+c3[8])))

Submission status: Wrong Answer

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

ls2 = [i // 400 for i in list(s)]
ls3 = [ 8 if i >8 else i for i in ls2]
ls4 = [i for i in ls3 if i  != 8 ]
ls5 = [i for i in ls3 if i  == 8 ]

import collections
c3 = collections.Counter(ls3)
c4 = collections.Counter(ls4)
print(str(len(c4)) + " " + str(min(8,len(c4)+c3[8])))

Submission status: Wrong Answer

Solution code:
n=int(input())

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

memo = [0]*9

for i in t:
    if 1<= i and i<400:
        memo[0] += 1
    elif 400<= i and i<800:
        memo[1] += 1
    elif 800<= i and i<1200:
        memo[2] += 1
    elif 1200<= i and i<1600:
        memo[3] += 1
    elif 1600<= i and i<2000:
        memo[4] += 1
    elif 2000<= i and i<2400:
        memo[5] += 1
    elif 2400<= i and i<2800:
        memo[6] += 1
    elif 2800<= i and i<3200:
        memo[7] += 1
    else:
        memo[8] += 1

ans = 0

for i in range(len(memo)):
    if i == 8:
        ex = memo[-1]
    elif memo[i] != 0:
        ans += 1

print(ans, ans+ex)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

memo = [0]*9

for i in t:
    if 1<= i and i<400:
        memo[0] += 1
    elif 400<= i and i<800:
        memo[1] += 1
    elif 800<= i and i<1200:
        memo[2] += 1
    elif 1200<= i and i<1600:
        memo[3] += 1
    elif 1600<= i and i<2000:
        memo[4] += 1
    elif 2000<= i and i<2400:
        memo[5] += 1
    elif 2400<= i and i<2800:
        memo[6] += 1
    elif 2800<= i and i<3100:
        memo[7] += 1
    else:
        memo[8] += 1

ans = 0

for i in range(len(memo)):
    if i == 8:
        ex = memo[-1]
    elif memo[i] != 0:
        ans += 1

print(ans, ans+ex)

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(item) for item in input().split()][:n]
print(array)
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in array:
    if rate > 0 and rate < 400:
        colors[0] += 1
    elif rate < 800:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    elif rate <= 4800:
        colors[8] += 1

count = 0
count += 1 if colors[0] > 0 else 0
count += 1 if colors[1] > 0 else 0
count += 1 if colors[2] > 0 else 0
count += 1 if colors[3] > 0 else 0
count += 1 if colors[4] > 0 else 0
count += 1 if colors[5] > 0 else 0
count += 1 if colors[6] > 0 else 0
count += 1 if colors[7] > 0 else 0
min = count
count += colors[8]
max = count
if max > 0 and min == 0:
    min = 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(item) for item in input().split()][:n]
print(array)
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in array:
    if rate > 0 and rate < 400:
        colors[0] += 1
    elif rate < 800:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    elif rate <= 4800:
        colors[8] += 1

count = 0
count += 1 if colors[0] > 0 else 0
count += 1 if colors[1] > 0 else 0
count += 1 if colors[2] > 0 else 0
count += 1 if colors[3] > 0 else 0
count += 1 if colors[4] > 0 else 0
count += 1 if colors[5] > 0 else 0
count += 1 if colors[6] > 0 else 0
count += 1 if colors[7] > 0 else 0
min = count if count > 0 else 1
count += colors[8]
max = count

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

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(item) for item in input().split()][:n]
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in array:
    if rate > 0 and rate < 400:
        colors[0] += 1
    elif rate < 800:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    elif rate <= 4800:
        colors[8] += 1

count = 0
count += 1 if colors[0] > 0 else 0
count += 1 if colors[1] > 0 else 0
count += 1 if colors[2] > 0 else 0
count += 1 if colors[3] > 0 else 0
count += 1 if colors[4] > 0 else 0
count += 1 if colors[5] > 0 else 0
count += 1 if colors[6] > 0 else 0
count += 1 if colors[7] > 0 else 0
min = count
count += colors[8]
max = count

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

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(item) for item in input().split()][:n]
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in array:
    if rate < 400:
        colors[0] += 1
    elif rate < 800:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    else:
        colors[8] += 1

count = 0
count += 1 if colors[0] > 0 else 0
count += 1 if colors[1] > 0 else 0
count += 1 if colors[2] > 0 else 0
count += 1 if colors[3] > 0 else 0
count += 1 if colors[4] > 0 else 0
count += 1 if colors[5] > 0 else 0
count += 1 if colors[6] > 0 else 0
count += 1 if colors[7] > 0 else 0
min = count
count += colors[8]
max = count

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

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(item) for item in input().split()][:n]
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in array:
    if rate == 0:
        continue
    if rate > 0 and rate < 400:
        colors[0] += 1
    elif rate < 700:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    else:
        colors[8] += 1

count = 0
count += 1 if colors[0] > 0 else 0
count += 1 if colors[1] > 0 else 0
count += 1 if colors[2] > 0 else 0
count += 1 if colors[3] > 0 else 0
count += 1 if colors[4] > 0 else 0
count += 1 if colors[5] > 0 else 0
count += 1 if colors[6] > 0 else 0
count += 1 if colors[7] > 0 else 0
min = count
count += colors[8]
max = count

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

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(item) for item in input().split()][:n]
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in array:
    if rate < 400:
        colors[0] += 1
    elif rate < 700:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    else:
        colors[8] += 1

count = 0
count += 1 if colors[0] > 0 else 0
count += 1 if colors[1] > 0 else 0
count += 1 if colors[2] > 0 else 0
count += 1 if colors[3] > 0 else 0
count += 1 if colors[4] > 0 else 0
count += 1 if colors[5] > 0 else 0
count += 1 if colors[6] > 0 else 0
count += 1 if colors[7] > 0 else 0
min = count
count += colors[8]
max = count

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

Submission status: Wrong Answer

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

from math import factorial
from itertools import combinations
from collections import Counter
from copy import deepcopy
from operator import mul
from functools import reduce

def main():
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9
    over3200 = 0
    for ia in a:
        if ia < 3200:
            #print(ia//400)
            colors[ia//400] = 1
        else:
            over3200 += 1

    if sum(colors) == 0:
        r_min = 1
        r_max = over3200
    else:
        r_min = sum(colors)
        r_max = min(8, sum(colors) + over3200)
    print(r_min, r_max)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

from math import factorial
from itertools import combinations
from collections import Counter
from copy import deepcopy
from operator import mul
from functools import reduce

def main():
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9
    over3200 = 0
    for ia in a:
        if ia < 3200:
            #print(ia//400)
            colors[ia//400] = 1
        else:
            over3200 += 1

    r_min = max(sum(colors), min(1, over3200))
    r_max = min(8, sum(colors) + over3200)
    print(r_min, r_max)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

from math import factorial
from itertools import combinations
from collections import Counter
from copy import deepcopy
from operator import mul
from functools import reduce

def main():
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9
    over3200 = 0
    for ia in a:
        if ia < 3200:
            #print(ia//400)
            colors[ia//400] = 1
        else:
            over3200 += 1

    r_min = max(sum(colors), 1)
    r_max = min(8, sum(colors) + over3200)
    print(r_min, r_max)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

from math import factorial
from itertools import combinations
from collections import Counter
from copy import deepcopy
from operator import mul
from functools import reduce

def main():
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9
    over3200 = 0
    for ia in a:
        if ia < 3200:
            #print(ia//400)
            colors[ia//400] = 1
        else:
            over3200 += 1

    r_min = sum(colors)
    r_max = min(8, r_min + over3200)
    print(r_min, r_max)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[0]*9
for i in map(int,input().split()):
  i//=400
  if i<8: l[i]=1
  else: l[8]+=1
print(sum(l[:8]),sum(l))

Submission status: Wrong Answer

Solution code:

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

color=[0 for i in range(7)]
free=0

for rate in a:
    if(rate<=399):
        color[0]+=1
    elif(rate<=799):
        color[1]+=1
    elif(rate<=1599):
        color[2]+=1
    elif(rate<=1999):
        color[3]+=1
    elif(rate<=2399):
        color[4]+=1
    elif(rate<=2799):
        color[5]+=1
    elif(rate<=3199):
        color[6]+=1
    else:
        free+=1

if(free == N ):
    print(1,free)
else:
    ans=len([i for i in color if i != 0])
    print(ans,ans+free)

Submission status: Wrong Answer

Solution code:

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

color=[0 for i in range(7)]
free=0

for rate in a:
    if(rate<=399):
        color[0]+=1
    elif(rate<=799):
        color[1]+=1
    elif(rate<=1599):
        color[2]+=1
    elif(rate<=1999):
        color[3]+=1
    elif(rate<=2399):
        color[4]+=1
    elif(rate<=2799):
        color[5]+=1
    elif(rate<=3199):
        color[6]+=1
    else:
        free+=1


ans=len([i for i in color if i != 0])

print(ans,ans+free)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
lst=[0]*8
num=0
for i in range(n):
  for j in range(8):
    if 400*j<=a[i]<400*(j+1):
      if lst[j]==0:
        lst[j]+=1
  if 3200<=a[i]:
    num+=1
print(*[sum(lst),sum(lst)+num])

Submission status: Wrong Answer

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

rate = [False] * 9

for a in aa:
    if a < 400:
        rate[0] = True
    elif a < 800:
        rate[1] = True
    elif a < 1200:
        rate[2] = True
    elif a < 1600:
        rate[3] = True
    elif a < 2000:
        rate[4] = True
    elif a < 2400:
        rate[5] = True
    elif a < 2800:
        rate[6] = True
    elif a < 3200:
        rate[7] = True
    else:
        rate[8] += 1

not_free_rate = rate.count(True)
free_rate = rate[8]


if not_free_rate >= 1:
    min_num = not_free_rate
if not_free_rate == 0:
    min_num = 1


print(min_num, not_free_rate+free_rate)

Submission status: Wrong Answer

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

rate = [False] * 9

for a in aa:
    if a < 400:
        rate[0] = True
    elif a < 800:
        rate[1] = True
    elif a < 1200:
        rate[2] = True
    elif a < 1600:
        rate[3] = True
    elif a < 2000:
        rate[4] = True
    elif a < 2400:
        rate[5] = True
    elif a < 2800:
        rate[6] = True
    elif a < 3200:
        rate[7] = True
    else:
        rate[8] += 1

not_free_rate = rate.count(True)
free_rate = rate[8]

if not_free_rate == 0:
    min_num = 1
else:
    min_num = not_free_rate

print(min_num, not_free_rate+free_rate)

Submission status: Wrong Answer

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

rate = [False] * 9

for a in aa:
    if a < 400:
        rate[0] = True
    elif a < 800:
        rate[1] = True
    elif a < 1200:
        rate[2] = True
    elif a < 1600:
        rate[3] = True
    elif a < 2000:
        rate[4] = True
    elif a < 2400:
        rate[5] = True
    elif a < 2800:
        rate[6] = True
    elif a < 3200:
        rate[7] = True
    else:
        rate[8] += 1

not_free_rate = rate.count(True)
free_rate = rate[8]

if not_free_rate == 0:
    min_num = 1
else:
    min_num = not_free_rate

print(min_num, min(not_free_rate+free_rate, 8))

Submission status: Wrong Answer

Solution code:
def ratecolor(List):
    ratebar = [0]*8
    for r in List:
        if r>=1 and r<400:
            ratebar[0]=1
        elif r>=400 and r<800:
            ratebar[1]=1
        elif r>=800 and r<1200:
            ratebar[2]=1
        elif r>=1200 and r<1600:
            ratebar[3]=1
        elif r>=1600 and r<2000:
            ratebar[4]=1
        elif r>=2000 and r<2400:
            ratebar[5]=1
        elif r>=2400 and r<2800:
            ratebar[6]=1
        else:
            ratebar[7]=1
        
    l = len([i for i in ratebar if i==1])
    
    return l
    

N = int(input())
A = [int(i) for i in input().split(" ")]
_3200 = [i for i in A if i<3200]
Upper3200 = len([i for i in A if i>=3200])

n = ratecolor(_3200)

print("{} {}".format(n,n+Upper3200))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,2801,400):
  for j in range(N):
    if i<=a[j]<=399+i:
      count+=1
      break
c=0
for i in range(N):
  if 3200<=a[i]:
    c+=1

if count!=0:
  if c>=2:
    if count<7:
      print(count,count+2)
    else:
      print(count,8)
  elif c==1:
    if count<8:
      print(count,count+1)
    else:
      print(count,8)
  else:
    print(count,count)
else:
  if c<8:
    print(1,c)
  else:
    print(1,8)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,2801,400):
  for j in range(N):
    if i<=a[j]<=399+i:
      count+=1
      break
c=0
for i in range(N):
  if 3200<=a[i]:
    c+=1

if c>=2:
  if count<7:
    print(count,count+2)
  else:
    print(count,8)
elif c==1:
  if count<8:
    print(count,count+1)
  else:
    print(count,8)
else:
  print(count,count)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,2801,400):
  for j in range(N):
    if i<=a[j]<=399+i:
      count+=1
      break
c=0
for i in range(N):
  if 3200<=a[i]:
    c+=1

if c>=2:
  if count<6:
    print(count,count+2)
  else:
    print(count,7)
elif c==1:
  if count<7:
    print(count,count+1)
  else:
    print(count,7)
else:
  print(count,count)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,2801,400):
  for j in range(N):
    if i<=a[j]<=399+i:
      count+=1
      break
c=0
for i in range(N):
  if 3200<=a[i]:
    c+=1

if c>=2:
  print(count,count+2)
elif c==1:
  print(count,count+1)
else:
  print(count,count)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

d = defaultdict(int)


def rating(num):
    if num < 400:
        d[1] = 1
    elif num < 800:
        d[2] = 1
    elif num < 1200:
        d[3] = 1
    elif num < 1600:
        d[4] = 1
    elif num < 2000:
        d[5] = 1
    elif num < 2400:
        d[6] = 1
    elif num < 2800:
        d[7] = 1
    elif num < 3200:
        d[8] = 1
    else:
        d[0] += 1


for a in aa:
    rating(a)

free = d[0]
cnt = len(d)-1


if free == 0:
    print(cnt, cnt)
elif cnt == 0:
    print(1, min(8, free))
    exit()
else:
    print(cnt, min(8, cnt+free))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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


d = defaultdict(int)


def rating(num):
    if num <= 399:
        d[1] = 1
    elif 400 <= num <= 799:
        d[2] = 1
    elif 400 <= num <= 799:
        d[3] = 1
    elif 800 <= num <= 1199:
        d[4] = 1
    elif 1200 <= num <= 1599:
        d[5] = 1
    elif 1600 <= num <= 1999:
        d[6] = 1
    elif 2000 <= num <= 2399:
        d[7] = 1
    elif 2400 <= num <= 2799:
        d[8] = 1
    elif 2800 <= num <= 3199:
        d[9] = 1
    else:
        d[0] += 1


for a in aa:
    rating(a)

free = d[0]
cnt = len(d)-1


if free <= 0:
    print(cnt, cnt)
elif cnt == 0 and free > 0:
    print(1, min(8, free))
    exit()
else:
    print(cnt, min(8, cnt+free))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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


d = defaultdict(int)


def rating(num):
    if num <= 399:
        d[1] = 1
    elif 400 <= num <= 799:
        d[2] = 1
    elif 400 <= num <= 799:
        d[3] = 1
    elif 800 <= num <= 1199:
        d[4] = 1
    elif 1200 <= num <= 1599:
        d[5] = 1
    elif 1600 <= num <= 1999:
        d[6] = 1
    elif 2000 <= num <= 2399:
        d[7] = 1
    elif 2400 <= num <= 2799:
        d[8] = 1
    elif 2800 <= num <= 3199:
        d[9] = 1
    else:
        d[0] += 1


for a in aa:
    rating(a)

free = d[0]
cnt = len(d)-1


if free <= 0:
    print(cnt, cnt)
elif cnt == 0:
    print(1, cnt)
    exit()
else:
    print(cnt, min(8, cnt+free))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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


d = defaultdict(int)


def rating(num):
    if num <= 399:
        d[1] = 1
    elif 400 <= num <= 799:
        d[2] = 1
    elif 400 <= num <= 799:
        d[3] = 1
    elif 800 <= num <= 1199:
        d[4] = 1
    elif 1200 <= num <= 1599:
        d[5] = 1
    elif 1600 <= num <= 1999:
        d[6] = 1
    elif 2000 <= num <= 2399:
        d[7] = 1
    elif 2400 <= num <= 2799:
        d[8] = 1
    elif 2800 <= num <= 3199:
        d[9] = 1
    else:
        d[0] += 1


for a in aa:
    rating(a)

free = d[0]
cnt = len(d)-1


if free <= 0:
    print(cnt, cnt)
else:
    print(cnt, min(8, cnt+free))

Submission status: Wrong Answer

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

color = set()
flg = 0
for ai in a:
    if ai // 400 < 8:
        color.add(ai // 400)
    else:
        flg += 1
        
print(len(color), len(color) + flg)

Submission status: Wrong Answer

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

color = set()
flg = 0
for ai in a:
    if ai // 400 < 8:
        color.add(ai // 400)
    else:
        flg += 1
        
if flg:
    print(len(color), len(color) + flg)
else:
    print(len(color), len(color))

Submission status: Wrong Answer

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

color = set()
flg = 0
for ai in a:
    if ai // 400 < 8:
        color.add(ai // 400)
    else:
        flg += 1
        
if flg:
    print(len(color), min(8, len(color) + flg))
else:
    print(len(color), len(color))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = [i//400 for i in a]
l = set(l)
cnt = 0
for j in a:
    if j >= 3200:
        cnt += 1
if cnt >= 1:
    cnt -= 1
print(len(l)-cnt, len(l)+cnt)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left
import numpy as np

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

border = np.arange(399, 3200, 400)
cnt = [0] * (len(border) + 1)
for i in a:
    cnt[bisect_left(border, i)] += 1

k = np.count_nonzero(cnt[:-1])
print(k, k + cnt[-1])

Submission status: Wrong Answer

Solution code:
#import collections
n = int(input())
a = list(map(int, input().split()))
#a.sort()

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


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


ans_max = ans

if ans+count[8] <= 8:
    ans_max = ans+count[8]
elif ans==0 and count[8]>0:
    ans_max = 8
elif ans+count[8] > 8:
    ans_max = 8

if count[8]==1 and ans==0:
    ans_max = 8
if ans==0:
    ans = 1

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

Submission status: Wrong Answer

Solution code:

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

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


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


ans_max = 0
if ans+count[8] <= 8:
    ans_max = ans+count[8]
else:
    ans_max = 8

if ans==0:
    ans = 1

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

Submission status: Wrong Answer

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

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