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())
list=list(map(int,input().split()))
ans=[]
temp=0
for i in list:
    if 1<=i<=399:
        ans.append(1)
    elif 400<=i<=799:
        ans.append(2)
    elif 800<=i<=1199:
        ans.append(3)
    elif 1200<=i<=1599:
        ans.append(4)
    elif 1600<=i<=1999:
        ans.append(5)
    elif 2000<=i<=2399:
        ans.append(6)
    elif 2400<=i<=2799:
        ans.append(7)
    elif 2800<=i<=3199:
        ans.append(8)
    else:temp+=1
print(max(1,len(set(ans))),len(set(ans))+min(8-len(set(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<=399:
        ans.append(1)
    elif 400<=i<=799:
        ans.append(2)
    elif 800<=i<=1199:
        ans.append(3)
    elif 1200<=i<=1599:
        ans.append(4)
    elif 1600<=i<=1999:
        ans.append(5)
    elif 2000<=i<=2399:
        ans.append(6)
    elif 2400<=i<=2799:
        ans.append(7)
    elif 2800<=i<=3199:
        ans.append(8)
    else:temp+=1
print(len(set(ans)),len(set(ans))+min(8-len(set(ans)),temp))

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[int(x) for x in input().rstrip().split()]
rate=[False]*8
cnt=0
for i in l:
    if 8<=i//400:
        cnt+=1
        continue
    
    rate[i//400]=True



print(sum(rate),sum(rate)+cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[int(x) for x in input().rstrip().split()]
rate=[False]*8
cnt=0

for i in l:
    for j in range(1,8+1):
        if 3200<=i:
            cnt+=1
            break
            
        if i<=j*400-1:
            rate[j-1]=True
            break

print(sum(rate),sum(rate)+cnt)

Submission status: Wrong Answer

Solution code:
from collections import Counter


def get_color(rating):
    for i, (l_l, l_u) in enumerate(zip(limits, limits[1:])):
        if l_l <= rating < l_u:
            return i
    else:
        return SUPER_CODER


limits = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
SUPER_CODER = len(limits) - 1
input()
a = Counter(map(lambda x: get_color(int(x)), input().split()))
min_color_cnt = len([i for i in a if i < SUPER_CODER])
print(max(1, min_color_cnt), min(SUPER_CODER, min_color_cnt + a[SUPER_CODER]))

Submission status: Wrong Answer

Solution code:
from collections import Counter


def get_color(rating):
    for i, (l_l, l_u) in enumerate(zip(limits, limits[1:])):
        if l_l <= rating < l_u:
            return i
    else:
        return SUPER_CODER


limits = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
SUPER_CODER = len(limits) - 1
N = int(input())
a = Counter(map(lambda x: get_color(int(x)), input().split()))
min_color_cnt = len([i for i in a if i < SUPER_CODER])
print(min_color_cnt, min(SUPER_CODER, min_color_cnt + a[SUPER_CODER]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

rates = [0 for _ in range(8)]
gold = 0
for a in A:
    rate = a // 400
    if rate < 8:
        rates[rate] += 1
    elif rate >= 8:
        gold += 1

ansMin = 8 - rates.count(0)
if ansMin == 0:
    ansMin = 1
ansMax = ansMin + gold
print(str(ansMin) + ' ' + str(ansMax))

Submission status: Wrong Answer

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

rates = [0 for _ in range(8)]
gold = 0
for a in A:
    rate = a // 400
    if rate < 8:
        rates[rate] += 1
    elif rate >= 8:
        gold += 1

print(rates)
ansMin = 8 - rates.count(0)
if ansMin == 0:
    ansMin = 1
ansMax = ansMin + gold
print(str(ansMin) + ' ' + str(ansMax))

Submission status: Wrong Answer

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

rates = [0 for _ in range(8)]
gold = 0
for a in A:
    rate = a // 400
    if rate < 8:
        rates[rate] += 1
    elif rate >= 8:
        gold += 1

print(rates)
ansMin = min(1, 8 - rates.count(0))
ansMax = ansMin + gold
print(str(ansMin) + ' ' + str(ansMax))

Submission status: Wrong Answer

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

rates = [0 for _ in range(8)]
gold = 0
for a in A:
    rate = a // 400
    if rate < 8:
        rates[rate] += 1
    elif rate >= 8:
        gold += 1

ansMin = 8 - rates.count(0)
ansMax = ansMin + gold
print(str(ansMin) + ' ' + str(ansMax))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in range(n):
    for j in range(8):
        if (j*400)<=A[i]<((j+1)*400):
            B.append(j)
    if 3200<=A[i]:
        C.append(i)
print(max(len(set(B)),1),min(len(set(B))+len(C),8))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in range(n):
    for j in range(8):
        if (j*400)<=A[i]<((j+1)*400):
            B.append(j)
    if 3200<=A[i]:
        C.append(i+100)
print(max(len(set(B)),1),min(len(set(B))+len(C),8))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in range(n):
    for j in range(8):
        if (j*400)<=A[i]<((j+1)*400):
            B.append(j)
    if 3200<=A[i]:
        C.append(i+100)
print(len(set(B)),min(len(set(B))+len(C),8))

Submission status: Wrong Answer

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

over_3200 = 0
colors = {}
for x in a:
    if 1 <= x and x <= 399:
        colors.setdefault("grey", 0)
        colors["grey"] += 1
    elif 400 <= x and x <= 799:
        colors.setdefault("brown", 0)
        colors["brown"] += 1
    elif 800 <= x and x <= 1199:
        colors.setdefault("green", 0)
        colors["green"] += 1
    elif 1200 <= x and x <= 1599:
        colors.setdefault("sky", 0)
        colors["sky"] += 1
    elif 1600 <= x and x <= 1999:
        colors.setdefault("blue", 0)
        colors["blue"] += 1
    elif 2000 <= x and x <= 2399:
        colors.setdefault("yellow", 0)
        colors["yellow"] += 1
    elif 2400 <= x and x <= 2799:
        colors.setdefault("orange", 0)
        colors["orange"] += 1
    elif 2800 <= x and x <= 3199:
        colors.setdefault("red", 0)
        colors["red"] += 1
    else:
        over_3200 += 1

print(len(colors), len(colors) + over_3200)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = [0] * 9
for i in a:
    if i >= 3200:
        l[8] += 1
    else:
        l[i // 400] += 1
mi = 0
ma = 0
for i in l[:8]:
    if i > 0:
        mi += 1
        ma += 1
if l[8] > 0:
    ma += l[8]
print(mi, ma)

Submission status: Wrong Answer

Solution code:
import sys

N = int(sys.stdin.readline().rstrip())
A = map(int, sys.stdin.readline().rstrip().split())

colors = set()
free = 0
for a_i in A:
    color = a_i // 400
    if color >= 8:
        free += 1
    else:
        colors.add(color)

n = len(colors)
print(n, n + free)

Submission status: Wrong Answer

Solution code:
import sys

N = int(sys.stdin.readline().rstrip())
A = map(int, sys.stdin.readline().rstrip().split())

colors = set()
free = 0
for a_i in A:
    color = a_i // 400
    if color >= 8:
        free += 1
    else:
        colors.add(color)

n = len(colors)
print(n, min(8, n + free))

Submission status: Wrong Answer

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

def color(n):
    if n < 400:
        return 0
    elif n < 800:
        return 1
    elif n < 1200:
        return 2
    elif n < 1600:
        return 3
    elif n < 2000:
        return 4
    elif n < 2400:
        return 5
    elif n < 2800:
        return 6
    elif n < 3200:
        return 7
    else:
        return 8

clr = list(map(color, a))
n = len(set(clr))
if 8 not in clr:
    print('{} {}'.format(n, n))
else:
    free_cnt = clr.count(8)
    min_n = max(n-1, 1)
    max_n = min(n+free_cnt-1, 9)
    print('{} {}'.format(min_n, max_n))

Submission status: Wrong Answer

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

def color(n):
    if n < 400:
        return 0
    elif n < 800:
        return 1
    elif n < 1200:
        return 2
    elif n < 1600:
        return 3
    elif n < 2000:
        return 4
    elif n < 2400:
        return 5
    elif n < 2800:
        return 6
    elif n < 3200:
        return 7
    else:
        return 8

clr = list(map(color, a))
n = len(set(clr))
if 8 not in clr:
    print('{} {}'.format(n, n))
else:
    free_cnt = clr.count(8)
    min_n = max(n-1, 1)
    max_n = min(n+free_cnt-1, 8)
    print('{} {}'.format(min_n, max_n))

Submission status: Wrong Answer

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

def color(n):
    if n < 400:
        return 0
    elif n < 800:
        return 1
    elif n < 1200:
        return 2
    elif n < 1600:
        return 3
    elif n < 2000:
        return 4
    elif n < 2400:
        return 5
    elif n < 2800:
        return 6
    elif n < 3200:
        return 7
    else:
        return 8

clr = list(map(color, a))
n = len(set(clr))
if 8 not in clr:
    print('{} {}'.format(n, n))
else:
    free_cnt = clr.count('f')
    min_n = max(n-1, 1)
    max_n = min(n+free_cnt-1, 8)
    print('{} {}'.format(min_n, max_n))

Submission status: Wrong Answer

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

def color(n):
    if n < 400:
        return 'hai'
    elif n < 800:
        return 'cha'
    elif n < 1200:
        return 'midori'
    elif n < 1600:
        return 'mizu'
    elif n < 2000:
        return 'ao'
    elif n < 2400:
        return 'ki'
    elif n < 2800:
        return 'ore'
    elif n < 3200:
        return 'aka'
    else:
        return 'f'

clr = list(map(color, a))
n = len(set(clr))
if 'f' not in clr:
    print('{} {}'.format(n, n))
else:
    free_cnt = clr.count('f')
    min_n = n-1
    max_n = min(n+free_cnt-1, 8)
    print('{} {}'.format(min_n, max_n))

Submission status: Wrong Answer

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

def color(n):
    if n < 400:
        return 'hai'
    elif n < 800:
        return 'cha'
    elif n < 1200:
        return 'midori'
    elif n < 1600:
        return 'mizu'
    elif n < 2400:
        return 'ao'
    elif n < 2800:
        return 'ore'
    elif n < 3200:
        return 'aka'
    else:
        return 'free'

clr = list(map(color, a))

if 'free' not in clr:
    n = len(set(clr))
    print('{} {}'.format(n, n))
else:
    free_cnt = clr.count('free')
    n = len(set(clr))
    min_n = n-1
    max_n = min(n+free_cnt-1, 8)
    print('{} {}'.format(min_n, max_n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int, input().split()))
l=[x // 400 for x in a if x < 3200]
free=len([x for x in a if x >= 3200])
from collections import Counter
c=Counter(l)
print(max(len(c), 1), min(len(c) + free, 8))

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7

n = int(input())
a = list(map(int,input().split()))
d = [0] *8
p = 0
for i in a:
    if i>=1 and i<400:
        d[0] += 1
    elif i >= 400 and i<800:
        d[1] +=1
    elif i >=800 and i<1200:
        d[2] += 1
    elif i>=1200 and i<1600:
        d[3] += 1
    elif i>=1600 and i<2000:
        d[4] += 1
    elif i>=2000 and i<2400:
        d[5] += 1
    elif i>=2400 and i<2800:
        d[6] += 1
    elif i>=2800 and i<3200:
        d[7] += 1
    else:
        p += 1
cnt = 0
for i in range(len(d)):
    if d[i]>0:
        cnt+=1
print(cnt,cnt+p)

Submission status: Wrong Answer

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

cset=set()
free=0
for a in alist:
  if a>=3200:
    free+=1
  else:
    cset.add(a//400)
#print(cdic)

if free==0:
  print(len(cset),len(cset))
else:
  occupy=len(cset)
  vacant=8-len(cset)
  print(occupy,occupy+free)

Submission status: Wrong Answer

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

cset=set()
free=0
for a in alist:
  if a>=3200:
    free+=1
  else:
    cset.add(a//400)
#print(cdic)

if free==0:
  print(len(cset),len(cset))
else:
  occupy=len(cset)
  vacant=8-len(cset)
  print(occupy,min(8,occupy+free))

Submission status: Wrong Answer

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

cdic=defaultdict(int)
for a in alist:
  if a>=3200:
    a=3200
  cdic[a//400]+=1
#print(cdic)

if not 8 in cdic:
  print(len(cdic),len(cdic))
else:
  free=cdic[8]
  vacant=0
  for i in range(8):
    if not i in cdic:
      vacant+=1
  #print(free,vacant)
  print(8-vacant,8-vacant+min(vacant,free))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
free=[i for i in a if i>=3200]
rate=[399,799,1199,1599,1999,2399,2799,3199]
ans=0
before=0
for r in rate:
    for i in a:
        if before<i <=r:
            ans+=1
            before=r
            break

print(ans,ans+len(free))

Submission status: Wrong Answer

Solution code:
import itertools
import sys
n=int(input())
a=list(map(int,input().split()))
free=[i for i in a if i>=3200]
rate=[399,799,1199,1599,1999,2399,2799,3199]
ans=0
before=0
for r in rate:
    for i in a:
        if before<i <=r:
            ans+=1
            before=r
            break

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0, 0, 0, 0, 0, 0, 0, 0, 0]

a.sort()

for i in range(N):
  if 1 <= a[i] and a[i] < 400:
    color[0] = 1
    
  if 400 <= a[i] and a[i] < 800:
    color[1] = 1
    
  if 800 <= a[i] and a[i] < 1200:
    color[2] = 1
    
  if 1200 <= a[i] and a[i] < 1599:
    color[3] = 1
    
  if 1600 <= a[i] and a[i] < 1999:
    color[4] = 1
    
  if 2000 <= a[i] and a[i] < 2400:
    color[5] = 1
    
  if 2400 <= a[i] and a[i] < 2800:
    color[6] = 1
   
  if 2800 <= a[i] and a[i] < 3200:
    color[7] = 1 
  
  if 3200 <= a[i]:
    color[8] += 1 
  
print(str(max(color[8], sum(color) - color[8])) + ' ' +str(min(8, sum(color))))

Submission status: Wrong Answer

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

from collections import Counter


def main():
    N = int(readline())
    A = list(map(lambda x: int(x) // 400, readline().split()))
    B = [b for b in A if b > 7]
    A = set([a for a in A if a <= 7])
    n_min = max(len(A), 1)
    n_max = n_min + len(B)
    print(n_min, n_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

from collections import Counter


def main():
    N = int(readline())
    A = list(map(lambda x: int(x) // 400, readline().split()))
    B = [b for b in A if b > 7]
    A = set([a for a in A if a <= 7])
    n_min = len(A)
    n_max = n_min + len(B)
    print(n_min, n_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

MX = 8
R = [0] * 9

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

cnt = 0
el = R[8]
print(max(cnt,1),cnt+el)

Submission status: Wrong Answer

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

MX = 8
R = [0] * 9

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

cnt = 0
el = R[8]
for i in range(8):
  if R[i]:
    cnt += 1

sml = cnt
if cnt == 0 and 0 < el:
  sml += 1
  
bg = min(cnt+el,8)
    
print(sml,bg)

Submission status: Wrong Answer

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

MX = 8
R = [0] * 9

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

cnt = 0
el = R[8]
for i in range(8):
  if 0 < R[i]:
    cnt += 1

print(max(cnt,1),min(cnt+el,MX))

Submission status: Wrong Answer

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

MX = 8
R = [0] * 9

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

cnt = 0
el = R[8]
for i in range(8):
  if R[i]:
    cnt += 1

print(max(cnt,1),min(cnt+el,MX))

Submission status: Wrong Answer

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

MX = 8
R = [0] * 9

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

cnt = 0
el = R[8]
for i in range(8):
  if R[i]:
    cnt += 1

print(cnt,min(cnt+el,MX))

Submission status: Wrong Answer

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
## libs ##
from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left
#======================================================#
def color(r):
    if 1 <= r < 400:
        return 'gray'
    elif r < 800:
        return 'brown'
    elif r < 1200:
        return 'green'
    elif r < 1600:
        return 'lightblue'
    elif r < 2000:
        return 'blue'
    elif r < 2400:
        return 'yellow'
    elif r < 2800:
        return 'orange'
    elif r < 3200:
        return 'red'

def main():
    n = II()
    aa = MII()
    aa_u = [a for a in aa if a < 3200]
    aa_o = [a for a in aa if a >= 3200]
    u_type_num = len(set(map(color, aa_u)))
    o_type_num = len(aa_o)
    print('{} {}'.format(u_type_num, u_type_num+o_type_num))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
## libs ##
from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left
#======================================================#
def color(r):
    if 1 <= r < 400:
        return 'gray'
    elif r < 800:
        return 'green'
    elif r < 1600:
        return 'lightblue'
    elif r < 2000:
        return 'blue'
    elif r < 2400:
        return 'yellow'
    elif r < 2800:
        return 'orange'
    elif r < 3200:
        return 'red'

def main():
    n = II()
    aa = MII()
    aa_u = [a for a in aa if a < 3200]
    aa_o = [a for a in aa if a >= 3200]
    u_type_num = len(set(map(color, aa_u)))
    o_type_num = len(aa_o)
    print('{} {}'.format(u_type_num, u_type_num+o_type_num))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
## libs ##
from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left
#======================================================#
def color(r):
    if 1 <= r < 400:
        return 'gray'
    elif r < 800:
        return 'green'
    elif r < 1600:
        return 'lightblue'
    elif r < 2000:
        return 'blue'
    elif r < 2400:
        return 'yellow'
    elif r < 2800:
        return 'orange'
    elif r < 3200:
        return 'red'

def main():
    n = II()
    aa = MII()
    aa_u = [a for a in aa if a < 3200]
    aa_o = [a for a in aa if a >= 3200]
    u_type_num = len(set(map(color, aa_u)))
    o_type_num = len(aa_o)
    print('{} {}'.format(u_type_num, min(8,u_type_num+o_type_num)))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    input()
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
    t = list(map(int, input().split()))
    ret = {399: 0, 799: 0, 1199: 0, 1599: 0, 1999: 0, 2399: 0, 2799: 0, 3199: 0, 4800: 0}
    for v in t:
        for r in rate:
            if v <= r:
                ret[r] += 1
                break
    count = 0
    for k in ret:
        if ret[k] >= 1 and k != 4800:
            count += 1
    if count == 0:
        print(count + ret[4800], count + ret[4800])
    else:
        print(count, count + ret[4800])
    # print(ret)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def main():
    input()
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
    t = list(map(int, input().split()))
    ret = {399: 0, 799: 0, 1199: 0, 1599: 0, 1999: 0, 2399: 0, 2799: 0, 3199: 0, 4800: 0}
    for v in t:
        for r in rate:
            if v <= r:
                ret[r] += 1
                break
    count = 0
    for k in ret:
        if ret[k] >= 1 and k != 4800:
            count += 1
    print(count, count + ret[4800])
    # print(ret)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    input()
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 3200]
    t = list(map(int, input().split()))
    ret = {399: 0, 799: 0, 1199: 0, 1599: 0, 1999: 0, 2399: 0, 2799: 0, 3199: 0, 3200: 0}
    for v in t:
        for r in rate:
            if v <= r:
                ret[r] += 1
                break
    count = 0
    for k in ret:
        if ret[k] >= 1 and k != 3200:
            count += 1
    print(count, count + ret[3200])
    # print(ret)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for i in a:
    colors[min(i//400, 8)] += 1

mi = 0
for i in range(9):
    if colors[i]>0:
        mi += 1
if mi==0:
    mi = 1
    ma = min(colors[-1], 8)
else:
    ma = min(mi+colors[-1], 8)
print(mi, ma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for i in a:
    colors[min(i//400, 8)] += 1

mi = 0
for i in range(8):
    if colors[i]>0:
        mi += 1
if mi==0:
    mi = 1
    ma = min(colors[-1], 8)
else:
    ma = min(mi+colors[-1], 8)
print(mi, ma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for i in a:
    colors[min(i//400, 8)] += 1

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

print(mi, min(mi+colors[-1], 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
v = 0
for i in range(n):
    if a[i] < 3200:
        b.append(int(a[i]/400))
    else:
        v += 1
c = set(b)
mi = max(1,len(c))
ma = min(8,len(c)+v)
print(mi,ma)