Problem:


Score : 300 points

Problem Statement

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:  

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.

Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.

Find the minimum and maximum possible numbers of different colors of the users.  

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.  

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.  

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red".

If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors.

If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.  

Sample Input 3

20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990

Sample Output 3

1 1

All the users are "green", and thus there is one color.



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = solve(n, a)
    print(*ans)


def solve(n, a):
    m = 8
    colors = [0 for i in range(m + 1)]
    for i in range(n):
        for j in range(m):
            if a[i] < 400 * (j + 1):
                colors[j] += 1
                break
        else:
            colors[m] += 1
    usedcolors = sum([1 for i in colors[:m] if i > 0])
    ans = [max(1,usedcolors), min(8, usedcolors + colors[m])]

    return ans


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

N = int(input())
A = list(map(int, input().split()))
S = set()
sa = 0
for i in A:
    a = i // 400
    if a < 8:
        S.add(a)
    else:
        sa += 1
ans1 = len(S)
ans2 = len(S) + sa
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:

N = int(input())
A = list(map(int, input().split()))
S = set()
sa = 0
for i in A:
    a = i // 400
    if a < 8:
        S.add(a)
    else:
        sa += 1
ans1 = len(S)
ans2 = min(len(S) + sa, 8)
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
c = [0]*10
add = 0
for i in range(n) :
    if A[i]>=3200 :
        add += 1
        continue
    a = A[i]//400
    c[a] = 1

print(max(sum(c),1),min(sum(c)+add,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
c = [0]*10
add = 0
for i in range(n) :
    if A[i]>=3200 :
        add += 1
        continue
    a = A[i]//400
    c[a] = 1

print(sum(c),min(sum(c)+add,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
c = [0]*10
add = 0
for i in range(n) :
    if A[i]>=3200 :
        add += 1
        continue
    a = A[i]//400
    c[a] = 1

print(sum(c),sum(c)+add)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[24]:


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


# In[28]:


color_list = [rate//400 for rate in a]
# print(color_list)
filtered = [x for x in color_list if x < 8]
# print(filtered)
free = len(color_list) - len(filtered)

if free == len(color_list):
    print(1, min(free, 8))
else:
    print(len(set(filtered)), min(len(set(filtered)) + free, 8))


# In[ ]:

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[24]:


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


# In[27]:


color_list = [rate//400 for rate in a]
print(color_list)
filtered = [x for x in color_list if x < 8]
print(filtered)
free = len(color_list) - len(filtered)

if free == len(color_list):
    print(1, min(free, 8))
else:
    print(len(set(filtered)), min(len(set(filtered)) + free, 8))


# In[ ]:

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[24]:


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


# In[25]:


color_list = [rate//100//4 for rate in a]
# print(color_list)
filtered = [x for x in color_list if x < 8]
# print(filtered)
free = len(color_list) - len(filtered)

if len(filtered) == 0:
    print(1, min(free, 8))
else:
    print(len(set(filtered)), min(len(set(filtered)) + free, 8))


# In[ ]:

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[24]:


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


# In[25]:


color_list = [rate//100//4 for rate in a]
# print(color_list)
filtered = [x for x in color_list if x < 8]
# print(filtered)
free = len(color_list) - len(filtered)
print(len(set(filtered)), min(len(set(filtered)) + free, 8))


# In[ ]:

Submission status: Wrong Answer

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

judge = [1,399,799,1199,1599,1999,2399,2799,3199]
color = [0]*(len(judge)-1)
count = 0

for i in range(len(a)):
    if a[i] >= 3200:
        count += 1
    else:
        for j in range(len(judge)):
            if a[i] <= judge[j] and a[i] > judge[j-1]:
                color[j-1] = 'a'
cnt_a = 0
for i in range(len(color)):
    if color[i] == 'a':
        cnt_a += 1
min = cnt_a
if cnt_a+count >= len(color):
    max = len(color)
else:
    max = cnt_a+count
print(min,max)

Submission status: Wrong Answer

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

color = [0]*8
free_color = 0
for a in A:
  if a < 400:
    color[0] = 1
  elif a < 800:
    color[1] = 1
  elif a < 1200:
    color[2] = 1
  elif a < 1600:
    color[3] = 1
  elif a < 2000:
    color[4] = 1
  elif a < 2400:
    color[5] = 1
  elif a < 2800:
    color[6] = 1
  elif a < 3200:
    color[7] = 1
  else:
    free_color += 1
sum_c = sum(color)
free_color = min(free_color, 8 - sum_c)

if sum_c == 0:
  print(1, free_color)
else:
  print(sum_c, sum_c + free_color)

Submission status: Wrong Answer

Solution code:
N = int(input())
colors = {}
any_color = 0
for rate in list(map(int, input().split())):
    if rate < 400:
        colors['gray'] = True
    elif rate < 800:
        colors['brawn'] = True
    elif rate < 1200:
        colors['green'] = True
    elif rate < 1600:
        colors['water'] = True
    elif rate < 2000:
        colors['blue'] = True
    elif rate < 2400:
        colors['yellow'] = True
    elif rate < 2800:
        colors['orange'] = True
    elif rate < 3200:
        colors['red'] = True
    else:
        any_color += 1

min_color = max(len(colors.keys()), 1)
max_color = min(len(colors.keys()) + any_color, 8)
print(min_color, max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())
colors = {}
any_color = 0
for rate in list(map(int, input().split())):
    if rate < 400:
        colors['red'] = True
    elif rate < 800:
        colors['brawn'] = True
    elif rate < 1200:
        colors['green'] = True
    elif rate < 1600:
        colors['water'] = True
    elif rate < 2000:
        colors['blue'] = True
    elif rate < 2400:
        colors['yellow'] = True
    elif rate < 2800:
        colors['orange'] = True
    elif rate < 3200:
        colors['red'] = True
    else:
        any_color += 1

min_color = max(len(colors.keys()), 1)
max_color = min(len(colors.keys()) + any_color, 8)
print(min_color, max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())
colors = {}
any_color = 0
for rate in list(map(int, input().split())):
    if rate < 400:
        colors['red'] = True
    elif rate < 800:
        colors['brawn'] = True
    elif rate < 1200:
        colors['green'] = True
    elif rate < 1600:
        colors['water'] = True
    elif rate < 2000:
        colors['blue'] = True
    elif rate < 2400:
        colors['yellow'] = True
    elif rate < 2800:
        colors['orange'] = True
    elif rate < 3200:
        colors['red'] = True
    else:
        any_color += 1

min_color = max(len(colors.keys()), 1)
max_color = min(min_color + any_color, 8)
print(min_color, max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())
colors = {}
any_color = 0
for rate in list(map(int, input().split())):
    if rate < 400:
        colors['red'] = True
    elif rate < 800:
        colors['brawn'] = True
    elif rate < 1200:
        colors['green'] = True
    elif rate < 1600:
        colors['water'] = True
    elif rate < 2000:
        colors['blue'] = True
    elif rate < 2400:
        colors['yellow'] = True
    elif rate < 2800:
        colors['orange'] = True
    elif rate < 3200:
        colors['red'] = True
    else:
        any_color += 1

min_color = len(colors.keys())
max_color = min(min_color + any_color, 8)
print(min_color, max_color)

Submission status: Wrong Answer

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

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

max_color = min(free_color,8-sum(color))

if sum(color) == 0:
  print(1,max_color)
else:
  print(sum(color),sum(color)+max_color)

Submission status: Wrong Answer

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

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

print(sum(color),sum(color)+free_color)

Submission status: Wrong Answer

Solution code:
i = int(input())
a = [int(x) for x in input().split()]

color = [False]*8
top = 0

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

mx = color.count(True) + top
mi = color.count(True)
print('{} {}'.format(mi, mx))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=map(int,input().split())
count={}
ziyuu=0
for a in A:
    if 1<=a<=399:
        count['灰色']=1
    elif 400<=a<=799:
        count['茶色']=1   
    elif 800<=a<=1199:
        count['緑色']=1 
    elif 1200<=a<=1599:
        count['水色']=1 
    elif 1600<=a<=1999:
        count['青色']=1 
    elif 2000<=a<=2399:
        count['黄色']=1 
    elif 2400<=a<=2799:
        count['橙色']=1 
    elif 2800<=a<=3199:
        count['赤色']=1 
    elif 3200<=a:
        ziyuu+=1
mi=max(1,len(count))
ma=mi+ziyuu
print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=map(int,input().split())
count={}
ziyuu=0
for a in A:
    if 1<=a<=399:
        count['灰色']=1
    elif 400<=a<=799:
        count['茶色']=1   
    elif 800<=a<=1199:
        count['緑色']=1 
    elif 1200<=a<=1599:
        count['水色']=1 
    elif 1600<=a<=1999:
        count['青色']=1 
    elif 2000<=a<=2399:
        count['黄色']=1 
    elif 2400<=a<=2799:
        count['橙色']=1 
    elif 2800<=a<=3199:
        count['赤色']=1 
    elif 3200<=a:
        ziyuu+=1
mi=len(count)
ma=mi+ziyuu
print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=map(int,input().split())
count={}
ziyuu=0
for a in A:
    if 1<=a<=399:
        count['灰色']=1
    elif 400<=a<=799:
        count['茶色']=1   
    elif 800<=a<=1199:
        count['緑色']=1 
    elif 1200<=a<=1599:
        count['水色']=1 
    elif 1600<=a<=1999:
        count['青色']=1 
    elif 2000<=a<=2399:
        count['黄色']=1 
    elif 2400<=a<=2799:
        count['橙色']=1 
    elif 2800<=a<=3199:
        count['赤色']=1 
    elif 3200<=a:
        ziyuu+=1
mi=len(count)
ma=min(8,mi+ziyuu)
print(mi,ma)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
A = list(map(int, sys.stdin.readline().rsplit()))

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

res = len(dic.items())
print(res, res + free)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i)//400 for i in input().split()]
s = set()
f = 0
for i in a:
    if i>=8:
        f += 1
    else:
        s.add(i)
mn = len(s)
if len(s)==0: mn += f>0
mx = min(8, len(s)+f)
print(mn, mx)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
A=[int(i)//400 for i in input().split()]
dd = defaultdict(int)
t=0
for i in A:
    if i>=8:
        t+=1
        continue
    else:
        dd[i]+=1
print(max(len(dd), 1),min(len(dd)+t, 8))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
A=[int(i)//400 for i in input().split()]
dd = defaultdict(int)
t=0
for i in A:
    if i>=8:
        t+=1
        continue
    else:
        dd[i]+=1
print(len(dd),min(len(dd)+t, 8))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
gray=brown=green=lblue=blue=yellow=orange=red=any=0
mini=0
maxi=0

for i in a:
    if i >= 1 and i <= 399 and gray==0:
        gray+=1 
    elif i >= 400 and i <= 799 and brown==0:
        brown+=1
    elif i >= 800 and i <= 1199 and green==0:
        green+=1
    elif i >= 1200 and i <= 1599 and lblue==0:
        lblue+=1
    elif i >= 1600 and i <= 1999 and blue==0:
        blue+=1    
    elif i >= 2000 and i <= 2399 and yellow==0:
        yellow+=1
    elif i >= 2400 and i <= 2799 and orange==0:
        orange+=1
    elif i >= 2800 and i <= 3199 and red==0:
        red+=1
    elif i >= 3200:
        any+=1
    else:
        pass
if gray+brown+green+lblue+blue+yellow+orange+red==0 and any>=1:
    mini=1
else:
    mini=gray+brown+green+lblue+blue+yellow+orange+red
if gray+brown+green+lblue+blue+yellow+orange+red+any>8:
    maxi=8
else:
    maxi=gray+brown+green+lblue+blue+yellow+orange+red+any
print(mini,maxi)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
gray=brown=green=lblue=blue=yellow=orange=red=any=0
mini=0
maxi=0

for i in a:
    if i >= 1 and i <= 399 and gray==0:
        gray+=1 
    elif i >= 400 and i <= 799 and brown==0:
        brown+=1
    elif i >= 800 and i <= 1199 and green==0:
        green+=1
    elif i >= 1200 and i <= 1599 and lblue==0:
        lblue+=1
    elif i >= 1600 and i <= 1999 and blue==0:
        blue+=1    
    elif i >= 2000 and i <= 2399 and yellow==0:
        yellow+=1
    elif i >= 2400 and i <= 2799 and orange==0:
        orange+=1
    elif i >= 2800 and i <= 3199 and red==0:
        red+=1
    elif i >= 3200:
        any+=1
if gray+brown+green+lblue+blue+yellow+orange+red==0 and any>=1:
    mini=1
else:
    mini=gray+brown+green+lblue+blue+yellow+orange+red
maxi=gray+brown+green+lblue+blue+yellow+orange+red+any
if maxi>8:
    maxi=8
print(mini,maxi)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from sys import *
from math import *

N = int(input())
l = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
counter = 0
min = 0
max = 0

for i in range(N):
   if l[i] >= 1 and l[i] <= 399:
   	   gray = 1
   elif l[i] >= 400 and l[i] <= 799:
   	   brown= 1
   elif l[i] >= 800 and l[i] <= 1199:
   	   green = 1
   elif l[i] >= 1200 and l[i] <= 1599:
   	   cyan = 1
   elif l[i] >= 1600 and l[i] <= 1999:
   	   blue = 1
   elif l[i] >= 2000 and l[i] <= 2399:
   	   yellow = 1   	   
   elif l[i] >= 2400 and l[i] <= 2799:
   	   orange = 1   	   
   elif l[i] >= 2800 and l[i] <= 3199:
   	   red = 1
   elif l[i] >= 3200:
   	   counter += 1

flag_sum = gray + brown + green + cyan + blue + yellow + orange + red

max = counter + flag_sum
if max >= 8:
   max = 8

if flag_sum >= 1:
   min = flag_sum
if flag_sum == 0:
   min = 1

print(min, max)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from sys import *
from math import *

N = int(input())
l = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
counter = 0
min = 0
max = 0

for i in range(N):
   if l[i] >= 1 and l[i] <= 399:
   	   gray = 1
   elif l[i] >= 400 and l[i] <= 799:
   	   brown= 1
   elif l[i] >= 800 and l[i] <= 1199:
   	   green = 1
   elif l[i] >= 1200 and l[i] <= 1599:
   	   cyan = 1
   elif l[i] >= 1600 and l[i] <= 1999:
   	   blue = 1
   elif l[i] >= 2000 and l[i] <= 2399:
   	   yellow = 1   	   
   elif l[i] >= 2400 and l[i] <= 2799:
   	   orange = 1   	   
   elif l[i] >= 2800 and l[i] <= 3199:
   	   red = 1
   else:
   	   counter += 1

flag_sum = gray + brown + green + cyan + blue + yellow + orange + red

max = counter + flag_sum
if max >= 8:
   max = 8

if flag_sum >= 1:
   min = flag_sum
   if min >= 8:
   	   min = 8
if flag_sum == 0:
   min = 1

print(min, max)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from sys import *
from math import *

N = int(input())
l = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
counter = 0

for i in range(N):
   if l[i] >= 1 and l[i] <= 399:
   	   gray = 1
   elif l[i] >= 400 and l[i] <= 799:
   	   brown= 1
   elif l[i] >= 800 and l[i] <= 1199:
   	   green = 1
   elif l[i] >= 1200 and l[i] <= 1599:
   	   cyan = 1
   elif l[i] >= 1600 and l[i] <= 1999:
   	   blue = 1
   elif l[i] >= 2000 and l[i] <= 2399:
   	   yellow = 1   	   
   elif l[i] >= 2400 and l[i] <= 2799:
   	   orange = 1   	   
   elif l[i] >= 2800 and l[i] <= 3199:
   	   red = 1
   else:
   	   counter += 1

flag_sum = gray + brown + green + cyan + blue + yellow + orange + red
if flag_sum >= 1 and counter == 0:
   if flag_sum < 8:
   	   print(flag_sum, flag_sum)
   elif flag_sum >= 8:
   	   print(8, 8)
elif flag_sum >= 1 and counter >= 1:
   if flag_sum < 8:
   	   if flag_sum + counter >= 8:
   	      print(flag_sum, 8)
   	   elif flag_sum + counter < 8:
   	   	   print(flag_sum, flag_sum+counter)
   elif flag_sum >= 8:
   	   print(8, 8)
elif  flag_sum == 0 and counter >= 1:
   if counter >= 8:
   	   print(1, 8)
   elif counter < 8:
   	   print(1, counter)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from sys import *
from math import *

N = int(input())
l = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
counter = 0

for i in range(N):
   if l[i] >= 1 and l[i] <= 399:
   	   gray = 1
   elif l[i] >= 400 and l[i] <= 799:
   	   brown= 1
   elif l[i] >= 800 and l[i] <= 1199:
   	   green = 1
   elif l[i] >= 1200 and l[i] <= 1599:
   	   cyan = 1
   elif l[i] >= 1600 and l[i] <= 1999:
   	   blue = 1
   elif l[i] >= 2000 and l[i] <= 2399:
   	   yellow = 1   	   
   elif l[i] >= 2400 and l[i] <= 2799:
   	   orange = 1   	   
   elif l[i] >= 2800 and l[i] <= 3199:
   	   red = 1
   else:
   	   counter += 1

flag_sum = gray + brown + green + cyan + blue + yellow + orange + red
if flag_sum == 8:
   print(8,8)
elif flag_sum < 8 and flag_sum >= 1:
   if flag_sum + counter >= 8:
   	   print(flag_sum, 8)
   else:
   	   print(flag_sum, flag_sum + counter)
elif flag_sum == 0:
   if counter >= 8:
   	   print(1,8)
   else:
   	   print(1,counter)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from sys import *
from math import *

N = int(input())
l = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
counter = 0

for i in range(N):
   if l[i] >= 1 and l[i] <= 399:
   	   gray = 1
   elif l[i] >= 400 and l[i] <= 799:
   	   brown= 1
   elif l[i] >= 800 and l[i] <= 1199:
   	   green = 1
   elif l[i] >= 1200 and l[i] <= 1599:
   	   cyan = 1
   elif l[i] >= 1600 and l[i] <= 1999:
   	   blue = 1
   elif l[i] >= 2000 and l[i] <= 2399:
   	   yellow = 1   	   
   elif l[i] >= 2400 and l[i] <= 2799:
   	   orange = 1   	   
   elif l[i] >= 2800 and l[i] <= 3199:
   	   red = 1
   else:
   	   counter += 1

flag_sum = gray + brown + green + cyan + blue + yellow + orange + red
if flag_sum == 8:
   print(8,8)
elif flag_sum <= 8:
   if flag_sum + counter >= 8:
   	   print(flag_sum, 8)
   else:
   	   print(flag_sum, flag_sum + counter)

Submission status: Wrong Answer

Solution code:
import collections

def myindex(l, x, default=-1):
    if x in l:
        return l.index(x)
    else:
        return default

def main():
    N = int(input())
    a = list(map(int, input().split()))
    
    A = [x//400 for x in a]
    A.sort()
    Aitems = list(zip(*collections.Counter(A).items()))
    cntmin = len([x for x in Aitems[0] if x < 8])
    cntmax = cntmin + len([x for x in A if x >= 8])
    print(cntmin, cntmax)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N = INT()
a = LIST()
 
anss = [False]*8
cnt = 0
 
for i in range(N):
	if a[i] >= 3200:
		cnt += 1
	else:
		anss[a[i]//400] = True
 
MIN = max(sum(anss), 1)
MAX = MIN+cnt
print(MIN, MAX)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
a = LIST()

anss = [False]*8
cnt = 0

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

MIN = max(sum(anss), 1)
MAX = min(MIN+cnt, 8)
print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
a = LIST()

anss = [False]*8
cnt = 0

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

MIN = sum(anss)
MAX = min(MIN+cnt, 8)
print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
a = LIST()

anss = [False]*8
cnt = 0

for i in range(N):
	if 1 <= a[i] < 400:
		anss[0] = True
	if 400 <= a[i] < 800:
		anss[1] = True
	if 800 <= a[i] < 1200:
		anss[2] = True
	if 1200 <= a[i] < 1600:
		anss[3] = True
	if 1600 <= a[i] < 2000:
		anss[4] = True
	if 2000 <= a[i] < 2400:
		anss[5] = True
	if 2400 <= a[i] < 2800:
		anss[6] = True
	if 2800 <= a[i] < 3200:
		anss[7] = True
	if 3200 <= a[i]:
		cnt += 1

MIN = sum(anss)
MAX = min(MIN+cnt, 8)
print(MIN, MAX)

Submission status: Wrong Answer

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

d = defaultdict(int)
for i in range(n):
    if a[i] >= 3200:
        d["free"] += 1
    elif a[i] >= 2800:
        d["red"] += 1
    elif a[i] >= 2400:
        d["ora"] += 1
    elif a[i] >= 2000:
        d["yellow"] += 1
    elif a[i] >= 1600:
        d["blue"] += 1
    elif a[i] >= 1200:
        d["rblue"] += 1
    elif a[i] >= 800:
        d["green"] += 1
    elif a[i] >= 400:
        d["brown"] += 1
    else:
        d["gray"] += 1

ans = 0
fr = 0
for i in d:
    if i == "free":
        fr += d[i]
    else:
        ans += 1

print(ans,ans+fr)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = []
rate = ['gray', 'brown', 'green', 'water', 'blue', 'yellow', 'orange', 'red']
count = 0

for i in range(n):
    q, r = divmod(a[i], 400)
    if q >= 8:
        count += 1
    else: l.append(rate[q])

print(len(set(l)), len(set(l))+count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = []
rate = ['gray', 'brown', 'green', 'water', 'blue', 'yellow', 'orange', 'red']
count = 0

for i in range(n):
    q, r = divmod(a[i], 400)
    if q >= 8:
        count += 1
    else: l.append(rate[q])

print(len(set(l)), min(len(set(l))+count, 8))

Submission status: Wrong Answer

Solution code:
n=int(input())
list=list(map(int,input().split()))
ans=set()
temp=0
for i in list:
    if i>=3200:temp+=1
    else:ans.add(i//400)
print(max(1,len(ans)),len(ans)+min(8-len(ans),temp))

Submission status: Wrong Answer

Solution code:
n=int(input())
list=list(map(int,input().split()))
ans=[]
temp=0
for i in list:
    if 1<=i<=3199:ans.append(i//400)
    else:temp+=1
if 0<len(set(ans)):
    print(len(set(ans)),len(set(ans))+min(8-len(set(ans)),temp))
else:
    print(1,min(8,temp))

Submission status: Wrong Answer

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

rate_li=[0]*9
top_coder=0
for a in a_input:
    rate_li[min(a//400,8)]+=1
print(rate_li)
min_ = sum(i!=0 for i in rate_li[:8])
print(max(min_,1),min_+rate_li[-1])

Submission status: Wrong Answer

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

rate_li=[0]*9
top_coder=0
for a in a_input:
    rate_li[min(a//400,8)]+=1
min_ = sum(i!=0 for i in rate_li[:8])
print(max(min_,1),min(8,min_+rate_li[-1]))

Submission status: Wrong Answer

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

rate_li=[0]*9
top_coder=0
for a in a_input:
    rate_li[min(a//400,8)]+=1

min_ = sum(i!=0 for i in rate_li[:8])
print(min_,min(8,min_+rate_li[-1]))

Submission status: Wrong Answer

Solution code:
N = int(input())
*a, = map(int, input().split())
colors = [0]*8
top = 0
for i in range(N):
    if a[i] < 3200:
        colors[a[i]//400] += 1
    else:
        top += 1

m = 0
for c in colors:
    if c > 0:
        m += 1
print(m, m+top)

Submission status: Wrong Answer

Solution code:
N = int(input())
*a, = map(int, input().split())
colors = [0]*8
top = 0
for i in range(N):
    if a[i] < 3200:
        colors[a[i]//400] += 1
    else:
        top += 1

m = 0
for c in colors:
    if c > 0:
        m += 1
print(m, min(m+top, 8))

Submission status: Wrong Answer

Solution code:
_ = int(input())
a = list(map(int, input().split()))
b = set()
c = 0
for e in a:
    if e >= 3200:
        c += 1
    else:
        b.add(e % 400)
print(max(len(b), 1), len(b) + c)