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:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  l2=[]
  c=0
  for x in l:
    if x>=3200:
      c+=1
    l2.append(x//400)

  l2=list(set(l2))

  if l2.count(8):
    l2.remove(8)

  print(len(l2),len(l2)+c)

main()

Submission status: Wrong Answer

Solution code:
import math

l = input().split()
N = int(l[0])

l = input().split()
A = [0] * 13
for a in l:
    index = int(a) // 400
    if index < 8:
        A[index] = 1
    else:
        A[index] += 1

# print(N, A)

num_colored = sum(A[:8])
num_free = sum(A[8:])

print(num_colored, num_colored + min(8 - num_colored, num_free))

Submission status: Wrong Answer

Solution code:
import math

l = input().split()
N = int(l[0])

l = input().split()
A = [int(a) for a in l]

# print(N, A)

colored = [0]*8
free = 0

for a in A:
    if a <= 399:
        colored[0] = 1
    elif a <= 799:
        colored[1] = 1
    elif a <= 1199:
        colored[2] = 1
    elif a <= 1599:
        colored[3] = 1
    elif a <= 1999:
        colored[4] = 1
    elif a <= 2399:
        colored[5] = 1
    elif a <= 2799:
        colored[6] = 1
    elif a <= 3199:
        colored[7] = 1
    else:
        free += 1

num_colored = sum(colored)
print(num_colored, num_colored + min(8 - num_colored, free))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = list(map(int, input().split()))
a_lst = [0 for i in range(9)]

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

mn = len([0 for i in a_lst[:-1] if i > 0])
mx = mn + a_lst[-1]
print(mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
ai = list(map(int,input().split()))
aj = list(map(lambda x:int(x/400),ai))
print(aj)
rainbow = 0
for e in aj:
  if e >= 8:
    rainbow += 1
ak= set(aj)
ans = 0
for e in ak:
  if e < 8:
    ans += 1
print(max(1,ans) ,end='')
print(' ' ,end = '')
print(ans+ rainbow)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
colormap=[0]*8
free=0
for A in a:
  if A>=3200:
    free+=1
  elif A>=2800:
    colormap[7]=1
  elif A>=2400:
    colormap[6]=1
  elif A>=2000:
    colormap[5]=1
  elif A>=1600:
    colormap[4]=1
  elif A>=1200:
    colormap[3]=1
  elif A>=800:
    colormap[2]=1
  elif A>=400:
    colormap[1]=1
  else:
    colormap[0]=1
c=0
for i in range(8):
  if colormap[i]==1:
    c+=1
mi=min(c,1)
ma=c+free
print(mi,ma)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
colormap=[0]*8
free=0
for A in a:
  if A>=3200:
    free+=1
  elif A>=2800:
    colormap[7]=1
  elif A>=2400:
    colormap[6]=1
  elif A>=2000:
    colormap[5]=1
  elif A>=1600:
    colormap[4]=1
  elif A>=1200:
    colormap[3]=1
  elif A>=800:
    colormap[2]=1
  elif A>=400:
    colormap[1]=1
  else:
    colormap[0]=1
c=0
for i in range(8):
  if colormap[i]==1:
    c+=1
mi=c
ma=c+free
print(mi,ma)

Submission status: Wrong Answer

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

cnt = [0] * 9

for i in range(N):
    if a[i] >= 3200:
        cnt[8] += 1
    else:
        cnt[ a[i] // 400 ] = 1

subMin = sum(cnt[:-1])
Min = max(sum(cnt[:-1]), 1)
Max = min(subMin + cnt[-1], 8)

print(Min, Max)

Submission status: Wrong Answer

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

cnt = [0] * 9

for i in range(N):
    if a[i] >= 3200:
        cnt[8] += 1
    else:
        cnt[ a[i] // 400 ] = 1

Min = max(sum(cnt[:-1]), 1)
Max = min(Min+cnt[-1], 8)

print(Min, Max)

Submission status: Wrong Answer

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

cnt = [0] * 9

for i in range(N):
    if a[i] >= 3200:
        cnt[8] += 1
    else:
        cnt[ a[i] // 400 ] = 1

Min = sum(cnt[:-1])
Max = min(Min+cnt[8], 8)

print(Min, Max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
check=[False]*8
count=0
for i in a:
    if i//400<8:
        check[i//400]=True
    else:
        count+=1
ans=0
for i in check:
    if i:
        ans+=1
print(max(1,ans),min(8,ans+count))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
check=[False]*8
count=0
for i in a:
    if i//400<8:
        check[i//400]=True
    else:
        count+=1
ans=0
for i in check:
    if i:
        ans+=1
print(ans,min(8,ans+count))

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    a = [0] + [int(ele) for ele in input().split()]
    a.sort()
    ans_min = 0
    ans_min += 1 if len(list(filter(lambda x: 1 <= x <= 399, a ))) > 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 400 <= x <= 799, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 800 <= x <= 1200, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 1200 <= x <= 1599, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 1600 <= x <= 1999, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2000 <= x <= 2399, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2400 <= x <= 2799, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2800 <= x <= 3199, a )))> 0 else 0
    over = list(filter(lambda x: 3200 <= x, a ))

    ans_max = ans_min + len(over)

    if ans_min == 0 and len(over) > 0:
        ans_min = len(over)

    print(ans_min, ans_max)


if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    a = [0] + [int(ele) for ele in input().split()]
    a.sort()
    ans_min = 0
    ans_min += 1 if len(list(filter(lambda x: 1 <= x <= 399, a ))) > 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 400 <= x <= 799, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 800 <= x <= 1200, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 1200 <= x <= 1599, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 1600 <= x <= 1999, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2000 <= x <= 2399, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2400 <= x <= 2799, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2800 <= x <= 3199, a )))> 0 else 0
    over = list(filter(lambda x: 3200 <= x, a ))

    ans_max =  ans_min + len(over)

    print(ans_min, ans_max)

    
    

if __name__=="__main__":
    main()

Submission status: Wrong Answer

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

dat_a = list(map(lambda x: x // 400, dat_a))
dat_a = list(map(lambda x: 8 if x > 8 else x, dat_a))
all_color = 0

for i in range(len(dat_a)):
    if dat_a[i] == 8:
        all_color += 1
for i in range(all_color):
    dat_a.remove(8)

dat_a = set(dat_a)

n_color = len(dat_a)

mincolor = 0
maxcolor = 0

mincolor = n_color
maxcolor = n_color + all_color
maxcolor = 8 if maxcolor > 8 else maxcolor

print("{0} {1}".format(mincolor, maxcolor))

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    a = [0] + [int(ele) for ele in input().split()]
    a.sort()
    ans_min = 0
    ans_min += 1 if len(list(filter(lambda x: 1 <= x <= 399, a ))) > 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 400 <= x <= 799, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 800 <= x <= 1200, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 1200 <= x <= 1599, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 1600 <= x <= 1999, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2000 <= x <= 2399, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2400 <= x <= 2799, a )))> 0 else 0
    ans_min += 1 if len(list(filter(lambda x: 2800 <= x <= 3199, a )))> 0 else 0
    over = list(filter(lambda x: 3200 < x, a ))

    ans_max =  ans_min + len(over)
    ans_min += 1 if len(over)> 0 else 0
    print(ans_min, ans_max)

    
    

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
dat_a = list(map(int, input().split()))
dat = set()
all_color = 0

for i in range(n):
    if dat_a[i] < 400:
        dat.add("a")
    elif dat_a[i] < 800:
        dat.add("b")
    elif dat_a[i] < 1200:
        dat.add("c")
    elif dat_a[i] < 1600:
        dat.add("d")
    elif dat_a[i] < 2000:
        dat.add("e")
    elif dat_a[i] < 2400:
        dat.add("f")
    elif dat_a[i] < 2800:
        dat.add("g")
    elif dat_a[i] < 3200:
        dat.add("h")
    else:
        all_color += 1

colored = len(dat)

resmin = colored
if resmin == 0 and all_color > 0:
    resmin = 1

resmax = colored + all_color
if resmax > 8:
    resmax = 8

print("{0} {1}".format(str(resmin), str(resmax)))

Submission status: Wrong Answer

Solution code:
n = int(input())
dat_a = list(map(int, input().split()))
dat = set([])
all_color = 0

for i in range(n):
    if dat_a[i] < 400:
        dat.add("a")
    elif dat_a[i] < 800:
        dat.add("b")
    elif dat_a[i] < 1200:
        dat.add("c")
    elif dat_a[i] < 1600:
        dat.add("d")
    elif dat_a[i] < 2000:
        dat.add("e")
    elif dat_a[i] < 2400:
        dat.add("f")
    elif dat_a[i] < 2800:
        dat.add("g")
    elif dat_a[i] < 3200:
        dat.add("h")
    else:
        all_color += 1

colored = len(dat)

resmin = colored
if resmin == 0:
    resmin = 1

resmax = colored + all_color
if resmax > 8:
    resmax = 8

print("{0} {1}".format(str(resmin), str(resmax)))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
a = [int(i) for i in input().split()]

number = []
over = 0
for i in range(8):
    number.append(False)

for i in a:
    position = int((i / 100) // 4)
    if position < 8:
        number[position] = True
    else:
        over += 1

minimum = sum(number)
if minimum == 0:
    minimum = 1
maximum = sum(number) + over
if maximum > 8:
    maximum = 8

print(str(minimum) + ' ' + str(maximum))

Submission status: Wrong Answer

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

a.sort()
min_color = [0] * 8
max_color = [0] * 8
extra = 0

for i in a:
    if i >= 3200:
        if sum(min_color) == 0:
            min_color[0] = 1
        if sum(max_color):
            extra += 1
    else:
        min_color[i // 400] = 1
        max_color[i // 400] = 1


print( sum(min_color), sum(max_color) + extra)

Submission status: Wrong Answer

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

a.sort()

min_color = [0] * 8
max_color = [0] * 8
extra = 0

for i in a:
    if i >= 3200:
        if sum(min_color) == 0:
            min_color[0] = 1
        if sum(max_color) + extra < 8:
            extra += 1
    else:
        min_color[i // 400] = 1
        max_color[i // 400] = 1


print( sum(min_color), sum(max_color) + extra)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
a = [int(i) for i in input().split()]

number = []
over = 0
for i in range(8):
    number.append(False)

for i in a:
    position = int((i / 100) // 4)
    if position < 8:
        number[position] = True
    else:
        over += 1

minimum = sum(number)
maximum = sum(number) + over
if maximum > 8:
    maximum = 8

print(str(minimum) + ' ' + str(maximum))

Submission status: Wrong Answer

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

colors = [0,0,0,0,0,0,0,0,0]

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

ans = 0
for i in range(len(colors)-1):
  if colors[i] !=0:
    ans +=1

print(str(ans) + " " + str(colors[8] + ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
dat_a = list(map(int, input().split()))
dat = set([])
all_color = 0
for i in range(n):
    if dat_a[i] < 400:
        dat.add("a")
    elif dat_a[i] < 800:
        dat.add("b")
    elif dat_a[i] < 1200:
        dat.add("c")
    elif dat_a[i] < 1600:
        dat.add("d")
    elif dat_a[i] < 2000:
        dat.add("e")
    elif dat_a[i] < 2400:
        dat.add("f")
    elif dat_a[i] < 2800:
        dat.add("g")
    elif dat_a[i] < 3200:
        dat.add("h")
    else:
        all_color += 1
colored = len(dat)

resmax = colored + all_color
if resmax > 8:
    resmax = 8

resmin = colored
if resmin == 0:
    resmin = 1

print("{0} {1}".format(str(resmin), str(resmax)))

Submission status: Wrong Answer

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

a.sort()

min_color = [0] * 8
max_color = [0] * 8
extra = 0

for i in a:
    if i >= 3200:
        if sum(min_color) == 0:
            min_color[0] = 1
        if sum(max_color) < 8:
            extra += 1
    else:
        min_color[i // 400] = 1
        max_color[i // 400] = 1
print( sum(min_color), sum(max_color) + extra)

Submission status: Wrong Answer

Solution code:
n = int(input())
dat_a = list(map(int, input().split()))
dat = set([])
all_color = 0
dat_set = set([])
for i in range(n):
    if dat_a[i] < 400:
        dat.add("a")
    elif dat_a[i] < 800:
        dat.add("b")
    elif dat_a[i] < 1200:
        dat.add("c")
    elif dat_a[i] < 1600:
        dat.add("d")
    elif dat_a[i] < 2000:
        dat.add("e")
    elif dat_a[i] < 2400:
        dat.add("f")
    elif dat_a[i] < 2800:
        dat.add("g")
    elif dat_a[i] < 3200:
        dat.add("h")
    else:
        all_color += 1
colored = len(dat)
resmax = colored + all_color
if resmax > 8:
    resmax = 8
resmin = colored
if resmin == 0:
    resmin = 1
print("{0} {1}".format(str(resmin), str(resmax)))

Submission status: Wrong Answer

Solution code:
n = int(input())
dat_a = list(map(int, input().split()))
dat = set([])
all_color = 0
dat_set = set([])
for i in range(n):
    if dat_a[i] < 400:
        dat.add("a")
    elif dat_a[i] < 800:
        dat.add("b")
    elif dat_a[i] < 1200:
        dat.add("c")
    elif dat_a[i] < 1600:
        dat.add("d")
    elif dat_a[i] < 2000:
        dat.add("e")
    elif dat_a[i] < 2400:
        dat.add("f")
    elif dat_a[i] < 2800:
        dat.add("g")
    elif dat_a[i] < 3200:
        dat.add("h")
    else:
        all_color += 1
colored = len(dat)
resmax = colored + all_color
if resmax > 8:
    resmax = 7
resmin = colored
if resmin == 0:
    resmin = 1
print("{0} {1}".format(str(resmin), str(resmax)))

Submission status: Wrong Answer

Solution code:
n = int(input())
dat_a = list(map(int, input().split()))
dat = set([])
all_color = 0
dat_set = set([])
for i in range(n):
    if dat_a[i] < 400:
        dat.add("a")
    elif dat_a[i] < 800:
        dat.add("b")
    elif dat_a[i] < 1200:
        dat.add("c")
    elif dat_a[i] < 1600:
        dat.add("d")
    elif dat_a[i] < 2000:
        dat.add("e")
    elif dat_a[i] < 2400:
        dat.add("f")
    elif dat_a[i] < 2800:
        dat.add("g")
    elif dat_a[i] < 3200:
        dat.add("h")
    else:
        all_color += 1
colored = len(dat)
res = colored + all_color
if res > 8:
    res = 7
print("{0} {1}".format(str(colored), str(res)))

Submission status: Wrong Answer

Solution code:
gray = []
brown = []
green = []
w_blue = []
blue = []
yellow = []
orange = []
red = []
seq = []
N = int(input())
a = list(map(int,input().split()))
for i in a:
    if 1 <= i < 400:
        gray.append(i)
    elif 400 <= i < 800:
        brown.append(i)
    elif 800 <= i < 1200:
        green.append(i)
    elif 1200 <= i < 1600:
        w_blue.append(i)
    elif 1600 <= i < 2000:
        blue.append(i)
    elif 2000 <= i < 2400:
        yellow.append(i)
    elif 2400 <= i < 2800:
        orange.append(i)
    elif 2800 <= i < 3200:
        red.append(i)
    else:
        seq.append(i)

L = [gray,brown,green,w_blue,blue,yellow,orange,red]
ans = 0
for i in L:
    if len(i) >= 1:
        ans += 1
        print(i)
if ans != 0:
    print(ans,ans+len(seq))
else:
    print(1,len(seq))

Submission status: Wrong Answer

Solution code:
gray = []
brown = []
green = []
w_blue = []
blue = []
yellow = []
orange = []
red = []
seq = []
N = int(input())
a = list(map(int,input().split()))
for i in a:
    if 1 <= i < 400:
        gray.append(i)
    elif 400 <= i < 800:
        brown.append(i)
    elif 800 <= i < 1200:
        green.append(i)
    elif 1200 <= i < 1600:
        w_blue.append(i)
    elif 1600 <= i < 2000:
        blue.append(i)
    elif 2000 <= i < 2400:
        yellow.append(i)
    elif 2400 <= i < 2800:
        orange.append(i)
    elif 2800 <= i < 3200:
        red.append(i)
    else:
        seq.append(i)

L = [gray,brown,green,w_blue,blue,yellow,orange,red]
ans = 0
for i in L:
    if len(i) >= 1:
        ans += 1
if ans != 0:
    print(ans,min(ans+len(seq),8))
else:
    print(1,min(len(seq),8))

Submission status: Wrong Answer

Solution code:
gray = []
brown = []
green = []
w_blue = []
blue = []
yellow = []
orange = []
red = []
seq = []
N = int(input())
a = list(map(int,input().split()))
for i in a:
    if 1 <= i < 400:
        gray.append(i)
    elif 400 <= i < 800:
        brown.append(i)
    elif 800 <= i < 1200:
        green.append(i)
    elif 1200 <= i < 1600:
        w_blue.append(i)
    elif 1600 <= i < 2000:
        blue.append(i)
    elif 2000 <= i < 2400:
        yellow.append(i)
    elif 2400 <= i < 2800:
        orange.append(i)
    elif 2800 <= i < 3200:
        red.append(i)
    else:
        seq.append(i)

L = [gray,brown,green,w_blue,blue,yellow,orange,red]
ans = 0
for i in L:
    if len(i) >= 1:
        ans += 1

print(ans,min(ans+len(seq),8))

Submission status: Wrong Answer

Solution code:
N = int(input())
*a, = map(int, input().split())
var = 0
cnt = [0] * 8

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

print(cnt.count(1), cnt.count(1) + var)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
ans=0
for i in range(n):
    if a[i]//400<8:
        b.append(a[i]//400)
    else:
        ans+=1
x=max(1,len(set(b)))
y=ans+len(set(b))
if y>=8:
    y=8
else:
    y=y


print(x,y)

Submission status: Wrong Answer

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

def col(x):
  if x < 400:
    return 0
  if x < 800:
    return 1
  if x < 1200:
    return 2
  if x < 1600:
    return 3
  if x < 2000:
    return 4
  # 等差かよ
  if x < 2400:
    return 5
  if x < 2800:
    return 6
  if x < 3200:
    return 7
  return 8

cnt = [0] * 9
for a in A:
  cnt[col(a)] += 1

basic = sum([min(x,1) for x in cnt[:8]])
rainbow = cnt[8]

MIN = max(1,basic)
MAX = min(basic+rainbow,8)
print(MIN,MAX)

Submission status: Wrong Answer

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

def col(x):
  if x < 400:
    return 0
  if x < 800:
    return 1
  if x < 1200:
    return 2
  if x < 1600:
    return 3
  if x < 2000:
    return 4
  # 等差かよ
  if x < 2400:
    return 5
  if x < 2800:
    return 6
  if x < 3200:
    return 7
  return 8

cnt = [0] * 9
for a in A:
  cnt[col(a)] += 1

basic = sum([min(x,1) for x in cnt[1:8]])
rainbow = cnt[8]

MIN = max(1,basic)
MAX = min(basic+rainbow,8)
print(MIN,MAX)

Submission status: Wrong Answer

Solution code:

n = int(input())
rate_list = [ int(v) for v in input().split() ]
color_list = [0 for i in range(8)]
free = 0
for i in rate_list:
	if  i < 3200:
		color_list[i//400] += 1
	else:
		free += 1


min_color = 8 - color_list.count(0)
if min_color == 0:
	min_color = 1
max_color = free + min_color
print(min_color,max_color)

Submission status: Wrong Answer

Solution code:

n = int(input())
rate_list = [ int(v) for v in input().split() ]
color_list = [0 for i in range(8)]
free = 0
for i in rate_list:
	if  i < 3200:
		color_list[i//400] += 1
	else:
		free += 1


min_color = 8 - color_list.count(0)
max_color = free+min_color
print(min_color,max_color)

Submission status: Wrong Answer

Solution code:
n = int(input())
rate_list = [ int(v) for v in input().split() ]
color_list = [0 for i in range(8)]
free = 0
for i in rate_list:
	if  i < 3200:
		color_list[i//400] += 1
	else:
		free += 1


min_color = 8 - color_list.count(0)
max_color = min(8,free+min_color)
print(min_color,max_color)

Submission status: Wrong Answer

Solution code:
N, *a = map(int, open(0).read().split())
ans = set()
over = 0
for v in a:
    v //= 400
    if v <8:
        ans.add(v)
    else:
        over += 1
print(len(ans), len(ans) + over)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
colors = {}
for i in a:
    if i//400 <= 7:
        colors[i//400] = 1
    else:
        if 8 in colors:
            colors[8] += 1
        else:
            colors[8] = 1
if 8 in colors:
    print(len(colors)-1, sum(colors.values()))
else:
    print(len(colors), len(colors))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
colors = 0
for i in range(8):
    colors += any(i * 400 <= a < (i + 1) * 400 for a in A)
print(colors,end=' ')
colors += sum((i + 1) * 400 <= a for a in A)
print(colors)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(x) for x in input().split()]
colors = [0]*9
cnt = 0
for i in a:
    if(i//400>8):
        colors[8]+=1
    else:
        colors[i//400]+=1
for i in colors[:-1]:
    if(i>0):
        cnt+=1
if(cnt == 0 and colors[8]>0):
    print(1,min(8,colors[8]))
else:
    print(cnt,min(8,cnt+colors[8]))

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c

import itertools
from collections import Counter
from collections import defaultdict
import bisect
import math
import heapq

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

    ratings = [0] * 9
    for a in A:
        ratings[min(a // 400, 8)] += 1

    # print(ratings)

    fixed_colors = 0
    for r in range(len(ratings) - 1):
        if ratings[r] > 0:
            fixed_colors += 1

    everything_ok = ratings[-1]

    min_colors = fixed_colors if fixed_colors > 0 else 1
    max_colors = min(8, fixed_colors + everything_ok)
    print('{} {}'.format(min_colors, max_colors))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c

import itertools
from collections import Counter
from collections import defaultdict
import bisect
import math
import heapq

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

    ratings = [0] * 9
    for a in A:
        ratings[min(a // 400, 8)] += 1

    print(ratings)

    fixed_colors = 0
    for r in range(len(ratings) - 1):
        if ratings[r] > 0:
            fixed_colors += 1

    everything_ok = ratings[-1]

    min_colors = fixed_colors if fixed_colors > 0 else 1
    max_colors = min(8, fixed_colors + everything_ok)
    print('{} {}'.format(min_colors, max_colors))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color=[0]*9
for i in a:
    if i//400<=7:
        color[i//400]+=1
    else:
        color[8]+=1
m=8-color[:8].count(0)
M=m
if m!=8:
    if color[8]>0:
        M+=min(color[8],8-m)
if m==0:
    m=1
print(m,M)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c

import itertools
from collections import Counter
from collections import defaultdict
import bisect
import math
import heapq

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

    ratings = [0] * 9
    for a in A:
        ratings[min(a // 400, 8)] += 1

    # print(ratings)

    ans = 0
    for r in range(len(ratings) - 1):
        if ratings[r] > 0:
            ans += 1

    everything_ok = ratings[-1]

    min_colors = ans if ans > 0 else (1 if everything_ok > 0 else 0)
    max_colors = min(8, ans + everything_ok)
    print('{} {}'.format(min_colors, max_colors))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color=[0]*9
for i in a:
    if i//400<=7:
        color[i//400]+=1
    else:
        color[8]+=1
m=8-color[:8].count(0)
M=m
if m!=8:
    if color[8]>0:
        M+=min(color[8],8-m)
print(m,M)

Submission status: Wrong Answer

Solution code:
N = int(input())
colors = [False]*8
high_rate_count = 0
for num in input().split():
    rate = int(int(num)/400)
    if rate > 7:
        high_rate_count += 1
    else:
        colors[rate] = True
count = 0
for color in colors:
    if color:
        count += 1
if count == 0:
    count = 1
    high_rate_count -= 1
max_count = count + high_rate_count
print(count, max_count)
print(colors)

Submission status: Wrong Answer

Solution code:
N = int(input())
colors = [False]*8
high_rate_count = 0
for num in input().split():
    rate = int(int(num)/400)
    if rate > 7:
        high_rate_count += 1
    else:
        colors[rate] = True
count = 0
for color in colors:
    if color:
        count += 1
if count == 0:
    count = 1
    high_rate_count -= 1
max_count = count + high_rate_count
if max_count > 8:
    max_count = 8
print(count, max_count)

Submission status: Wrong Answer

Solution code:
N = int(input())
colors = [False]*8
high_rate_count = 0
for num in input().split():
    rate = int(int(num)/400)
    if rate > 7:
        high_rate_count += 1
    elif colors[rate] == False:
        colors[rate] = True
count = 0
for color in colors:
    if color:
        count += 1
max_count = count + high_rate_count
if max_count > 8:
    max_count = 8
print(count, max_count)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

def determine_color(rate):
    if rate >= 1 and rate <= 399:
        return 0
    elif rate >= 400 and rate <= 799:
        return 1
    elif rate >= 800 and rate <= 1199:
        return 2
    elif rate >= 1200 and rate <= 1599:
        return 3
    elif rate >= 1600 and rate <= 1999:
        return 4
    elif rate >= 2000 and rate <= 2399:
        return 5
    elif rate >= 2400 and rate <= 2799:
        return 6
    elif rate >= 2800 and rate <= 3199:
        return 7
    else:
        return 8


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

    """方針
    色が8のとき、何色にもなれる。

    先に0~7の色を埋める(Trueにして)。これが最小の数。
    
    その後、最小の数に、色が8の数を足す。それが最大の数。

    問題文に書かれている色以外にもなれることに注意。黒色とか。
    """
    min_colors = [False] * 8
    color8_cnt = 0
    for i, a in enumerate(A):
        color = determine_color(a)
        if color == 8:
            color8_cnt += 1
            continue
        min_colors[color] = True
    
    min_ans = 0
    for i, c in enumerate(min_colors):
        if c:
            min_ans += 1
    
    if min_ans == 0 and color8_cnt != 0:
        min_ans = 1

    max_ans = min_ans
    max_ans += color8_cnt

    print("{} {}".format(min_ans, max_ans))



if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

def determine_color(rate):
    if rate >= 1 and rate <= 399:
        return 0
    elif rate >= 400 and rate <= 799:
        return 1
    elif rate >= 800 and rate <= 1199:
        return 2
    elif rate >= 1200 and rate <= 1599:
        return 3
    elif rate >= 1600 and rate <= 1999:
        return 4
    elif rate >= 2000 and rate <= 2399:
        return 5
    elif rate >= 2400 and rate <= 2799:
        return 6
    elif rate >= 2800 and rate <= 3199:
        return 7
    else:
        return 8


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

    """方針
    色が8のとき、何色にもなれる。

    先に0~7の色を埋める(Trueにして)。これが最小の数。
    
    その後、最小の数に、色が8の数を足す。それが最大の数。

    問題文に書かれている色以外にもなれることに注意。黒色とか。
    """
    min_colors = [False] * 8
    color8_cnt = 0
    for i, a in enumerate(A):
        color = determine_color(a)
        if color == 8:
            color8_cnt += 1
            continue
        min_colors[color] = True
    
    min_ans = 0
    for i, c in enumerate(min_colors):
        if c:
            min_ans += 1

    max_ans = min_ans
    max_ans += color8_cnt

    print("{} {}".format(min_ans, max_ans))



if __name__ == "__main__":
    solve()