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=list(map(int,input().split()))
cnt=[0]*9
for i in a:
  i=min(i,3200)
  cnt[i//400]+=1
m=len(cnt)-cnt.count(0)-min(cnt[-1],1)
M=len(cnt)-cnt.count(0)+max(0,cnt[-1]-1)
print(m,M)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
colors = [False]*8
rainbow = 0
for i in range(N):
    if 1<=a[i]<=399:
        colors[0] = True
    elif 400<=a[i]<=799:
        colors[1] = True
    elif 800<=a[i]<=1199:
        colors[2] = True
    elif 1200<=a[i]<=1599:
        colors[3] = True
    elif 1600<=a[i]<=1999:
        colors[4] = True
    elif 2000<=a[i]<=2399:
        colors[5] = True
    elif 2400<=a[i]<=2799:
        colors[6] = True
    elif 2800<=a[i]<=3199:
        colors[7] = True
    else:
        rainbow += 1
if rainbow == 0:
    ans = colors.count(True)
    print(ans,ans)
else:
    tmp = colors.count(True)
    if tmp==0:# all rainbow
        min_ = 1
        if rainbow > 8:
            max_ = 8
        else:
            max_ = rainbow
        print(min_,max_)
    else:# rainbow exist
        min_ = colors.count(True)
        max_ = colors.count(True) + rainbow
        if max_ > 8:
            max_ = 8
        print(min_,max_)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
colors = [False]*8
rainbow = 0
for i in range(N):
    if 1<=a[i]<=399:
        colors[0] = True
    elif 400<=a[i]<=799:
        colors[1] = True
    elif 800<=a[i]<=1199:
        colors[2] = True
    elif 1200<=a[i]<=1599:
        colors[3] = True
    elif 1600<=a[i]<=1999:
        colors[4] = True
    elif 2000<=a[i]<=2399:
        colors[5] = True
    elif 2400<=a[i]<=2799:
        colors[6] = True
    elif 2800<=a[i]<=3199:
        colors[7] = True
    else:
        rainbow += 1
if rainbow == 0:
    ans = colors.count(True)
    print(ans,ans)
else:
    min_ = colors.count(True)
    max_ = colors.count(True) + rainbow
    if max_>8:
        print(min_,8)
    else:
        print(min_,max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
R = [0 for i in range(9)]
for i in range(n):
    if A[i] < 3200: R[A[i]//400] += 1
    else: R[8] += 1
mi = 0
for i in range(8):
    if R[i] > 0: mi += 1
if mi == 0 and R[8] > 0:
    print(mi+1, min(8, mi+R[8]))
else:
    print(mi, min(8, mi+R[8]))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = [int(x) for x in input().split()]
colored = [False] * 8
cnt = 0
super= 0
for a in A:
    if 3200 <= a:
        super += 1
        continue
    rank = a // 400
    if not colored[rank]:
        colored[rank] = True
        cnt += 1
mn = 1 if cnt == 0 and super != 0 else cnt
mx = min(8, cnt + super)
print(mn, mx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = [0] * 8
tmp = 0
for i in range(n):
  if a[i] < 400:
    color[0] = 1
  elif a[i] < 800:
    color[1] = 1
  elif a[i] < 1200:
    color[2] = 1
  elif a[i] < 1600:
    color[3] = 1
  elif a[i] < 2000:
    color[4] = 1
  elif a[i] < 2400:
    color[5] = 1
  elif a[i] < 2800:
    color[6] = 1
  elif a[i] < 3200:
    color[7] = 1
  else:
    tmp = tmp + 1
min_color = color.count(1)
addition = min(tmp, color.count(0))
print("{} {}".format(min_color, min_color + addition))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=input().split()
b=[int(c) for c in a]
list1=[0]*8
number=0
for d in b:
    if 1<=d and 399>=d:
        list1[0]+=1
    elif 400<=d and d<=799:
        list1[1]+=1
    elif 800<=d and d<=1199:
        list1[2]+=1
    elif 1200<=d and d<=1599:
        list1[3]+=1
    elif 1600<=d and d<=1999:
        list1[4]+=1
    elif 2000<=d and d<=2399:
        list1[5]+=1
    elif 2400<=d and d<=2799:
        list1[6]+=1
    elif 2800<=d and d<=3199:
        list1[7]+=1
    else:
        number+=1
while 0 in list1:
    list1.remove(0)
if number>0:
    print(str(len(list1)) + ' ' + str(len(list1)+number))

else:
    print(str(len(list1))+' '+str(len(list1)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=input().split()
b=[int(c) for c in a]
list1=[0]*8
number=0
for d in b:
    if 1<=d and 399>=d:
        list1[0]+=1
    elif 400<=d and d<=799:
        list1[1]+=1
    elif 800<=d and d<=1199:
        list1[2]+=1
    elif 1200<=d and d<=1599:
        list1[3]+=1
    elif 1600<=d and d<=1999:
        list1[4]+=1
    elif 2000<=d and d<=2399:
        list1[5]+=1
    elif 2400<=d and d<=2799:
        list1[6]+=1
    elif 2800<=d and d<=3199:
        list1[7]+=1
    else:
        number+=1
while 0 in list1:
    list1.remove(0)
if number>0:
    if number>=len(list1):
        print(str(number) + ' ' + str(len(list1)+number))

    else:
        print(str(len(list1)) + ' ' + str(len(list1)+number))

else:
    print(str(len(list1))+' '+str(len(list1)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=input().split()
b=[int(c) for c in a]
list1=[0]*8
number=0
for d in b:
    if 1<=d and 399>=d:
        list1[0]+=1
    elif 400<=d and d<=799:
        list1[1]+=1
    elif 800<=d and d<=1199:
        list1[2]+=1
    elif 1200<=d and d<=1599:
        list1[3]+=1
    elif 1600<=d and d<=1999:
        list1[4]+=1
    elif 2000<=d and d<=2399:
        list1[5]+=1
    elif 2400<=d and d<=2799:
        list1[6]+=1
    elif 2800<=d and d<=3199:
        list1[7]+=1
    else:
        number+=1
while 0 in list1:
    list1.remove(0)
if len(list1)==8:
    print('8 8')
else:
    if number>0:
        if number>=len(list1):
            if len(list1) + number >= 8:
                print(str(number) + ' ' + str(len(list1)+number))
            else:
                print(str(number) + ' ' + str(len(list1) + number))
        else:
            if len(list1) + number >= 8:
                print(str(len(list1)) + ' ' + str(len(list1)+number))
            else:
                print(str(len(list1)) + ' ' + str(len(list1) + number))
    else:
        print(str(len(list1))+' '+str(len(list1)))

Submission status: Wrong Answer

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

dic = [False]*8

cnt = 0

for i in range(n):
  tmp = A[i] // 400
  if(tmp >= 8):
    cnt += 1
  else:
    dic[tmp] = True
  
print(str(sum(dic)) + ' ' + str(sum(dic) + cnt))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = [0] * 8
tmp = 0
for i in range(n):
  if a[i] < 400:
    color[0] = 1
  elif a[i] < 800:
    color[1] = 1
  elif a[i] < 1200:
    color[2] = 1
  elif a[i] < 1600:
    color[3] = 1
  elif a[i] < 2000:
    color[4] = 1
  elif a[i] < 2400:
    color[5] = 1
  elif a[i] < 2800:
    color[6] = 1
  elif a[i] < 3200:
    color[7] = 1
  else:
    tmp = tmp + 1
min_color = color.count(1)
if tmp >= 1:
  while int(0) in color and tmp != 0:
    color.remove(0)
    color.append(1)
    tmp = tmp - 1
  print("{} {}".format(min_color, color.count(1)))
else:
  print("{} {}".format(min_color, color.count(1)))

Submission status: Wrong Answer

Solution code:
#64C

n = int(input())
a = list(map(int,input().split()))
color = [0] * 8
wc = 0

for i in range(n):
    for j in range(8):
        if a[i] >= j*400 and a[i] <= (j+1)*400 - 1:
            color[j] = 1
    if a[i] >= 3200:
        wc += 1
            
mi = sum(color)
ma = mi + wc

print(max(mi,1) , min(ma,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for i in range(n):
  if a[i] < 400:
    color[0] = 1
  elif a[i] < 800:
    color[1] = 1
  elif a[i] < 1200:
    color[2] = 1
  elif a[i] < 1600:
    color[3] = 1
  elif a[i] < 2000:
    color[4] = 1
  elif a[i] < 2400:
    color[5] = 1
  elif a[i] < 2800:
    color[6] = 1
  elif a[i] < 3200:
    color[7] = 1
  else:
    color[8] = color[8] + 1
color[8] = color[8] + 2
min_color = color.count(1)
color[8] = color[8] - 2
if color[8] >= 1:
  while int(0) in color and color[8] != 0:
    color.remove(0)
    color.insert(0,1)
    color[8]  = color[8] - 1
  color.pop(-1)
  print("{} {}".format(min_color, color.count(1)))
else:
  color.pop(-1)
  print("{} {}".format(min_color, color.count(1)))

Submission status: Wrong Answer

Solution code:
#64C

n = int(input())
a = list(map(int,input().split()))
color = [0] * 8
wc = 0

for i in range(n):
    for j in range(8):
        if a[i] >= j*400 and a[i] <= (j+1)*400 - 1:
            color[j] = 1
    if a[i] >= 3200:
        wc += 1
            
mi = sum(color)
ma = mi + wc
if mi == 0:
    mi = 1

print("{} {}".format(mi, min(ma,8)))

Submission status: Wrong Answer

Solution code:
#64C

n = int(input())
a = list(map(int,input().split()))
color = [0] * 8
wc = 0

for i in range(n):
    for j in range(8):
        if a[i] >= j*400 and a[i] <= (j+1)*400 - 1:
            color[j] = 1
    if a[i] >= 3200:
        wc += 1
            
mi = sum(color)
ma = mi + wc
if mi == 0 and wc != 0:
    mi = 1

print("{} {}".format(mi, min(ma,8)))

Submission status: Wrong Answer

Solution code:
#64C

n = int(input())
a = list(map(int,input().split()))
color = [0] * 8
wc = 0

for i in range(n):
    for j in range(8):
        if a[i] >= j*400 and a[i] <= (j+1)*400 - 1:
            color[j] = 1
    if a[i] >= 3200:
        wc += 1
            
mi = sum(color)
ma = mi + wc
if mi == 0 and wc != 0:
    mi = 1
    ma -= 1

print("{} {}".format(mi, min(ma,8)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
a=input().split()
b=[int(c) for c in a]
list1=[0]*8
number=0
for d in b:
    if 1<=d and 399>=d:
        list1[0]+=1
    elif 400<=d and d<=799:
        list1[1]+=1
    elif 800<=d and d<=1199:
        list1[2]+=1
    elif 1200<=d and d<=1599:
        list1[3]+=1
    elif 1600<=d and d<=1999:
        list1[4]+=1
    elif 2000<=d and d<=2399:
        list1[5]+=1
    elif 2400<=d and d<=2799:
        list1[6]+=1
    elif 2800<=d and d<=3199:
        list1[7]+=1
    else:
        number+=1
while 0 in list1:
    list1.remove(0)
if len(list1)==8:
    print('8 8')
else:
    if number>0:
        if number>=len(list1):
            if len(list1) + number >= 8:
                print(str(number) + ' ' + str(8))
            else:
                print(str(number) + ' ' + str(len(list1) + number))
        else:
            if len(list1) + number >= 8:
                print(str(len(list1)) + ' ' + str(8))
            else:
                print(str(len(list1)) + ' ' + str(len(list1) + number))
    else:
        print(str(len(list1))+' '+str(len(list1)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=input().split()
b=[int(c) for c in a]
list1=[0]*8
number=0
for d in b:
    if 1<=d and 399>=d:
        list1[0]+=1
    elif 400<=d and d<=799:
        list1[1]+=1
    elif 800<=d and d<=1199:
        list1[2]+=1
    elif 1200<=d and d<=1599:
        list1[3]+=1
    elif 1600<=d and d<=1999:
        list1[4]+=1
    elif 2000<=d and d<=2399:
        list1[5]+=1
    elif 2400<=d and d<=2799:
        list1[6]+=1
    elif 2800<=d and d<=3199:
        list1[7]+=1
    else:
        number+=1
while 0 in list1:
    list1.remove(0)
if len(list1)==8:
    print('8 8')
else:
    if number>0:
        if len(list1)+number>=8:
            print(str(len(list1))+' '+str(8))
        else:
            print(str(len(list1))+' '+str(len(list1)+number))
    else:
        print(str(len(list1))+' '+str(len(list1)))

Submission status: Wrong Answer

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

color = set()
over = 0
for a in A :
    if a < 3200 :
        color.add(a//400)
    else :
        over += 1

print(max(over,len(color)), len(color)+over)

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    n = int(input())
    a = sorted(map(int, input().split()))

    import bisect
    rate = [1,400,800,1200,1600,2000,2400,2800,3200]
    idx = [0]*9
    cnt = [0]*9
    idx[0] = bisect.bisect_left(a,rate[0])
    for i in range(1,9):
        idx[i] = bisect.bisect_left(a,rate[i])
    for i in range(9):
        if i == 8:
            cnt[i] = len(a) - idx[i]
        else:
            cnt[i] = idx[i+1] - idx[i]
    mina = sum([1 for i in range(8) if cnt[i] > 0])
    maxa = mina + cnt[8]
    print(mina,maxa)
       
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    n = int(input())
    a = sorted(map(int, input().split()))

    import bisect
    rate = [1,400,800,1200,1600,2000,2400,2800,3200]
    idx = [0]*9
    cnt = [0]*9
    cnt[0] = idx[0] = bisect.bisect_right(a,rate[0])
    for i in range(1,9):
        idx[i] = bisect.bisect_right(a,rate[i])
        cnt[i] = idx[i] - idx[i-1]
    mina = sum([1 for i in range(8) if cnt[i] > 0])
    maxa = mina + cnt[8]
    print(mina,maxa)
       
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

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

rate = sum([cs[i] != 0 for i in range(0,8)])

print("{} {}".format(max(rate,1),min(8,rate+cs[8])))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

rate = sum([cs[i] != 0 for i in range(0,8)])

print("{} {}".format(rate,min(8,rate+cs[8])))

Submission status: Wrong Answer

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

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

def main():
    mod=10**9+7
    N=I()
    a=LI()
    L=[0]*8
    F=0
    for i in range(N):
        if a[i]>=3200:
            F+=1
            continue
        b=a[i]//400
        L[b]=1
        
    ans=sum(L)
    if min(a)>=3200:
        ans+=1
    print(ans,ans+F)
        

main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i< 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma = x+y
print('{} {}'.format(mi, ma))

Submission status: Wrong Answer

Solution code:
def col(n):
  if 1<=n<400:
    return 1
  if 400<=n<800:
    return 2
  if 800<=n<1200:
    return 3
  if 1200<=n<1600:
    return 4
  if 1600<=n<2000:
    return 5
  if 2000<=n<2400:
    return 6
  if 2400<=n<2800:
    return 7
  if 2800<=n<3200:
    return 8
  if n>=3200:
    return 9

n=int(input())
l=list(map(int,input().split()))
list=[]
for i in l:
  list.append(col(i))
p=list.count(9)
if p==0:
  print(len(set(list)),len(set(list)))
else:
  print(len(set(list))-1,len(set(list))+p-1)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = []
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<=7:
        x.add(i)
    else:
        y+=1
mi = len(x)
ma = len(x)+y
print('{} {}'.format(mi, ma))

Submission status: Wrong Answer

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

cnt=0
q=set()
for num in a:
    if num>=8:
        cnt+=1
    else:
        q.add(num)
ans=len(q)
print(ans,ans+cnt)

Submission status: Wrong Answer

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

k=a.count(8)
if k==0:
    ans=k+len(set(a))
    print(ans,ans)            
else:
    ans=len(set(a))-1
    print(ans,ans+k)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(_) for _ in input().split()]
col = [0] * n
cnt = 0
for i in range(n):
    if a[i] >= 3200:
        col[i] = 8
        cnt += 1
    else:
        col[i] = a[i] // 400
ans_min = len(set(col))
ans_max = ans_min
if cnt > 0:
    ans_min -= 1
    ans_max = ans_min + cnt
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

n = int(input().rstrip())

score_list = [int(i) for i in input().rstrip().split()]

under3200 = set([int(i/400) for i in score_list if i < 3200])
over3200 = [i for i in score_list if i >= 3200]

minColor = max(0, len(under3200))
maxColor = len(under3200) + len(over3200)

print("{} {}".format(minColor, maxColor))

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
a = [min(x//400, 8) for x in map(int, input().split())]
a = Counter(a)

if len(a) == 1 and a[8] != 0:
    min_a = 1
    max_a = a[8]
elif a[8] != 0:
    min_a = len(a)-1
    max_a = min([min_a+a[8], 8])
else:
    min_a = max_a = len(a)
print(min_a, max_a)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
a = [min(x//400, 8) for x in map(int, input().split())]
a = Counter(a)

if a[8] != 0:
    min_a = max([len(a)-1, 1])
else:
    min_a = len(a)

max_a = min([min_a+a[8], 8])
print(min_a, max_a)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
a = [min(x//400, 8) for x in map(int, input().split())]
a = Counter(a)
#max:8 , over 8
if a[8] != 0:
    min_a = len(a)-1
else:
    min_a = len(a)

max_a = min([min_a+a[8], 8])
print(min_a, max_a)

Submission status: Wrong Answer

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

l = [0]*9
cam = 0
for d in data:
    num = d//400 if d//400 < 8 else 8
    if num==8: cam += 1
    if l[num] == 0: l[num] = 1

score = sum(l[:8])
print(max(1,score), min(8, score+cam))

Submission status: Wrong Answer

Solution code:
N = int(input())
X = list(map(int, input().split()))
X = [x//400 for x in X]
min_X = len(set([x for x in X if x < 8]))
max_X = min_X + len([x for x in X if x >= 8])
print(min_X, max_X)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
mi=0
ma=0
l=[]
count=0
for i in range(N):
 if a[i]<3200:
  l.append(a[i]//400)
 else:
  count=count+1

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

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
mi=0
ma=0
l=[]
count=0
for i in range(N):
 if a[i]<3200:
  l.append(a[i]//400)
 else:
  count=count+1

print(len(set(l))+min(1,count),len(set(l))+max(0,count))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
mi=0
ma=0
l=[]
count=0
for i in range(N):
 if a[i]<2800:
  l.append(a[i]//400)
 else:
  count=count+1

print(len(set(l))+min(1,count),len(set(l))+max(0,count))

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
ex = 0

for i in range(n):
    if a[i] <= 399:
        gray = 1
    elif a[i] <= 799:
        brown = 1
    elif a[i] <= 1199:
        green = 1
    elif a[i] <= 1599:
        light_blue = 1
    elif a[i] <= 1999:
        blue = 1
    elif a[i] <= 2399:
        yellow = 1
    elif a[i] <= 2799:
        orange = 1
    elif a[i] <= 3199:
        red = 1
    else:
        ex += 1

min_color = gray + brown + green + light_blue + blue + yellow + orange + red
max_color = min_color + ex
print('{}'.format(min_color) +' {}'.format(max_color))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
set_a = set()
cnt = 0 

for i in range(N):
    set_a.add(a[i]//400)
    if(a[i] >= 3200):
        cnt += 1
        
if(cnt == N):    
    print(len(set_a), end=" ")
    print(cnt)
    quit()
elif(cnt > 0):    
    print(len(set_a)-1, end=" ")
    print(len(set_a)-1+cnt)
else:
    print(len(set_a), end=" ")
    print(len(set_a))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
set_a = set()
cnt = 0 
Flg = False

for i in range(N):
    set_a.add(a[i]//400)
    if(a[i] >= 3200):
        cnt += 1
        Flg = True
    
if Flg:
    print(len(set_a)-1, end=" ")
    print(len(set_a)-1+cnt)
else:
    print(len(set_a), end=" ")
    print(len(set_a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())
A = list(map(int, input().split()))
d = [0]*(3200+1)

for a in A:
    if a > 3200:
        a = 3200
    d[a] += 1

cnt = 0
for i in range(0, 3200, 400):
    if np.count_nonzero(d[i:i+400]) > 0:
        cnt += 1
        
if d[3200] == 0:
    print(cnt, cnt)
else:
    if cnt == 0:
        print(1, min(d[3200], 8))
    else:
        print(cnt, min(cnt+d[3200], 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
top = 0
color = []
for i in range(N):
    if a[i] < 400:
        color.append(0)
    elif a[i] < 800:
        color.append(1)
    elif a[i] < 1200:
        color.append(2)
    elif a[i] < 1600:
        color.append(3)
    elif a[i] < 2000:
        color.append(4)
    elif a[i] < 2400:
        color.append(5)
    elif a[i] < 2800:
        color.append(6)
    elif a[i] < 3200:
        color.append(7)
    else:
        top += 1

s = set(color)
print(len(s), len(s) + top)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
top = 0
color = []
for i in range(N):
    if a[i] < 400:
        color.append(0)
    elif a[i] < 800:
        color.append(1)
    elif a[i] < 1200:
        color.append(2)
    elif a[i] < 1600:
        color.append(3)
    elif a[i] < 2000:
        color.append(4)
    elif a[i] < 2400:
        color.append(5)
    elif a[i] < 2800:
        color.append(6)
    elif a[i] < 3200:
        color.append(7)
    else:
        top += 1

s = set(color)
print(len(s), min(8, len(s) + top))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt=0
l=[]
for i in a:
  p=i//400
  if p<=7:
    l.append(p)
  else:
    cnt+=1

d=len(set(l))
if d==0:
  d+=1
print(d,d+cnt)

Submission status: Wrong Answer

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

gray = 0
brown = 0
green = 0
lblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0

min_num = 0
max_num = 0

for i in a:
    if 1 <= i <= 399:
        gray += 1
    elif 400 <= i <= 799:
        brown += 1
    elif 800 <= i <= 1199:
        green += 1
    elif 1200 <= i <= 1599:
        lblue += 1
    elif 1600 <= i <= 1999:
        blue += 1
    elif 2000 <= i <= 2399:
        yellow += 1
    elif 2400 <= i <= 2799:
        orange += 1
    elif 2800 <= i <= 3199:
        red += 1
    elif i >= 3200:
        god += 1

for i in [gray, brown, green, lblue, blue, yellow, orange, red]:
    if i != 0:
        min_num += 1

max_num = min_num
if min_num <= 6 and god != 0:
    for i in range(god):
        max_num += 1
        if max_num >= 8:
            break

print(min_num, max_num)