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())
l=list(map(int,input().split()))

ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
ans1 = 8-ans.count(0)
ans2 = ans1+rate_3200
if ans1 == 0 and rate_3200 != 0:
    ans1 = 1
 
 
print(ans1, ans2)

Submission status: Wrong Answer

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

ans=[0]*8
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
mi=0
for i in ans:
  if i!=0:
    mi+=1
if mi==0:
  print(1, rate_3200)
else:
  ma=mi+rate_3200
  print(mi, ma)

Submission status: Wrong Answer

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

ans=[0]*8
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
mi=0
for i in ans:
  if i!=0:
    mi+=1
if mi==0:
  print("{} {}".format(1,rate_3200))
else:
  ma=mi+rate_3200
  print("{} {}".format(mi,ma))

Submission status: Wrong Answer

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

ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
mi=0
for i in ans:
  if i!=0:
    mi+=1
if mi==0:
  mi=1
  ma=rate_3200
else:
  ma=mi+rate_3200
  
print("{} {}".format(mi,ma))

Submission status: Wrong Answer

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

ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
if rate_3200==0:
  num=8-ans.count(0)
  print("{} {}".format(num,num))
else:
  count_0=ans.count(0)
  if count_0==8:
    min_num=1
    max_num=rate_3200
  else:
    min_num=8-count_0
    max_num=8-count_0+rate_3200
  print("{} {}".format(min_num,max_num))

Submission status: Wrong Answer

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

ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
if rate_3200==0:
  num=8-ans.count(0)
  print("{} {}".format(num,num))
else:
  min_num=8-ans.count(0)
  max_num=8-ans.count(0)+rate_3200
  print("{} {}".format(min_num,max_num))

Submission status: Wrong Answer

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

ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
if rate_3200==0:
  num=8-ans.count(0)
  print("{} {}".format(num,num))
else:
  min_num=8-ans.count(0)
  max_num=8-ans.count(0)+rate_3200
  print("{} {}".format(max_num,min_num))

Submission status: Wrong Answer

Solution code:
#n=int(input())
#l=list(map(int,input().split()))
n=5
l=[1100, 1900, 2800, 3200, 3200]
ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
if rate_3200==0:
  num=8-ans.count(0)
  print("{} {}".format(num,num))
else:
  min_num=8-ans.count(0)
  max_num=8-ans.count(0)+rate_3200
  print("{} {}".format(max_num,min_num))

Submission status: Wrong Answer

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

ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
if rate_3200==0:
  num=8-ans.count(0)
  print("{} {}".format(num,num))
else:
  min_num=8-ans.count(0)
  max_num=8-ans.count(0)+rate_3200
  if max_num > 9:
    max_num=8
  print("{} {}".format(min_num,max_num))

Submission status: Wrong Answer

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

if min+data[8]>=8:
  print(min, data[8])
else:
  print(min, min+data[8])

Submission status: Wrong Answer

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

if min+data[8]>=8:
  print(min, 8)
else:
  print(min, min+data[8])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
data=[0]*9
for i in a:
  if 1<=i<=399:
    data[0]+=1
  elif 400<=i<=799:
    data[1]+=1
  elif 800<=i<=1199:
    data[2]+=1
  elif 1200<=i<=1599:
    data[3]+=1
  elif 1600<=i<=1999:
    data[4]+=1
  elif 2000<=i<=2399:
    data[5]+=1
  elif 2400<=i<=2799:
    data[6]+=1
  elif 2800<=i<=3199:
    data[7]+=1
  elif 3200<=i:
    data[8]+=1
min=0
max=0
for i in range(8):
  if data[i]!=0:
    min+=1
    max+=1
if max+data[8]>=8:
  print(min, 8)
else:
  print(min, max+data[8])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
#n, k = map(int, input().split())
al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]


def color(rate):
    c = rate//400
    return min(8, c)


dic = {i: 0 for i in range(9)}

for a in al:
    dic[color(a)] = dic[color(a)]+1

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

mn = count
mx = count
if dic[8] != 0:
    if count>=1:
        left = 9-count
        mx = mn+min(left, dic[8])
    else:
        mn=1
        mx=min(9,dic[8])
    
print(mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
#n, k = map(int, input().split())
al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]


def color(rate):
    c = rate//400
    return min(8, c)


dic = {i: 0 for i in range(9)}

for a in al:
    dic[color(a)] = dic[color(a)]+1

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

mn = count
mx = count
if dic[8] != 0:
    if count>=1:
        left = 8-count
        mx = mn+min(left, dic[8])
    else:
        mn=1
        mx=dic[8]
    

print(mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
#n, k = map(int, input().split())
al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]


def color(rate):
    c = rate//400
    return min(8, c)


dic = {i: 0 for i in range(9)}

for a in al:
    dic[color(a)] = dic[color(a)]+1

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

mn = count
mx = count
if dic[8] != 0:
    left = 8-count
    mx = mn+min(left, dic[8])

print(mn, mx)

Submission status: Wrong Answer

Solution code:
N=int(input())
List = list(map(int, input().split()))
sumList = [0]*8
mid = 0
for i in range(N):
  if 1<=List[i]<=399:
    sumList[0] += 1
  elif 400<= List[i] <=799:
    sumList[1] += 1
  elif 800 <= List[i] <= 1199:
    sumList[2] += 1
  elif 1200<= List[i] <=1599:
    sumList[3] += 1
  elif 1600<= List[i] <=1999:
    sumList[4] += 1
  elif 2000 <= List[i] <= 2399:
    sumList[5] += 1
  elif 2400 <= List[i] <= 2799:
    sumList[6] += 1
  elif 2800 <= List[i] <= 3199:
    sumList[7] += 1
  elif 3200 <= List[i]:
    mid += 1
res1 = 8 - sumList.count(0)
res2 = res1 + mid
if res1 == 0 and mid > 0:
  res1 = 1
if res2 > 8:
  res2 = 8
print(res1,res2)

Submission status: Wrong Answer

Solution code:
N=int(input())
List = list(map(int, input().split()))
sumList = [0]*8
mid = 0
for i in range(N):
  if 1<=List[i]<=399:
    sumList[0] += 1
  elif 400<= List[i] <=799:
    sumList[1] += 1
  elif 800 <= List[i] <= 1199:
    sumList[2] += 1
  elif 1200<= List[i] <=1599:
    sumList[3] += 1
  elif 1600<= List[i] <=1999:
    sumList[4] += 1
  elif 2000 <= List[i] <= 2399:
    sumList[5] += 1
  elif 2400 <= List[i] <= 2799:
    sumList[6] += 1
  elif 2800 <= List[i] <= 3199:
    sumList[7] += 1
  elif 3200 <= List[i]:
    mid += 1
res1 = 8 - sumList.count(0)
res2 = res1 +mid
if res1 == 0 and mid >0:
  res1 = 1
if res2 >8:
  res2 = 8
print(res1,res2)

Submission status: Wrong Answer

Solution code:
N=int(input())
List = list(map(int, input().split()))
sumList = [0]*8
mid = 0
for i in range(N):
  if 1<=List[i]<=399:
    sumList[0] += 1
  elif 400<= List[i] <=799:
    sumList[1] += 1
  elif 800 <= List[i] <= 1199:
    sumList[2] += 1
  elif 1200<= List[i] <=1599:
    sumList[3] += 1
  elif 1600<= List[i] <=1999:
    sumList[4] += 1
  elif 2000 <= List[i] <= 2399:
    sumList[5] += 1
  elif 2400 <= List[i] <= 2799:
    sumList[6] += 1
  elif 2800 <= List[i] <= 3199:
    sumList[7] += 1
  elif 3200 <= List[i]:
    mid += 1
res1 = 8 - sumList.count(0)
if res1 == 0 and mid >0:
  res1 = 1
res2 = res1 +mid
if res2 >8:
  res2 = 8
print(res1,res2)

Submission status: Wrong Answer

Solution code:
N = int(input())
As = list(map(int,input().split()))
mi=0
ma=0
r = []
for i in range(N):
 rate = As[i]//400
 if rate < 8:
     if not rate in r:
         r.append(rate)
         mi += 1
         ma += 1
 else:
     ma+=1
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

    l = [0] * 9
    for i in range(N):
        n = a[i] // 400
        if n > 8:
            n = 8
        l[n] += 1

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

    if ans_min == 0:
        ans_min = 1

    gold = l[8]

    ans_max = ans_min
    ans_max += gold

    print(ans_min, ans_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

    l = [0] * 9
    for i in range(N):
        n = a[i] // 400
        if n > 8:
            n = 8
        l[n] += 1

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

    gold = l[8]
    if gold > 8:
        gold = 8

    if ans_min == 0:
        ans_min = 1

    ans_max = ans_min
    non_color = l.count(0)
    if gold >= non_color:
        ans_max = 8
    else:
        ans_max += gold

    print(ans_min, ans_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

rate = [0] * 8
s = 0

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



    
ans1 = 8-rate.count(0)
ans2 = ans1+s

print(ans1, ans2)

Submission status: Wrong Answer

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

rate = [0] * 8
s = 0

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



    
ans1 = 8-rate.count(0)
ans2 = ans1+s

print(ans1, ans2)

Submission status: Wrong Answer

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

rate = [0] * 8
s = 0

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

    
ans1 = 8-rate.count(0)
ans2 = min(ans1+s, 8)

print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int,input().split()))
ratecolor = 0
free = 0
ratecolor = 0
color = [0]*9
for i in range(n):
    if(rate[i] >= 3200):
        free += 1
    else:
        for j in range(9):
            if(rate[i] < j*400 + 400):
                if(color[j] == 0):
                    color[j] += 1
                    ratecolor += 1
                    break
# print(rate,ratecolor,free)
print(ratecolor if ratecolor != 0 else 1,ratecolor+free)

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int,input().split()))
ratecolor = 0
free = 0
ratecolor = 0
color = [0]*9
for i in range(n):
    if(rate[i] >= 3200):
        free += 1
        break
    for j in range(9):
        if(rate[i] < j*400 + 400):
            if(color[j] == 0):
                color[j] += 1
                ratecolor += 1
                break

print(ratecolor if ratecolor != 0 else 1,ratecolor+free)

Submission status: Wrong Answer

Solution code:
# import random
# def randomnum(n):
#     num = []
#     for i in range(n):
#         num.append(random.randint(1,4800))
#     return num
n = int(input())
rate = list(map(int,input().split()))
# n = random.randint(1,15)
# rate = randomnum(n)
color = [0]*9
ratecolor = 0
for i in range(n):
    for j in range(9):
        if(rate[i] < j*400 + 400):
            if(color[j] == 0 and rate[i] < 3200):
                ratecolor += 1
            color[j] += 1
            break
# print(color,n)
print(ratecolor,ratecolor+color[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int,input().split()))
color = [0]*9
ratecolor = 0
free = 0
for i in range(n):
    for j in range(9):
        if(rate[i] <= j*400 + 399):
            if(color[j] == 0 and rate[i] < 3200):
                ratecolor += 1
            color[j] += 1
            break
# print(color)
print(ratecolor,min(ratecolor+color[-1],8))

Submission status: Wrong Answer

Solution code:
def index(rate):
    if rate <= 3199:
        idx = rate // 400
    else:
        idx = 'free'
    return idx


def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    color_lst = [0] * 8

    free = 0
    for i in range(n):
        rate = a_lst[i]
        idx = index(rate)
        if idx == 'free':
            free += 1
        else:
            color_lst[idx] = 1

    types = 0
    for i in range(8):
        if color_lst[i] == 1:
            types += 1

    if types > 0:
        minimum = types
    else:
        minimum = 1

    maximum = types
    max_add = free
    maximum += max_add
    maximum = min(maximum, 8)

    ans = '{} {}'.format(minimum, maximum)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

p = set()
q = 0
for i in range(n):
  if a[i] < 2800:
    p.add(a[i]//400)
  else:
    q += 1

p = len(p)
print(p, p+q)

Submission status: Wrong Answer

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

p = set()
q = 0
for i in range(n):
  if a[i] < 3200:
    p.add(a[i]//400)
  else:
    q += 1

p = len(p)
print(p, p+q)

Submission status: Wrong Answer

Solution code:
def index(rate):
    if rate <= 3199:
        idx = rate // 400
    else:
        idx = 'free'
    return idx


def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    color_lst = [0] * 8

    free = 0
    for i in range(n):
        rate = a_lst[i]
        idx = index(rate)
        if idx == 'free':
            free += 1
        else:
            color_lst[idx] = 1

    types = 0
    for i in range(8):
        if color_lst[i] == 1:
            types += 1

    minimum = types
    min_add = max(0, free - types)
    minimum += min_add
    minimum = min(minimum, 8)
    maximum = min(types + free, 8)

    ans = '{} {}'.format(minimum, maximum)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def index(rate):
    if rate <= 3199:
        idx = rate // 400
    else:
        idx = 'free'
    return idx


def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    color_lst = [0] * 8

    free = 0
    for i in range(n):
        rate = a_lst[i]
        idx = index(rate)
        if idx == 'free':
            free += 1
        else:
            color_lst[idx] = 1

    types = 0
    for i in range(8):
        if color_lst[i] == 1:
            types += 1

    min_types = types + max(free - types, 0)
    min_types = min(min_types, 8)
    max_types = min(types + free, 8)

    answer = '{}'.format(min_types) + ' ' + '{}'.format(max_types)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def index(rate):
    if rate <= 3199:
        idx = rate // 400
    else:
        idx = 'free'
    return idx


def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    color_lst = [0] * 8

    free = 0
    for i in range(n):
        rate = a_lst[i]
        idx = index(rate)
        if idx == 'free':
            free += 1
        else:
            color_lst[idx] = 1

    types = 0
    for i in range(8):
        if color_lst[i] == 1:
            types += 1

    min_types = types + max(free - types, 0)
    max_types = min(types + free, 8)

    answer = '{}'.format(min_types) + ' ' + '{}'.format(max_types)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def index(rate):
    if 1 <= rate <= 399:
        idx = 0
    elif 400 <= rate <= 799:
        idx = 1
    elif 800 <= rate <= 1199:
        idx = 2
    elif 1200 <= rate <= 1599:
        idx = 3
    elif 1600 <= rate <= 1999:
        idx = 4
    elif 2000 <= rate <= 2399:
        idx = 5
    elif 2400 <= rate <= 2799:
        idx = 6
    elif 2800 <= rate <= 3199:
        idx = 7
    else:
        idx = 'free'
    return idx


def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    color_lst = [0] * 8

    free = 0
    for i in range(n):
        rate = a_lst[i]
        idx = index(rate)
        if idx == 'free':
            free += 1
        else:
            color_lst[idx] = 1

    types = 0
    for i in range(8):
        if color_lst[i] == 1:
            types += 1

    min_types = types
    max_types = min(types + free, 8)

    answer = '{}'.format(min_types) + ' ' + '{}'.format(max_types)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#
# abc064 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2100 2500 2700 2700"""
        output = """2 2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1100 1900 2800 3200 3200"""
        output = """3 5"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990"""
        output = """1 1"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

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

    print(f"{max(1, 8-C[:8].count(0))} {min(8, 8-C[:8].count(0)+C[8])}")


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
#
# abc064 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2100 2500 2700 2700"""
        output = """2 2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1100 1900 2800 3200 3200"""
        output = """3 5"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990"""
        output = """1 1"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    C = [0] * 9
    for a in A:
        for i in range(8):
            if 400*i <= a <= 400*i+399:
                C[i] += 1
                break
        else:
            C[8] += 1

    print(
        f"{max(1, 8-C[:8].count(0))} {min(8, max(1, 8-C[:8].count(0))+C[8])}")


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
#
# abc064 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2100 2500 2700 2700"""
        output = """2 2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1100 1900 2800 3200 3200"""
        output = """3 5"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990"""
        output = """1 1"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    C = [0] * 9
    for a in A:
        for i in range(8):
            if 400*i <= a <= 400*i+399:
                C[i] += 1
                break
        else:
            C[8] += 1

    print(f"{max(1, 8-C[:8].count(0))} {min(8, 8-C[:8].count(0)+C[8])}")


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
#
# abc064 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2100 2500 2700 2700"""
        output = """2 2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1100 1900 2800 3200 3200"""
        output = """3 5"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990"""
        output = """1 1"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    C = [0] * 9
    for a in A:
        for i in range(8):
            if 400*i <= a <= 400*i+399:
                C[i] += 1
                break
        else:
            C[8] += 1

    print(f"{8-C[:8].count(0)} {min(8, 8-C[:8].count(0)+C[8])}")


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
#
# abc064 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2100 2500 2700 2700"""
        output = """2 2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1100 1900 2800 3200 3200"""
        output = """3 5"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990"""
        output = """1 1"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    C = [0] * 9
    for a in A:
        for i in range(8):
            if 400*i <= a <= 400*i+399:
                C[i] += 1
                break
        else:
            C[8] += 1

    print(f"{8-C[:-1].count(0)} {min(8, 8-C[:-1].count(0)+C[-1])}")


if __name__ == "__main__":
    # unittest.main()
    resolve()