Problem:


Score : 300 points

Problem Statement

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

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

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

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

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

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

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

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

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

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

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

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

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

Sample Input 3

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

Sample Output 3

1 1

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



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

Solution code:
N=int(input())
A=sorted(list(map(int,input().split())))
A=[i//400 for i in A]

Colors=[0,0,0,0,0,0,0,0,0]
for i in A:
    if i>=8:
        Colors[8]+=1
    else:
        Colors[i]+=1

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

print(Count,Count+Colors[-1])

Submission status: Wrong Answer

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


def solve(N: int, a: "List[int]"):
    color = set()
    rainbow_count = 0
    for i in range(N):
        if a[i]<=399:
            color.add("gray")
        elif a[i]<=799:
            color.add("brown")
        elif a[i]<=1199:
            color.add("green")        
        elif a[i]<=1599:
            color.add("lightblue")        
        elif a[i]<=1999:
            color.add("blue")        
        elif a[i]<=2399:
            color.add("yellow")
        elif a[i]<=2799:
            color.add("orange")        
        elif a[i]<=3199:
            color.add("red")
        else:
            rainbow_count+=1
    
    min_answer = len(color)
    max_answer = len(color) + min(8-len(color),rainbow_count)
    if not color and rainbow_count >0:
      min_answer=1
      max_answer=min(8,rainbow_count)
    print(min_answer,max_answer)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def solve(N: int, a: "List[int]"):
    color = set()
    rainbow_count = 0
    for i in range(N):
        if a[i]<=399:
            color.add("gray")
        elif a[i]<=799:
            color.add("brown")
        elif a[i]<=1199:
            color.add("green")        
        elif a[i]<=1599:
            color.add("lightblue")        
        elif a[i]<=1999:
            color.add("blue")        
        elif a[i]<=2399:
            color.add("yellow")
        elif a[i]<=2799:
            color.add("orange")        
        elif a[i]<=3199:
            color.add("red")
        else:
            rainbow_count+=1
    
    min_answer = len(color)
    max_answer = len(color) + min(8-len(color),rainbow_count)
    if not color and rainbow_count >0:
      min_answer=1
      max_answer=1
    print(min_answer,max_answer)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
colors=[]
for i in range(N):
    if a[i]<400:
        colors.append('gray')
    elif a[i]<800:
        colors.append('brown')
    elif a[i]<1200:
        colors.append('green')
    elif a[i]<1600:
        colors.append('mizu')
    elif a[i]<2000:
        colors.append('blue')
    elif a[i]<2400:
        colors.append('yelow')
    elif a[i]<2800:
        colors.append('orange')
    elif a[i]<3200:
        colors.append('red')
    else:
        colors.append('free')
kinds=list(set(colors))
if 'free' not in kinds:
    print(str(len(kinds))+' '+str(len(kinds)))
else:
    ans=len(kinds)-1
    bb=colors.count('free')
    if ans+bb>8:
        print(str(ans)+' '+str(8))
    else:
        print(str(ans)+' '+str(ans+bb))

Submission status: Wrong Answer

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


def solve(N: int, a: "List[int]"):
    color = set()
    rainbow_count = 0
    for i in range(N):
        if a[i]<=399:
            color.add("gray")
        elif a[i]<=799:
            color.add("brown")
        elif a[i]<=1199:
            color.add("green")        
        elif a[i]<=1599:
            color.add("lightblue")        
        elif a[i]<=1999:
            color.add("blue")        
        elif a[i]<=2399:
            color.add("yellow")
        elif a[i]<=2799:
            color.add("orange")        
        elif a[i]<=3199:
            color.add("red")
        else:
            rainbow_count+=1
    
    min_answer = len(color)
    max_answer = len(color) + min(8-len(color),rainbow_count)
    print(min_answer,max_answer)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N=int(input())
a=list(map(int,input().split()))
dd=defaultdict(int)
for ai in a:
    dd[ai//400]+=1
d=dict(dd)

if 8 not in dd:
    mi=ma=len(dd)
else:
    mi=max(len(dd)-1,1)
    ma=min(mi+dd[8],8)

print(mi,ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N=int(input())
a=list(map(int,input().split()))
dd=defaultdict(int)
for ai in a:
    dd[ai//400]+=1
d=dict(dd)

if 8 not in dd:
    mi=ma=len(dd)
else:
    mi=max(len(dd)-1,0)
    ma=min(mi+dd[8],8)

print(mi,ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N=int(input())
a=list(map(int,input().split()))
dd=defaultdict(int)
for ai in a:
    dd[ai//400]+=1
d=dict(dd)

if 8 not in dd:
    mi=ma=len(dd)
else:
    mi=len(dd)-1
    ma=min(mi+dd[8],8)

print(mi,ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

'''
def color(x):
    if x<400:
        return 'gray'
    elif x<800:
        return 'brown'
    elif x<1200:
        return 'green'
    elif x<1600:
        return 'light blue'
    elif x<2000:
        return 'blue'
    elif x<2400:
        return 'yellow'
    elif x<2800:
        return 'orange'
    elif x<3200:
        return 'red'
    else:
        return 'any'
'''

N=int(input())
a=list(map(int,input().split()))
dd=defaultdict(int)
for ai in a:
    dd[ai//400]+=1
d=dict(dd)

if 8 not in dd:
    mi=ma=len(dd)
else:
    mi=len(dd)-1
    ma=min(mi+dd[8],8)

print(mi,ma)

Submission status: Wrong Answer

Solution code:

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

def get_color(point):
    color = ''
    if 400 > point:
        color = 'grey'
    elif 800 > point:
        color = 'brown'
    elif 1200 > point:
        color = 'green'
    elif 1600 > point:
        color = 'light blue'
    elif 2000 > point:
        color = 'blue'
    elif 2400 > point:
        color = 'yellow'
    elif 2800 > point:
        color = 'orange'
    elif 3200 > point:
        color = 'red'
    else:
        color = 'free'
    return color
dict = {}
for i in range(N):
    color = get_color(a[i])
    if color not in dict.keys():
        dict[color] = 1
    else:
        dict[color] += 1

min_cnt = 0
max_cnt = 0
if 'free' not in dict.keys():
    min_cnt = max_cnt = len(dict.keys())
else:
    min_cnt = max(1, len(dict.keys())-1)
    max_cnt = min(8, len(dict.keys())-1 + dict['free'])

print(min_cnt, max_cnt)

Submission status: Wrong Answer

Solution code:

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

def get_color(point):
    color = ''
    if 400 > point:
        color = 'grey'
    elif 800 > point:
        color = 'brown'
    elif 1200 > point:
        color = 'green'
    elif 1600 > point:
        color = 'light blue'
    elif 2000 > point:
        color = 'blue'
    elif 2400 > point:
        color = 'yellow'
    elif 2800 > point:
        color = 'orange'
    elif 3200 > point:
        color = 'red'
    else:
        color = 'free'
    return color
dict = {}
for i in range(N):
    color = get_color(a[i])
    if color not in dict.keys():
        dict[color] = 1
    else:
        dict[color] += 1

min_cnt = 0
max_cnt = 0
if 'free' not in dict.keys():
    min_cnt = max_cnt = len(dict.keys())
else:
    min_cnt = len(dict.keys())-1
    max_cnt = min(8, min_cnt + dict['free'])

print(min_cnt, max_cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
color = set()
free = 0
for i in range(n):
    if a[i] < 3200:
        color.add(a[i]//400)
    else:
        free += 1
print(color)
print("{} {}".format(max(1, len(color)), free + len(color)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
color = set()
free = 0
for i in range(n):
    if a[i] < 3200:
        color.add(a[i]//400)
    else:
        free += 1
print("{} {}".format(max(1, len(color)), min(8,free + len(color))))

Submission status: Wrong Answer

Solution code:
import bisect
n = int(input())
a = list(map(int, input().split()))
a.sort()
color = 0
pre_rate = 0
#3200以上の人のカウント
free = 0

for i in range(1,9):
    #400刻みで考えていき、さっきの同じところに挿入されるかどうか確認
    if bisect.bisect_left(a, 400 * i) != pre_rate:
        #挿入されないということは、間に人がいるということなので、一色足す。
        color += 1
        #前のレートの添え字の更新
        pre_rate = bisect.bisect_left(a, 400 * i)
#3200以上の人は何人いるか数える
free = n - bisect.bisect_left(a,3200)
#出力。最小値は1を下回らず、最大値は⒏を超えないようにする。
#freeの人は色が被らないのが最大なため、足せるだけ足した後に⒏と比較
print("{} {}".format(max(1, color), min(8,free + color)))

Submission status: Wrong Answer

Solution code:
import bisect
n = int(input())
a = list(map(int, input().split()))
a.sort()
color = 0
pre_rate = 0
free = 0
for i in range(1,9):
    if bisect.bisect_left(a, 400 * i) != pre_rate:
        color += 1
        pre_rate = bisect.bisect_left(a, 400 * i)
free = n - bisect.bisect_left(a,3200)
print("{} {}".format(max(1, color), min(8,free + color)))

Submission status: Wrong Answer

Solution code:
import bisect
n = int(input())
a = list(map(int, input().split()))
a.sort()
color = 0
pre_rate = n + 1
free = 0
for i in range(1,9):
    if bisect.bisect_left(a, 400 * i) != pre_rate:
        color += 1
        pre_rate = bisect.bisect_left(a, 400 * i)
free = n - bisect.bisect_left(a,3200)
print("{} {}".format(max(1, color), min(8,free + color)))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
c=[0]*8 
ind=0 
for i in l:
    if 1<=i<=399:
        c[0]+=1 
    if 400<=i<=799:
        c[1]+=1 
    if 800<=i<=1199:
        c[2]+=1 
    if 1200<=i<=1599:
        c[3]+=1 
    if 1600<=i<=1999:
        c[4]+=1 
    if 2000<=i<=2399:
        c[5]+=1 
    if 2400<=i<=2799:
        c[6]+=1 
    if 2800<=i<=3199:
        c[7]+=1 
    if i>=3200:
        ind+=1 
s=sum(i>0 for i in c)
#+=ind 
print(s,s+ind)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
c=[0]*8 
ind=0 
for i in l:
    if 1<=i<=399:
        c[0]+=1 
    if 400<=i<=799:
        c[1]+=1 
    if 800<=i<=1199:
        c[2]+=1 
    if 1200<=i<=1599:
        c[3]+=1 
    if 1600<=i<=1999:
        c[4]+=1 
    if 2000<=i<=2399:
        c[5]+=1 
    if 2400<=i<=2799:
        c[6]+=1 
    if 2800<=i<=3199:
        c[7]+=1 
    if i>=3200:
        ind+=1 
s=sum(i>0 for i in c)
#+=ind 
print(s,min(s+ind,n))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
c=[0]*8 
ind=0 
for i in l:
    if 1<=i<=399:
        c[0]+=1 
    if 400<=i<=799:
        c[1]+=1 
    if 800<=i<=1199:
        c[2]+=1 
    if 1200<=i<=1599:
        c[3]+=1 
    if 1600<=i<=1999:
        c[4]+=1 
    if 2000<=i<=2399:
        c[5]+=1 
    if 2400<=i<=2799:
        c[6]+=1 
    if 2800<=i<=3199:
        c[7]+=1 
    if i>=3200:
        ind+=1 
s=sum(i>0 for i in c)
s+=ind 
print(s,min(s+ind,n))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
c=[0]*8 
ind=0 
for i in l:
    if 1<=i<=399:
        c[0]+=1 
    if 400<=i<=799:
        c[1]+=1 
    if 800<=i<=1199:
        c[2]+=1 
    if 1200<=i<=1599:
        c[3]+=1 
    if 1600<=i<=1999:
        c[4]+=1 
    if 2000<=i<=2399:
        c[5]+=1 
    if 2400<=i<=2799:
        c[6]+=1 
    if 2800<=i<=3199:
        c[7]+=1 
    if i>=3200:
        ind+=1 
s=sum(i for i in l)
s+=ind 
print(s,min(s+ind,n))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(list(map(int,input().split())))
G = {i:0 for i in range(9)}
for i in range(N):
    if A[i]<=399:
        G[0] += 1
    elif A[i]<=799:
        G[1] += 1
    elif A[i]<=1199:
        G[2] += 1
    elif A[i] <= 1599:
        G[3] += 1
    elif A[i] <= 1999:
        G[4] += 1
    elif A[i] <= 2399:
        G[5] += 1
    elif A[i] <= 2799:
        G[6] += 1
    elif A[i] <= 3199:
        G[7] += 1
    else:
        G[8] += 1
cnt = 0
for i in range(8):
    if G[i] > 0:
        cnt += 1
cmin = cnt
cmax = cmin+G[8]
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(list(map(int,input().split())))
G = {i:0 for i in range(9)}
for i in range(N):
    if A[i]<=399:
        G[0] += 1
    elif A[i]<=799:
        G[1] += 1
    elif A[i]<=1199:
        G[2] += 1
    elif A[i] <= 1599:
        G[3] += 1
    elif A[i] <= 1999:
        G[4] += 1
    elif A[i] <= 2399:
        G[5] += 1
    elif A[i] <= 2799:
        G[6] += 1
    elif A[i] <= 3199:
        G[7] += 1
    else:
        G[8] += 1
cnt = 0
for i in range(8):
    if G[i] > 0:
        cnt += 1
cmin = cnt
cmax = cmin+G[8]

Submission status: Wrong Answer

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

c = []
cnt = 0
for a in A:
    if a < 400:
        c.append(0)
    elif a < 800:
        c.append(1)
    elif a < 1200:
        c.append(2)
    elif a < 1600:
        c.append(3)
    elif a < 2000:
        c.append(4)
    elif a < 2400:
        c.append(5)
    elif a < 2800:
        c.append(6)
    elif a < 3200:
        c.append(7)
    else:
        cnt += 1
d = len(set(c))

print(d, d+cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
cnt=0
X=set()
for i in range(N):
  if(A[i]>=3200):
    cnt+=1
  else:
    X.add(A[i]//400)
print(len(X),len(X)+cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(N):
  if(A[i]>=3200):
    cnt+=1
print(N-cnt,N)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
red=0
kind=0
b=[]
for i in range(8):
    b.append([i,0])
for i in range(n):
    if a[i]<3200:
        b[a[i]//400][1]+=1
    else:
        red+=1
for i in range(8):
    if b[i][1]!=0:
        kind+=1
minc=1 if kind==0 else kind
maxc=kind+red if kind+red<=8 else 8
print(str(minc)+" "+str(maxc))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = [8 for _ in range(n)]
free = 0
for i in range(n):
    if a[i] > 3199:
        free += 1
    else:
        b[i] = a[i] // 400
if 8 in set(b):
    under = len(set(b)) - 1
else:
    under = len(set(b))
m = under
M = under + free
print(m, M)

Submission status: Wrong Answer

Solution code:
import os

n = int(input())
alist = [int(i) for i in input().split()]

set = set()
arfa = 0

for a in alist:
    if a<=399:
        set.add(1)
    elif a<=799:
        set.add(2)
    elif a<=1199:
        set.add(3)
    elif a<=1599:
        set.add(4)
    elif a<=1999:
        set.add(5)
    elif a<=2399:
        set.add(6)
    elif a<=2799:
        set.add(7)
    elif a<=3199:
        set.add(8)
    else:
        arfa += 1
max = len(set)+arfa

if len(set)==0:
    min = 1
else:
    min = len(set)

if max>8:
    max=8

print(min,end = " ")
print(max)

Submission status: Wrong Answer

Solution code:
import os

n = int(input())
alist = [int(i) for i in input().split()]

set = set()
arfa = 0

for a in alist:
    if a<=399:
        set.add(1)
    elif a<=799:
        set.add(2)
    elif a<=1199:
        set.add(3)
    elif a<=1599:
        set.add(4)
    elif a<=1999:
        set.add(5)
    elif a<=2399:
        set.add(6)
    elif a<=2799:
        set.add(7)
    elif a<=3199:
        set.add(8)
    else:
        arfa += 1
max = len(set)+arfa

if len(set)==0:
    min = 1
else:
    min = len(set)

if len(set)+arfa>8:
    print(min,end = " ")
    print(8)
else:
    print(len(set),end = " ")
    print(max)

Submission status: Wrong Answer

Solution code:
import os

n = int(input())
alist = [int(i) for i in input().split()]

set = set()
arfa = 0

for a in alist:
    if a<=399:
        set.add(1)
    elif a<=799:
        set.add(2)
    elif a<=1199:
        set.add(3)
    elif a<=1599:
        set.add(4)
    elif a<=1999:
        set.add(5)
    elif a<=2399:
        set.add(6)
    elif a<=2799:
        set.add(7)
    elif a<=3199:
        set.add(8)
    else:
        arfa += 1
max = len(set)+arfa

if len(set)==0:
    set.add(9)
if len(set)+arfa>8:
    print(len(set),end = " ")
    print(8)
else:
    print(len(set),end = " ")
    print(max)

Submission status: Wrong Answer

Solution code:
import os

n = int(input())
alist = [int(i) for i in input().split()]

set = set()
arfa = 0

for a in alist:
    if a<=399:
        set.add(1)
    elif a<=799:
        set.add(2)
    elif a<=1199:
        set.add(3)
    elif a<=1599:
        set.add(4)
    elif a<=1999:
        set.add(5)
    elif a<=2399:
        set.add(6)
    elif a<=2799:
        set.add(7)
    elif a<=3199:
        set.add(8)
    else:
        arfa += 1
max = len(set)+arfa

if len(set)+arfa>8:
    print(len(set),end = " ")
    print(8)
else:
    print(len(set),end = " ")
    print(max)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*10
ans = 0
aans = 0
for i in range(n):
    if l[i] >= 3200:
        aans += 1
    else:
        color[int(l[i]/400)] += 1
print(color)
for i in color:
    if i > 0:
        ans += 1
if aans == n:
    print(1,n)
else:
    print(ans,aans+ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*10
ans = 0
aans = 0
for i in range(n):
    if l[i] >= 3200:
        aans += 1
    else:
        color[int(l[i]/400)] += 1
for i in color:
    if i > 0:
        ans += 1
if aans == n:
    ans = 1
print(ans,aans+ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*10
ans = 0
aans = 0
for i in range(n):
    if l[i] >= 3200:
        aans += 1
    else:
        color[int(l[i]/400)] += 1
for i in color:
    if i > 0:
        ans += 1
print(ans,aans+ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*10
ans = 0
for i in range(n):
    if l[i] >= 3200:
        ans += 1
    else:
        color[int(l[i]/400)] += 1
for i in color:
    if i > 0:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard

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

n_gray_to_red = len(set([x//400 for x in a if x < 3200]))
n_3200_and_above = len([x for x in a if x >= 3200])

print(max(n_gray_to_red, 1), min(8, n_gray_to_red + n_3200_and_above))

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard

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

n_gray_to_red = len(set([x//400 for x in a if x < 3200]))
n_3200_and_above = len([x for x in a if x >= 3200])

print(n_gray_to_red + max(0, n_3200_and_above - n_gray_to_red), min(8, n_gray_to_red + n_3200_and_above))

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard

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

n_gray_to_red = len(set([x//400 for x in a if x < 3200]))
n_3200_and_above = len([x for x in a if x >= 3200])

print(n_gray_to_red, min(8, n_gray_to_red + n_3200_and_above))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)

def main():
    n = int(input().strip())
    v = list(map(int, input().strip().split()))
    t = 0
    kind = set()
    for e in v:
        if e // 400 >= 8:
            t += 1
        else:
            kind.add(e // 400)
    print(len(kind), len(kind) + t)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)

def main():
    n = int(input().strip())
    v = list(map(int, input().strip().split()))
    t = 0
    kind = set()
    for e in v:
        if e // 400 >= 8:
            t += 1
        else:
            kind.add(e // 400)
    print(len(kind), min(len(kind) + t, 8))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
r=[400,800,1200,1600,2000,2400,2800,3200]
b=[0]*8
c=0
for i in range(n):
    for j in range(8):
        if a[i]<r[j]:
            b[j]=1
            break
    if a[i]>=3200:    
        c+=1
print(max(1,sum(b)),min(8,c+sum(b)))

Submission status: Wrong Answer

Solution code:
# ABC064 C - Colorful Leaderboard
N = map(int,input().split())
A = list(map(int,input().split()))

C = set()
Tourist = 0

for a in A:
    if 1<=a<=399:
        C.add('Glay')
    elif 400<=a<=799:
        C.add('Brown')
    elif 800<=a<=1199:
        C.add('Green')
    elif 1200<=a<=1599:
        C.add('Water')
    elif 1600<=a<=1999:
        C.add('Blue')
    elif 2000<=a<=2399:
        C.add('Yellow')
    elif 2400<=a<=2799:
        C.add('Orange')
    elif 2800<=a<=3199:
        C.add('Red')
    elif 3200<=a:
        C.add('Tourist')
        Tourist += 1

min = len(C) - (1 if Tourist >= 1 else 0)
max = len(C) + (Tourist -1 if Tourist >= 1 else 0)

if Tourist == N:
    min = 1

print(min,max)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
l=[0]*9
for a in A:
    if a>=3200:
        l[8]+=1
    else:
        l[int(a//400)]=1

sl=sum(l)-l[8]
print(max(sl,0),min(sl+l[8],8))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
l=[0]*9
for a in A:
    if a>=3200:
        l[8]+=1
    else:
        l[int(a//400)]=1

sl=sum(l)-l[8]
print(max(sl,1),min(sl+l[8],8))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
l=[0]*8
for a in A:
    if a>=2800:
        l[7]+=1
    else:
        l[int(a//400)]=1

sl=sum(l)-l[7]
print(max(sl,l[7]),min(sl+l[7],8))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
l=[0]*8
for a in A:
    if a>=2800:
        l[7]+=1
    else:
        l[int(a//400)]=1

print(sum(l)-l[7]+min(1,l[7]),min(sum(l),8))

Submission status: Wrong Answer

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = list(map(int, input().split()))
    colors = [a // 400 for a in as_ if a <= 3199]
    free_num = len([a for a in as_ if a >= 3200])

    num_color = len(set(colors))
    print(num_color, num_color + free_num)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = list(map(int, input().split()))
    colors = [a // 400 for a in as_ if a <= 3199]
    free_num = len([a for a in as_ if a >= 3200])

    if free_num == 0:
        num_color = len(set(colors))
        print(num_color, num_color)
    else:
        num_color = len(set(colors))
        max_types = num_color + free_num
        print(num_color, max_types)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = [a // 400 for a in map(int, input().split())]
    over_8 = [color for color in as_ if color >= 8]
    free_num = len(over_8)
    if free_num == 0:
        num_color = len(set(as_))
        print(num_color, num_color)
    else:
        num_color = len(set(as_)) - len(set(over_8))
        max_types = num_color + free_num
        print(num_color, max_types)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = [a // 400 for a in map(int, input().split())]
    over_8 = [color for color in as_ if color >= 8]
    free_num = len(over_8)
    if free_num == 0:
        num_color = len(set(as_))
        print(num_color, num_color)
    else:
        num_color = len(set(as_)) - 1
        max_types = num_color + free_num
        print(num_color, max_types)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = [a // 400 for a in map(int, input().split())]    
    free_num = as_.count(8)
    if free_num == 0:
        num_color = len(set(as_))
        print(num_color, num_color)
    else:
        num_color = len(set(as_)) - 1
        max_types = num_color + free_num
        print(num_color, max_types)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    as_ = [a // 400 for a in map(int, input().split())]    
    free_num = as_.count(8)
    if free_num == 0:
        num_color = len(set(as_))
        print(num_color, num_color)
    else:
        num_color = len(set(as_)) - 1
        max_types = min(num_color + free_num, 8)
        print(num_color, max_types)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
col = [0] * 9
for i in A:
  r = i//400
  if r > 8:
    r = 8
  col[r] += 1

ans = 0
for i in col[:8]:
  if i > 0:
    ans += 1

print(ans, ans + col[-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
x=[False for _ in range(8)]
c=0
for i in a:
  if i<3200:
    x[i//400]=True
  else:
    c+=1
y=x.count(True)
print(max(1,y),min(8,y+c))

Submission status: Wrong Answer

Solution code:
n=int(input())
a_l=list(map(int,input().split()))
a,b,c,d,e,f,g,h=0,0,0,0,0,0,0,0
cnt=0
for i in a_l:
    if i<400*1:
        a+=1
    elif 400*1<=i<400*2:
        b+=1
    elif 400*2<=i<400*3:
        c+=1
    elif 400*3<=i<400*4:
        d+=1
    elif 400*4<=i<400*5:
        e+=1
    elif 400*5<=i<400*6:
        f+=1
    elif 400*6<=i<400*7:
        g+=1
    elif 400*7<=i<400*8:
        h+=1
    else:
        cnt+=1
ans=0
for i in [a,b,c,d,e,f,g,h]:
    if i!=0:
        ans+=1
print(ans, ans+cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
a =[]
a = input().split()
flag=[False for i in range(8)]
count = 0

while a:
    tmp = int(a.pop())
    if(tmp<400):
        flag[0] = True
    elif(tmp<800):
        flag[1] = True
    elif(tmp<1200):
        flag[2] = True
    elif(tmp<1600):
        flag[3] = True
    elif(tmp<2000):
        flag[4] = True
    elif(tmp<2400):
        flag[5] = True
    elif(tmp<2800):
        flag[6] = True
    elif(tmp<3200):
        flag[7] = True
    else:
        count += 1

if True in flag:
    print(flag.count(True), flag.count(True)+count)
else:
    print(count,count)

Submission status: Wrong Answer

Solution code:
N = int(input())
a =[]
a = input().split()
flag=[False for i in range(8)]
count = 0

while a:
    tmp = int(a.pop())
    if(tmp<400):
        flag[0] = True
    elif(tmp<800):
        flag[1] = True
    elif(tmp<1200):
        flag[2] = True
    elif(tmp<1600):
        flag[3] = True
    elif(tmp<2000):
        flag[4] = True
    elif(tmp<2400):
        flag[5] = True
    elif(tmp<2800):
        flag[6] = True
    elif(tmp<3200):
        flag[7] = True
    else:
        count += 1

if True in flag:
    print(flag.count(True), min([flag.count(True)+count,8]))
else:
    print(count,min([count,8]))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dd
N = int(input())
a = list(map(int, input().split()))
D = dd(int)
for i in a:
  if i >=3200:
    D[8] += 1
  else:
    D[i // 400] += 1
l = len(D.keys())
if D[8] > 0:
  print (l - 1, l + D[8] - 1)
else:
  print (l, l)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dd
N = int(input())
a = list(map(int, input().split()))
D = dd(int)
for i in a:
  if i >=3200:
    D[8] += 1
  else:
    D[i // 400] += 1
l = len(D.keys())
if D[8] > 0:
  print (l - 1, l + D[8] - 1)
else:
  print (l, l)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dd
N = int(input())
a = list(map(int, input().split()))
D = dd(int)
for i in a:
  D[i // 400] += 1
l = len(D.keys())
if D[8] > 0:
  print (l - 1, l + D[8] - 1)
else:
  print (l, l)

Submission status: Wrong Answer

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

b=0
for i in range(n):
  if a[i]//400>=8:
    b+=1
c=[s//400 for s in a if s<3200]
C=len(set(c))
print(C, C+b)