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().strip().split()))

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

min_num = 0
max_num = 0

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

for i in [gray, brown, green, lblue, blue, yellow, orange, red]:
    if i != 0:
        min_num += 1

max_num = min_num
if min_num <= 6 and god != 0:
    if god >= 2:
        max_num += 2
    else:
        max_num += god

print(min_num, max_num)

Submission status: Wrong Answer

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

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

min_num = 0
max_num = 0

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

for i in [gray, brown, green, lblue, blue, yellow, orange, red]:
    if i != 0:
        min_num += 1

max_num = min_num
if min_num <= 6 and god != 0:
    max_num += god

print(min_num, max_num)

Submission status: Wrong Answer

Solution code:
def main():
    participants = int(input())
    ratings = list(map(int, input().split()))
    color = [0] * 9
    for rating in ratings:
        color[min(rating // 400, 8)] += 1
    answer = 0
    for i in range(8):
        if color[i] > 0:
            answer += 1
    print(answer, answer + color[-1])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    participants = int(input())
    ratings = list(map(int, input().split()))
    color = [0] * 9
    for rating in ratings:
        color[min(rating // 400, 8)] += 1
    answer = 0
    for i in range(8):
        if color[i] > 0:
            answer += 1
    print(answer, min(8, answer + color[-1]))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate = [0] * 8
x = 0
for i in a:
    if 1 <= i <= 399:
        rate[0] += 1
    elif 400 <= i <= 799:
        rate[1] += 1
    elif 800 <= i <= 1199:
        rate[2] += 1
    elif 1200 <= i <= 1599:
        rate[3] += 1
    elif 1600 <= i <= 1999:
        rate[4] += 1
    elif 2000 <= i <= 2399:
        rate[5] += 1
    elif 2400 <= i <= 2799:
        rate[6] += 1
    elif 2800 <= i <= 3199:
        rate[7] += 1
    else:
        x += 1
ans = 8 - rate.count(0)
print(ans, ans+x)

Submission status: Wrong Answer

Solution code:
from collections import Counter
input()
rates = Counter(map(lambda a: int(a) // 400, input().split()))
over3199 = rates[8]
colors = len(rates) - bool(over3199)
print(max(1, colors), colors + over3199)

Submission status: Wrong Answer

Solution code:
from collections import Counter
input()
colors = Counter(map(lambda a: int(a) // 400, input().split()))
over3200 = colors[8]
minimum = len(colors) - bool(over3200)
print(minimum, minimum + over3200)

Submission status: Wrong Answer

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
se = set()
cnt = 0
for i in a:
    if i < 400:
        se.add('1')
    elif i < 800:
        se.add('2')
    elif i < 1200:
        se.add('3')
    elif i < 1600:
        se.add('4')
    elif i < 2000:
        se.add('5')
    elif i < 2400:
        se.add('6')
    elif i < 2800:
        se.add('7')
    elif i < 3200:
        se.add('8')
    else:
        cnt += 1
mi = 0
ma = min(8, len(se) + cnt)
if len(se) == 0:
    mi = 1
else:
    mi = len(se)

print(mi, ma)

Submission status: Wrong Answer

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
se = set()
cnt = 0
for i in a:
    if i < 400:
        se.add('1')
    elif i < 800:
        se.add('2')
    elif i < 1200:
        se.add('3')
    elif i < 1600:
        se.add('4')
    elif i < 2000:
        se.add('5')
    elif i < 2400:
        se.add('6')
    elif i < 2800:
        se.add('7')
    elif i < 3200:
        se.add('8')
    else:
        cnt += 1
if len(se) == 0 and cnt > 0:
    print(1, min(8, cnt))
else:
    print(len(se), min(8, len(se) + cnt))

Submission status: Wrong Answer

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
se = set()
cnt = 0
for i in a:
    if 1 <= i <= 399:
        se.add('1')
    elif 400 <= i <= 799:
        se.add('2')
    elif 800 <= i <= 1199:
        se.add('3')
    elif 1200 <= i <= 1599:
        se.add('4')
    elif 1600 <= i <= 1999:
        se.add('5')
    elif 2000 <= i <= 2399:
        se.add('6')
    elif 2400 <= i <= 2799:
        se.add('7')
    elif 2800 <= i <= 3199:
        se.add('8')
    else:
        cnt += 1
if len(se) == 0 and cnt > 0:
    print(1, min(8, len(se) + cnt))
else:
    print(len(se), min(8, len(se) + cnt))

Submission status: Wrong Answer

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
se = set()
cnt = 0
for i in a:
    if 1 <= i <= 399:
        se.add('1')
    elif 400 <= i <= 799:
        se.add('2')
    elif 800 <= i <= 1199:
        se.add('3')
    elif 1200 <= i <= 1599:
        se.add('4')
    elif 1600 <= i <= 1999:
        se.add('5')
    elif 2000 <= i <= 2399:
        se.add('6')
    elif 2400 <= i <= 2799:
        se.add('7')
    elif 2800 <= i <= 3199:
        se.add('8')
    else:
        cnt += 1
if len(se) == 0 and cnt >= 0:
    print(1, min(8, len(se) + cnt))
else:
    print(len(se), min(8, len(se) + cnt))

Submission status: Wrong Answer

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
se = set()
cnt = 0
for i in a:
    if 1 <= i <= 399:
        se.add('1')
    elif 400 <= i <= 799:
        se.add('2')
    elif 800 <= i <= 1199:
        se.add('3')
    elif 1200 <= i <= 1599:
        se.add('4')
    elif 1600 <= i <= 1999:
        se.add('5')
    elif 2000 <= i <= 2399:
        se.add('6')
    elif 2400 <= i <= 2799:
        se.add('7')
    elif 2800 <= i <= 3199:
        se.add('8')
    else:
        cnt += 1
print(len(se), min(8, len(se) + cnt))

Submission status: Wrong Answer

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
se = set()
cnt = 0
for i in a:
    if 1 <= i <= 399:
        se.add('1')
    elif 400 <= i <= 799:
        se.add('2')
    elif 800 <= i <= 1199:
        se.add('3')
    elif 1200 <= i <= 1599:
        se.add('4')
    elif 1600 <= i <= 1999:
        se.add('5')
    elif 2000 <= i <= 2399:
        se.add('6')
    elif 2400 <= i <= 2799:
        se.add('7')
    elif 2800 <= i <= 3199:
        se.add('8')
    else:
        cnt += 1
print(len(se), min(7, len(se) + cnt))

Submission status: Wrong Answer

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
se = set()
cnt = 0
for i in a:
    if 1 <= i <= 399:
        se.add('1')
    elif 400 <= i <= 799:
        se.add('2')
    elif 800 <= i <= 1199:
        se.add('3')
    elif 1200 <= i <= 1599:
        se.add('4')
    elif 1600 <= i <= 1999:
        se.add('5')
    elif 2000 <= i <= 2399:
        se.add('6')
    elif 2400 <= i <= 2799:
        se.add('7')
    elif 2800 <= i <= 3199:
        se.add('8')
    else:
        cnt += 1
print(len(se), len(se)+cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
color = [0] * 8
select = 0
for i in range(N):
    for j in range(8):
        if 400 * j <= A[i] < 400 * (j + 1):
            color[j] += 1
            break
        elif 400 * (j + 1) == 3200:
            select += 1
            break
ans = 0

for k in range(8):
    if color[k] != 0:
        ans += 1
print(ans, ans + select)

Submission status: Wrong Answer

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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]//400:
        count+=1
    else:
        ans[a[i]//400]=1
#print(ans)
if sum(ans)==0:
    print(1,min(8,count))
else:
    print(sum(ans),min(8,sum(ans)+count))

Submission status: Wrong Answer

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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]//400:
        count+=1
    else:
        ans[a[i]//400]=1
print(ans)
if sum(ans)==0:
    print(1,min(8,count))
else:
    print(sum(ans),min(8,sum(ans)+count))

Submission status: Wrong Answer

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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]/400:
        count+=1
    else:
        ans[a[i]//400]=1
if sum(ans)==0:
    print(1,min(8,count))
else:
    print(sum(ans),min(8,sum(ans)+count))

Submission status: Wrong Answer

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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]/400:
        count+=1
    else:
        ans[a[i]//400]=1
if sum(ans)==0:
    print(1,count)
else:
    print(sum(ans),min(8,sum(ans)+count))

Submission status: Wrong Answer

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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]/400:
        count+=1
    else:
        ans[a[i]//400]=1

print(min(max(1,sum(ans)),sum(ans)+count),min(8,sum(ans)+count))

Submission status: Wrong Answer

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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]/400:
        count+=1
    else:
        ans[a[i]//400]=1

print(sum(ans),min(8,sum(ans)+count))

Submission status: Wrong Answer

Solution code:
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(4100000)

n = int(input())
a = list(map(int, input().split()))
c = [0] * 8
cnt = 0
for i in a:
    if i < 3200:
        c[i // 400] = 1
    else:
       cnt += 1
# print(c)
min_ans = sum(c)
max_ans = min_ans + cnt
# print(c, cnt)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(4100000)

n = int(input())
a = list(map(int, input().split()))
c = [0] * 8
cnt = 0
for i in a:
    if i < 3200:
        c[i // 400] = 1
    else:
       cnt += 1
# print(c)
min_ans = sum(c)
max_ans = min(8, min_ans + cnt)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
lis=[0]*9
for i in range(n):
  if 1<=a[i]<=399: lis[0]+=1
  elif a[i]<=799: lis[1]+=1
  elif a[i]<=1199: lis[2]+=1
  elif a[i]<=1599: lis[3]+=1
  elif a[i]<=1999: lis[4]+=1
  elif a[i]<=2399: lis[5]+=1
  elif a[i]<=2799: lis[6]+=1
  elif a[i]<=3199: lis[7]+=1
  else: lis[8]+=1

min_color = 0
for i in range(len(lis)-1):
    if lis[i]>0: min_color+=1
max_color = min_color + lis[-1]
print(min_color, max_color)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
c=[0]*8
sum=0
tmp=0

for i in a:
    n=int(i/400)
    if(i<3200 and c[n]==0):
        c[n]+=1
        sum+=1
    elif(i>=3200):
        tmp+=1
print(sum,sum+tmp)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
ans_min=min(1,sum(check))
ans_max=ans_min+n-i
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
ans_min=sum(check)
ans_max=ans_min+n-i
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
ans_min=sum(check)
ans_max=min(8,ans_min+n-i)
print(ans_min,ans_max)

Submission status: Wrong Answer

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

lst2 = [0]*8

for i in range(n):
    for j in range(8):
        if lst1[i] < 400*(j+1):
            lst2[j] += 1
            break
    if lst1[i] >= 3200:
        lst2[7] += 1

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

print(max(1,ans))
print(ans+lst2[7])

Submission status: Wrong Answer

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

lst2 = [0]*8

for i in range(n):
    for j in range(8):
        if lst1[i] < 400*(j+1):
            lst2[j] += 1
            break
    if lst1[i] >= 3200:
        lst2[7] += 1

ans = 0
for i in range(7):
    if lst2[i]:
        ans += 1

print(max(1,ans))
print(ans+lst2[7])

Submission status: Wrong Answer

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

lst2 = [0]*8

for i in range(n):
    for j in range(8):
        if lst1[i] < 400*(j+1):
            lst2[j] += 1
            break
    if lst1[i] >= 3200:
        lst2[7] += 1

ans = 0
for i in range(7):
    if lst2[i]:
        ans += 1

print(min(1,ans))
print(ans+lst2[7])

Submission status: Wrong Answer

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

lst2 = [0]*8

for i in range(n):
    for j in range(8):
        if lst1[i] < 400*(j+1):
            lst2[j] += 1
            break
    if lst1[i] >= 3200:
        lst2[7] += 1

ans = 0
for i in range(7):
    if lst2[i]:
        ans += 1

print(ans if not lst2[7] else ans +1)
print(ans+lst2[7])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
lis = [0]*8
fr = 0
for i in a:
    col = i // 400
    if col > 7:
        fr += 1
    else:
        lis[col] = 1
mi = lis.count(1)
mx = lis.count(1) + fr

print(mi,mx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A.sort()
dic = {1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0}
count = 0
for a in A:
  if a < 400:
    dic[1] += 1
  elif 400 <= a < 800:
    dic[2] += 1
  elif 800 <= a < 1200:
    dic[3] += 1
  elif 1200 <= a < 1600:
    dic[4] += 1
  elif 1600 <= a < 2000:
    dic[5] += 1
  elif 2000 <= a < 2400:
    dic[6] += 1
  elif 2400 <= a < 2800:
    dic[7] += 1
  elif 2800 <= a < 3200:
    dic[8] += 1
  else:
    count += 1
total = 0
for i in range(1, 9):
  if dic[i] != 0:
    total += 1
m = total + count
print(max(total, count), m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l=[0]*9

for i in range(n):
  if a[i]<399:
    l[0]="t"
  elif a[i]<799:
    l[1]="t"
  elif a[i]<1199:
    l[2]="t"
  elif a[i]<1599:
    l[3]="t"
  elif a[i]<1999:
    l[4]="t"
  elif a[i]<2399:
    l[5]="t"
  elif a[i]<2799:
    l[6]="t"
  elif a[i]<3199:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if l[8]==0:
  print(countt,countt)
else:
  print(countt,countt+l[8])

Submission status: Wrong Answer

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

l=[0]*9

for i in range(n):
  if a[i]<399:
    l[0]="t"
  elif a[i]<799:
    l[1]="t"
  elif a[i]<1199:
    l[2]="t"
  elif a[i]<1599:
    l[3]="t"
  elif a[i]<1999:
    l[4]="t"
  elif a[i]<2399:
    l[5]="t"
  elif a[i]<2799:
    l[6]="t"
  elif a[i]<3199:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if l[8]==0:
  print(countt,countt)
else:
  print(countt,min(countt+l[8],8))

Submission status: Wrong Answer

Solution code:
n = int(input())
al = list(map(int, input().split()))
count = [0] * 8
overred = 0

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

color = 8 - count.count(0)

if color != 0:
    color_min = color
    color_max = color_min + min(8 - color_min, overred)
else:
    color_min = 1
    color_max = min(8, overred)

print(color_min, color_max)

Submission status: Wrong Answer

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

for i in l:
  x = i//400
  if x >= 8:
    ans[8] += 1
  else:
    ans[x] += 1
count = 0
for i in range(8):
  if ans[i] > 0:
    count += 1
if ans[8]==0:
  print(count,count)
else:
  print(count,count+ans[8])

Submission status: Wrong Answer

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

for i in l:
  x = i//400
  if x >= 8:
    ans[8] += 1
  else:
    ans[x] += 1
count = 0
for i in range(8):
  if ans[i] > 0:
    count += 1
if ans[8]==0:
  print(count,count)
else:
  print(count+1,count+ans[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
rates = list(input().split())

for i in range(len(rates)):
    rates[i] = int(rates[i]) // 400

MAX = 0
MIN = 0
j = 0
while j <= 8:
    for k in range(N):
        if j != 8 and j == rates[k]:
            MAX += 1
            MIN += 1
            break
        elif j == 8 and j <= rates[k]:
            MAX += 1
            continue
    j += 1

if N == 1:
    print(1, 1)
else:
    print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
N = int(input())
rates = list(input().split())

for i in range(len(rates)):
    rates[i] = int(rates[i]) // 400

MAX = 0
MIN = 0
j = 0
while j <= 8:
    for k in range(N):
        if j != 8 and j == rates[k]:
            MAX += 1
            MIN += 1
            break
        elif j == 8 and j <= rates[k]:
            MAX += 1
            continue
    j += 1

print(MIN, MAX)

Submission status: Wrong Answer

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

li = [0] * 9

for i in a:
    if i >= 3200:
        li[-1] += 1
    else:
        li[i//400] += 1

ans = 0

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

if li[-1] == 0:
    print(ans, ans)
else:
    print(ans, ans+li[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = {}
e = 0
for ai in a:
  s = ai // 400
  if s > 7:
    e += 1
  else:
    if s in d:
      d[s] += 1
    else:
      d[s] = 1
print(max(1, len(d)), min(8, len(d) + e))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = {}
e = 0
for ai in a:
  s = ai // 400
  if s > 7:
    e += 1
  else:
    if s in d:
      d[s] += 1
    else:
      d[s] = 1
print(len(d), min(8, len(d) + e))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = {}
e = 0
for ai in a:
  s = ai // 400
  if s > 7:
    e += 1
  else:
    if s in d:
      d[s] += 1
    else:
      d[s] = 1
print(min(8, len(d) + e))

Submission status: Wrong Answer

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

min_c=color
if min_c==0:
	min_c+=1
for j in range(0,8-color,1):
	if count==0:
		break
	color+=1
	count-=1
		
print(min_c,color)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr= limii()

bs = [0,399,799,1199,1599,1999,2399,2799,3199,4801]
bc = [0,1,2,3,4,5,6,7,8]
ans = [0,0,0,0,0,0,0,0,0]

for i in range(n):
    score = arr[i]
    chk=True
    ank=0
    while chk:
        if bs[ank]<score<=bs[ank+1]:
            chk=False
        ank+=1
    ans[ank-1]+=1

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

print(str(sum(ans[:-1]))+" "+str(sum(ans)))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr= limii()

bs = [0,399,799,1199,1599,1999,2399,2799,3199,4801]
bc = [0,1,2,3,4,5,6,7,8]
ans = [0,0,0,0,0,0,0,0,0]

for i in range(n):
    score = arr[i]
    chk=True
    ank=0
    while chk:
        if bs[ank]<score<=bs[ank+1]:
            chk=False
        ank+=1
    ans[ank-1]+=1

for i in range(7):
    if ans[i]>0:
        ans[i]=1

print(str(sum(ans[:-1]))+" "+str(sum(ans)))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr= limii()

bs = [0,399,799,1199,1599,1999,2399,2799,3199,4801]
bc = [0,1,2,3,4,5,6,7,8]
ans = [0,0,0,0,0,0,0,0,0]

for i in range(n):
    score = arr[i]
    chk=True
    ank=0
    while chk:
        if bs[ank]<score<=bs[ank+1]:
            chk=False
        ank+=1
    ans[ank-1]+=1

for i in range(7):
    if ans[i]>0:
        ans[i]=1

print(str(sum(ans[:-2]))+" "+str(sum(ans)))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
x = dict()
y = []
for i in range(N):
    if a[i]<=399:
        x["gray"] = 1
    elif a[i]<=799:
        x["brown"] = 1
    elif a[i]<=1199:
        x["green"] = 1
    elif a[i] <=1599:
        x["lightblue"] = 1
    elif a[i] <= 1999:
        x["blue"] = 1
    elif a[i]<=2399:
        x["yellow"] = 1
    elif a[i]<=2799:
        x["orange"] = 1
    elif a[i]<=3199:
        x["red"] = 1
    else:
        y.append(a[i])

ans = 0
for idx in x:
    ans += 1
n = len(y)
m = ans
M = ans + n
s = ""
s = str(m)+" "+str(M)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
free=0
cset=set()
for rate in a:
    color = int(rate / 400)
    if color >=8:
        free+=1
    else:
        cset.add(color)

colormin=len(cset)
colormax=colormin+free

if colormax>8:
    colormax=8

if colormin==0:
    print(1, colormax)
else:
    print(colormin,colormax)

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]):
                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 <= len(leftnumeral) 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()