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())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)):
        if abs(i-lst[j]) < 400:
            lstc[j] += 1
            break

#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1



if lstc[-1] == 0:
    print(n,n)
#elif lstc[-1] + nx >= 8:
    #print(nx,8)
elif nx == 0:
    print(1,lstc[-1])
else:
    print(nx,nx+lstc[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)):
        if abs(i-lst[j]) < 400:
            lstc[j] += 1
            break

#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1



if lstc[-1] == 0:
    print(n,n)
#elif lstc[-1] + nx >= 8:
    #print(nx,8)
else:
    print(nx,nx+lstc[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9
#print(lst)
for i in rate:
    for j in range(len(lst)):
        if abs(i-lst[j]) < 400:
            lstc[j] += 1
            break
        # elif i > 3199:
        #     lstc[-1] += 1
        #     break
#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1

#print(lstc[-1] - nx)

if lstc[-1] == 0:
    print(n,n)
elif lstc[-1] + nx >= 8:
    print(nx,8)
else:
    print(nx,nx+lstc[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9
#print(lst)
for i in rate:
    for j in range(len(lst)):
        if abs(i-lst[j]) < 400:
            lstc[j] += 1
            break
        # elif i > 3199:
        #     lstc[-1] += 1
        #     break
#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1


if lstc[-1] == 0:
    print(n,n)
elif lstc[-1] - nx >= 8:
    print(nx,8)
else:
    print(nx,nx+lstc[-1])

Submission status: Wrong Answer

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

cnt = 0
color = [False] * 8
for v in a:
    if v >= 3200:
        cnt += 1
    else:
        color[v//400] = True

num = color.count(True)
print(num, num + cnt)

Submission status: Wrong Answer

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

cnt = 0
color = [False] * 8
for v in a:
    if v >= 3200:
        cnt += 1
    else:
        color[v//400] = True

num = color.count(True)
print(num, min(num + cnt, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = [0] * 8
p = 0

for i in range(n):
    if a[i] < 3200:
        t[a[i] // 400] = 1
    else:
        p += 1

x = t.count(1)
amax = min(8,p+x)
if x == 0:
    amin = 1
else:
    amin = x
print(amin,amax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
list = {}
list[8] = 0

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

min = len(list) - 1

if list[8] > 0:
    max = len(list) + list[8] - 1
else:
    max = len(list) - 1

print(min,max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
list = {}
chin = 0

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

min = len(list)

if chin > 0:
    max = len(list) + chin

else:
    max = len(list)

print(min,max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
list = {}
chin = 0

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

min = len(list)

if chin > 0:
    if len(list) + chin >= 8:
        max = 8
    else:
        max = len(list) + chin

else:
    max = len(list)

print(min,max)

Submission status: Wrong Answer

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

color = []
color2 = []

def rate(a):
    if a < 400:
        if 1 not in color:
            color.append(1)
    elif 400<= a and a<800:
        if 2 not in color:
            color.append(2)
    elif 800<=a and a<1200:
        if 3 not in color:
            color.append(3)
    elif 1200<=a and a<1600:
        if 4 not in color:
            color.append(4)
    elif 1600<=a and a<2000:
        if 5 not in color:
            color.append(5)
    elif 2000 <=a and a<2400:
        if 6 not in color:
            color.append(6)
    elif 2400 <=a and a<2800:
        if 7 not in color:
            color.append(7)
    elif 2800<=a and a<3200:
        if 8 not in color:
            color.append(8)
    elif a>= 3200:
        color2.append(a)

for i in range(N):
    rate(a[i])

max = len(color) + len(color2)

if max <= 8:
    if len(color) == 0:
        print(1,max)
    else:
        print(len(color),max)
else:
    if len(color) == 0:
        print(1,8)
    else:
        print(len(color),8)

Submission status: Wrong Answer

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

color = []
color2 = []

def rate(a):
    if a < 400:
        if 1 not in color:
            color.append(1)
    elif 400<= a and a<800:
        if 2 not in color:
            color.append(2)
    elif 800<=a and a<1200:
        if 3 not in color:
            color.append(3)
    elif 1200<=a and a<1600:
        if 4 not in color:
            color.append(4)
    elif 1600<=a and a<2000:
        if 5 not in color:
            color.append(5)
    elif 2000 <=a and a<2400:
        if 6 not in color:
            color.append(6)
    elif 2400 <=a and a<2800:
        if 7 not in color:
            color.append(7)
    elif 2800<=a and a<3200:
        if 8 not in color:
            color.append(8)
    elif a<= 3200:
        color2.append(a)

for i in range(N):
    rate(a[i])

max = len(color) + len(color2)

if max <= 8:
    if len(color) == 0:
        print(1,max)
    else:
        print(len(color),max)
else:
    if len(color) == 0:
        print(1,8)
    else:
        print(len(color),8)

Submission status: Wrong Answer

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

maxans = 0
minans = 0

color = [0]*8
red = 0

for i in s:
    if i>3199:
        red += 1
    else:
        color[i//400] = 1
        
x = sum(color)

print(x,x+red)

Submission status: Wrong Answer

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

maxans = 0
minans = 0

color = [0]*8
red = 0

for i in s:
    if i>3199:
        red += 1
    else:
        color[i//400] = 1
        
x = sum(color)

print(x+red,x)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = [0] * 9

for i in range(n):
    if a[i] < 3200:
        t[a[i] // 400] += 1
    else:
        t[8] += 1

z = t.pop(8)
p = t.count(0)
amax = min(8,8-p+z)
if p == 8:
    amin = 1
else:
    amin = 8 - p

print(amin,amax)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
while a:
  kazu=a.pop(0)
  if 1<=kazu < 400:
    b[0]=1
  elif kazu < 800:
    b[1]=1
  elif kazu < 1200:
    b[2]=1
  elif kazu < 1600:
    b[3]=1
  elif kazu < 2000:
    b[4]=1
  elif kazu < 2400:
    b[5]=1
  elif kazu < 2800:
    b[6]=1
  elif kazu < 3200:
    b[7]=1
  elif kazu >=3200:
    b[8]+=1
coma=b[8]
comi=0
for i in b[:8]:
  if i > 0:
    comi+=1
if coma > 0 and comi ==0:
  comi =1
print(comi,min(8,comi+coma))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
while a:
  kazu=a.pop(0)
  if kazu < 400:
    b[0]=1
  elif kazu < 800:
    b[1]=1
  elif kazu < 1200:
    b[2]=1
  elif kazu < 1600:
    b[3]=1
  elif kazu < 2000:
    b[4]=1
  elif kazu < 2400:
    b[5]=1
  elif kazu < 2800:
    b[6]=1
  elif kazu < 3200:
    b[7]=1
  else:
    b[8]+=1
coma=b[8]
comi=0
while b:
  if b.pop() > 0:
    comi+=1
if coma > 0 and comi > 1:
  comi-=1
if coma > 0 and comi ==0:
  comi =1
print(comi,min(8,comi+coma))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
while a:
  kazu=a.pop(0)
  if kazu < 400:
    b[0]=1
  elif kazu < 800:
    b[1]=1
  elif kazu < 1200:
    b[2]=1
  elif kazu < 1600:
    b[3]=1
  elif kazu < 2000:
    b[4]=1
  elif kazu < 2400:
    b[5]=1
  elif kazu < 2800:
    b[6]=1
  elif kazu < 3200:
    b[7]=1
  else:
    b[8]+=1
coma=b[8]
comi=0
while b:
  if b.pop() > 0:
    comi+=1
if coma > 0 and comi > 0:
  comi-=1
if coma > 0 and comi ==0:
  comi =1
print(comi,min(8,comi+coma))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
while a:
  kazu=a.pop(0)
  if kazu < 400:
    b[0]=1
  elif kazu < 800:
    b[1]=1
  elif kazu < 1200:
    b[2]=1
  elif kazu < 1600:
    b[3]=1
  elif kazu < 2000:
    b[4]=1
  elif kazu < 2400:
    b[5]=1
  elif kazu < 2800:
    b[6]=1
  elif kazu < 3200:
    b[7]=1
  else:
    b[8]+=1
coma=b[8]
comi=0
while b:
  if b.pop() > 0:
    comi+=1
if coma > 0 and comi > 0:
  comi-=1
if coma > comi:
  comi =coma
print(comi,min(8,comi+coma))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
while a:
  kazu=a.pop(0)
  if kazu < 400:
    b[0]=1
  elif kazu < 800:
    b[1]=1
  elif kazu < 1200:
    b[2]=1
  elif kazu < 1600:
    b[3]=1
  elif kazu < 2000:
    b[4]=1
  elif kazu < 2400:
    b[5]=1
  elif kazu < 2800:
    b[6]=1
  elif kazu < 3200:
    b[7]=1
  else:
    b[8]+=1
coma=b[8]
comi=0
while b:
  if b.pop() > 0:
    comi+=1
if coma > 0 and comi > 0:
  comi-=1
print(comi,min(8,comi+coma))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
while a:
  kazu=a.pop(0)
  if kazu < 400:
    b[0]+=1
  elif kazu < 800:
    b[1]+=1
  elif kazu < 1200:
    b[2]+=1
  elif kazu < 1600:
    b[3]+=1
  elif kazu < 2000:
    b[4]+=1
  elif kazu < 2400:
    b[5]+=1
  elif kazu < 2800:
    b[6]+=1
  elif kazu < 3200:
    b[7]+=1
  else:
    b[8]+=1
coma=b[8]
comi=0
while b:
  if b.pop() > 0:
    comi+=1
if coma > 0 and comi > 0:
  comi-=1
print(comi,min(8,comi+coma))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=[0]*9
while a:
  kazu=a.pop(0)
  if kazu < 400:
    b[0]+=1
  elif kazu < 800:
    b[1]+=1
  elif kazu < 1200:
    b[2]+=1
  elif kazu < 1600:
    b[3]+=1
  elif kazu < 2000:
    b[4]+=1
  elif kazu < 2400:
    b[5]+=1
  elif kazu < 2800:
    b[6]+=1
  elif kazu < 3200:
    b[7]+=1
  else:
    b[8]+=1
coma=b[8]
comi=0
while b:
  if b.pop() > 0:
    comi+=1
if coma > 0:
  comi-=1
print(comi,min(8,comi+coma))

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int, input().split()))
colo = []

for i in rate:
    if 1 <= i < 400:
        if 1 in colo:
            continue
        else:
            colo.append(1)
    if 400 <= i < 800:
        if 2 in colo:
            continue
        else:
            colo.append(2)
    if 800 <= i < 1200:
        if 3 in colo:
            continue
        else:
            colo.append(3)
    if 1200 <= i < 1600:
        if 4 in colo:
            continue
        else:
            colo.append(4)
    if 1600 <= i < 2000:
        if 5 in colo:
            continue
        else:
            colo.append(5)
    if 2000 <= i < 2400:
        if 6 in colo:
            continue
        else:
            colo.append(6)
    if 2400 <= i < 2800:
        if 7 in colo:
            continue
        else:
            colo.append(7)
    if 2800 <= i < 3200:
        if 8 in colo:
            continue
        else:
            colo.append(8)
    if 3200 <= i:
        colo.append(-1)

if -1 not in colo:
    print("{} {}".format(len(colo), len(colo)))
else:
    cnt = 0
    cnt_upto3200 = 0
    for i in range(1, 9):
        if i in colo:
            cnt += 1
    for j in colo:
        if j == -1:
            cnt_upto3200 += 1
    if cnt == 0:
        print("{} {}".format(1,  cnt_upto3200))
    else:
        print("{} {}".format(cnt, cnt + cnt_upto3200))
print(colo)

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int, input().split()))
colo = []

for i in rate:
    if 1 <= i < 400:
        if 2 in colo:
            continue
        else:
            colo.append(1)
    if 400 <= i < 800:
        if 2 in colo:
            continue
        else:
            colo.append(2)
    if 800 <= i < 1200:
        if 3 in colo:
            continue
        else:
            colo.append(3)
    if 1200 <= i < 1600:
        if 4 in colo:
            continue
        else:
            colo.append(4)
    if 1600 <= i < 2000:
        if 5 in colo:
            continue
        else:
            colo.append(5)
    if 2000 <= i < 2400:
        if 6 in colo:
            continue
        else:
            colo.append(6)
    if 2400 <= i < 2800:
        if 7 in colo:
            continue
        else:
            colo.append(7)
    if 2800 <= i < 3200:
        if 8 in colo:
            continue
        else:
            colo.append(8)
    if 3200 <= i:
        colo.append(-1)

if -1 not in colo:
    print("{} {}".format(len(colo), len(colo)))
else:
    cnt = 0
    cnt_upto3200 = 0
    for i in range(1, 9):
        if i in colo:
            cnt += 1
    for j in colo:
        if j == -1:
            cnt_upto3200 += 1
    if cnt == 0:
        print("{} {}".format(1,  cnt_upto3200))
    else:
        print("{} {}".format(cnt, cnt + cnt_upto3200))

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int, input().split()))
colo = []

for i in rate:
    if 1 <= i < 400:
        if 2 in colo:
            continue
        else:
            colo.append(1)
    if 400 <= i < 800:
        if 2 in colo:
            continue
        else:
            colo.append(2)
    if 800 <= i < 1200:
        if 3 in colo:
            continue
        else:
            colo.append(3)
    if 1200 <= i < 1600:
        if 4 in colo:
            continue
        else:
            colo.append(4)
    if 1600 <= i < 2000:
        if 5 in colo:
            continue
        else:
            colo.append(5)
    if 2000 <= i < 2400:
        if 6 in colo:
            continue
        else:
            colo.append(6)
    if 2400 <= i < 2800:
        if 7 in colo:
            continue
        else:
            colo.append(7)
    if 2800 <= i < 3200:
        if 8 in colo:
            continue
        else:
            colo.append(8)
    if 3200 <= i:
        colo.append(-1)

if -1 not in colo:
    print("{} {}".format(len(colo), len(colo)))
else:
    cnt = 0
    cnt_upto3200 = 0
    for i in range(1, 9):
        if i in colo:
            cnt += 1
    for j in colo:
        if j == -1:
            cnt_upto3200 += 1
    print("{} {}".format(min(1, cnt), cnt + cnt_upto3200))

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int, input().split()))
colo = []

for i in rate:
    if 1 <= i < 400:
        if 2 in colo:
            continue
        else:
            colo.append(1)
    if 400 <= i < 800:
        if 2 in colo:
            continue
        else:
            colo.append(2)
    if 800 <= i < 1200:
        if 3 in colo:
            continue
        else:
            colo.append(3)
    if 1200 <= i < 1600:
        if 4 in colo:
            continue
        else:
            colo.append(4)
    if 1600 <= i < 2000:
        if 5 in colo:
            continue
        else:
            colo.append(5)
    if 2000 <= i < 2400:
        if 6 in colo:
            continue
        else:
            colo.append(6)
    if 2400 <= i < 2800:
        if 7 in colo:
            continue
        else:
            colo.append(7)
    if 2800 <= i < 3200:
        if 8 in colo:
            continue
        else:
            colo.append(8)
    if 3200 <= i:
        colo.append(-1)

if -1 not in colo:
    print("{} {}".format(len(colo), len(colo)))
else:
    cnt = 0
    cnt_upto3200 = 0
    for i in range(1, 9):
        if i in colo:
            cnt += 1
    for j in colo:
        if j == -1:
            cnt_upto3200 += 1
    print("{} {}".format(min(0, cnt), cnt + cnt_upto3200))

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = list(map(int, input().split()))
colo = []

for i in rate:
    if 1 <= i < 400:
        if 2 in colo:
            continue
        else:
            colo.append(1)
    if 400 <= i < 800:
        if 2 in colo:
            continue
        else:
            colo.append(2)
    if 800 <= i < 1200:
        if 3 in colo:
            continue
        else:
            colo.append(3)
    if 1200 <= i < 1600:
        if 4 in colo:
            continue
        else:
            colo.append(4)
    if 1600 <= i < 2000:
        if 5 in colo:
            continue
        else:
            colo.append(5)
    if 2000 <= i < 2400:
        if 6 in colo:
            continue
        else:
            colo.append(6)
    if 2400 <= i < 2800:
        if 7 in colo:
            continue
        else:
            colo.append(7)
    if 2800 <= i < 3200:
        if 8 in colo:
            continue
        else:
            colo.append(8)
    if 3200 <= i:
        colo.append(-1)

if -1 not in colo:
    print("{} {}".format(len(colo), len(colo)))
else:
    cnt = 0
    cnt_upto3200 = 0
    for i in range(1, 9):
        if i in colo:
            cnt += 1
    for j in colo:
        if j == -1:
            cnt_upto3200 += 1
    if cnt == 0:
        print("{} {}".format(1, min(8, cnt_upto3200)))
    else:
        print("{} {}".format(cnt, min(8, cnt + cnt_upto3200)))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
al = list(map(int,input().split()))
cnt = 0
dic = defaultdict(int)
for i in al:
    if 1<= i <= 399:
        dic['gray'] += 1
    elif 400 <= i <= 799:
        dic['brown'] += 1
    elif 800 <= i <= 1199:
        dic['green'] += 1
    elif 1200 <= i <= 1599:
        dic['cyan'] += 1
    elif 1600 <= i <= 1999:
        dic['blue'] += 1
    elif 2000 <= i <= 2399:
        dic['yellow'] += 1
    elif 2400 <= i <= 2799:
        dic['orange'] += 1
    elif 2800 <= i <= 3199:
        dic['red'] += 1
    else:
        cnt += 1


ansmax = len(dic.keys()) + cnt
if ansmax > 8:
    ansmax = 8


ansmin = len(dic.keys())
if ansmin == 0 and cnt >= 1:
    ansmin = 1

print(ansmin,ansmax)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
al = list(map(int,input().split()))
cnt = 0
dic = defaultdict(int)
for i in al:
    if 1<= i <= 399:
        dic['gray'] += 1
    elif 400 <= i <= 799:
        dic['brown'] += 1
    elif 800 <= i <= 1199:
        dic['green'] += 1
    elif 1200 <= i <= 1599:
        dic['cyan'] += 1
    elif 1600 <= i <= 1999:
        dic['blue'] += 1
    elif 2000 <= i <= 2399:
        dic['yellow'] += 1
    elif 2400 <= i <= 2799:
        dic['orange'] += 1
    elif 2800 <= i <= 3199:
        dic['red'] += 1
    else:
        cnt += 1


ansmax = len(dic.keys()) + cnt
if ansmax > 7:
    ansmax = 7


ansmin = len(dic.keys())
if ansmin == 0 and cnt >= 1:
    ansmin = 1

print(ansmin,ansmax)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
al = list(map(int,input().split()))
cnt = 0
dic = defaultdict(int)
for i in al:
    if 1<= i <= 399:
        dic['gray'] += 1
    elif 400 <= i <= 799:
        dic['brown'] += 1
    elif 800 <= i <= 1199:
        dic['green'] += 1
    elif 1200 <= i <= 1599:
        dic['cyan'] += 1
    elif 1600 <= i <= 1999:
        dic['blue'] += 1
    elif 2000 <= i <= 2399:
        dic['yellow'] += 1
    elif 2400 <= i <= 2799:
        dic['orange'] += 1
    elif 2800 <= i <= 3199:
        dic['red'] += 1
    else:
        cnt += 1


ansmax = len(dic.keys()) + cnt
if ansmax > 7:
    ansmax = 7


ansmin = len(dic.keys())
if ansmin == 0:
    ansmin = 1

print(ansmin,ansmax)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
al = list(map(int,input().split()))
cnt = 0
dic = defaultdict(int)
for i in al:
    if 1<= i <= 399:
        dic['gray'] += 1
    elif 400 <= i <= 799:
        dic['brown'] += 1
    elif 800 <= i <= 1199:
        dic['green'] += 1
    elif 1200 <= i <= 1599:
        dic['cyan'] += 1
    elif 1600 <= i <= 1999:
        dic['blue'] += 1
    elif 2000 <= i <= 2399:
        dic['yellow'] += 1
    elif 2400 <= i <= 2799:
        dic['orange'] += 1
    elif 2800 <= i <= 3199:
        dic['red'] += 1
    else:
        cnt += 1


ansmax = len(dic.keys()) + cnt
if ansmax > 7:
    ansmax = 7

if cnt > 0:
    cnt = 1
ansmin = len(dic.keys()) - cnt
if ansmin == 0:
    ansmin = 1

print(ansmin,ansmax)

Submission status: Wrong Answer

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

dic = defaultdict(int)
for i in al:
    if 1<= i <= 399:
        dic['gray'] += 1
    elif 400 <= i <= 799:
        dic['brown'] += 1
    elif 800 <= i <= 1199:
        dic['green'] += 1
    elif 1200 <= i <= 1599:
        dic['cyan'] += 1
    elif 1600 <= i <= 1999:
        dic['blue'] += 1
    elif 2000 <= i <= 2399:
        dic['yellow'] += 1
    elif 2400 <= i <= 2799:
        dic['orange'] += 1
    elif 2800 <= i <= 3199:
        dic['red'] += 1
    else:
        dic['black'] += 1
ansmin = len(dic.keys())
ansmax = len(dic.keys())

if len(dic.keys()) <= 7:
    if dic['black'] > 1:
        ansmax += dic['black']-1
        if ansmax > 8:
            ansmax = 8
if len(dic.keys()) >= 2:
    if dic['black'] >= 1:
        ansmin -= 1

print(ansmin,ansmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
c = list(map(int,input().split()))
b = [0]*8
cnt = 0
for a in c:
    if 0<a<400:
        b[0]=1
    elif 399<a<800:
        b[1]=1
    elif 799<a<1200:
        b[2]=1
    elif 1199<a<1600:
        b[3]=1
    elif 1599<a<2000:
        b[4]=1
    elif 1999<a<2400:
        b[5]=1
    elif 2399<a<2800:
        b[6]=1
    elif 2799<a<3200:
        b[7]=1
    else:
        cnt += 1
if b.count(1) == 0:
    print(1)
    exit()
print(b.count(1), end = " ")
print(b.count(1) + cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
c = list(map(int,input().split()))
b = [0]*8
cnt = 0
for a in c:
    if 0<a<400:
        b[0]=1
    elif 399<a<800:
        b[1]=1
    elif 799<a<1200:
        b[2]=1
    elif 1199<a<1600:
        b[3]=1
    elif 1599<a<2000:
        b[4]=1
    elif 1999<a<2400:
        b[5]=1
    elif 2399<a<2800:
        b[6]=1
    elif 2799<a<3200:
        b[7]=1
    else:
        cnt += 1
print(b.count(1), end = " ")
print(b.count(1) + cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
c = list(map(int,input().split()))
b = [0]*8
cnt = 0
for a in c:
    if 0<a<400:
        b[0]=1
    elif 399<a<800:
        b[1]=1
    elif 799<a<1200:
        b[2]=1
    elif 1199<a<1600:
        b[3]=1
    elif 1599<a<2000:
        b[4]=1
    elif 1999<a<2400:
        b[5]=1
    elif 2399<a<2800:
        b[6]=1
    elif 2799<a<3200:
        b[7]=1
    else:
        cnt += 1
print(b.count(1), end = " ")
print(min(b.count(1) + cnt, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = [0] * 8
p = 0

for i in range(n):
    if 1 <= a[i] <= 399:
        t[0] += 1
    elif 400 <= a[i] <= 799:
        t[1] += 1
    elif 800 <= a[i] <= 1199:
        t[2] += 1
    elif 1200 <= a[i] <= 1599:
        t[3] += 1
    elif 1600 <= a[i] <= 1999:
        t[4] += 1
    elif 2000 <= a[i] <= 2399:
        t[5] += 1
    elif 2400 <= a[i] <= 2799:
        t[6] += 1
    elif 2800 <= a[i] <= 3199:
        t[7] += 1
    else:
        p += 1

z = t.count(0)
if z == 8:
    print(1,min(p,8))
    exit(0)
amin = 8 - z
if z >= p:
    amax = amin + p
else:
    amax = 8
print(amin,amax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = [0] * 8
p = 0

for i in range(n):
    if 1 <= a[i] <= 399:
        t[0] += 1
    elif 400 <= a[i] <= 799:
        t[1] += 1
    elif 800 <= a[i] <= 1199:
        t[2] += 1
    elif 1200 <= a[i] <= 1599:
        t[3] += 1
    elif 1600 <= a[i] <= 1999:
        t[4] += 1
    elif 2000 <= a[i] <= 2399:
        t[5] += 1
    elif 2400 <= a[i] <= 2799:
        t[6] += 1
    elif 2800 <= a[i] <= 3199:
        t[7] += 1
    else:
        p += 1

z = t.count(0)
amin = 8 - z
if z >= p:
    amax = amin + p
else:
    amax = 8
print(amin,amax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = [0] * 8
p = 0

for i in range(n):
    if 1 <= a[i] <= 399:
        t[0] += 1
    elif 400 <= a[i] <= 799:
        t[1] += 1
    elif 800 <= a[i] <= 1199:
        t[2] += 1
    elif 1200 <= a[i] <= 1599:
        t[3] += 1
    elif 1600 <= a[i] <= 1999:
        t[4] += 1
    elif 2000 <= a[i] <= 2399:
        t[5] += 1
    elif 2400 <= a[i] <= 2799:
        t[6] += 1
    elif 2800 <= a[i] <= 3199:
        t[7] += 1
    else:
        p += 1

z = t.count(0)
if z >= p:
    print(8-z,8-z+p)
else:
    print(8,8)

Submission status: Wrong Answer

Solution code:
s = input()
n = int(s)

t_count = 0
f_count = 0
over = 0

colors = []
for i in range(8):
    colors.append(False)

v = input().split()

for i in range(n):
    x = int(v[i])
    if 1 <= x <= 399:
        colors[0] = True
    elif 400 <= x <= 799:
        colors[1] = True
    elif 800 <= x <= 1199:
        colors[2] = True
    elif 1200 <= x <= 1599:
        colors[3] = True
    elif 1600 <= x <= 1999:
        colors[4] = True
    elif 2000 <= x <= 2399:
        colors[5] = True
    elif 2400 <= x <= 2799:
        colors[6] = True
    elif 2800 <= x <= 3199:
        colors[7] = True
    else:
        over += 1

for i in range(len(colors)):
    if colors[i]:
        t_count += 1

min_ans = t_count
max_ans = t_count + over

print(min_ans, end=' ')
print(max_ans)

Submission status: Wrong Answer

Solution code:
s = input()
n = int(s)

t_count = 0
f_count = 0
over = 0

colors = []
for i in range(8):
    colors.append(False)

v = input().split()

for i in range(n):
    x = int(v[i])
    if 1 <= x <= 399:
        colors[0] = True
    elif 400 <= x <= 799:
        colors[1] = True
    elif 800 <= x <= 1199:
        colors[2] = True
    elif 1200 <= x <= 1599:
        colors[3] = True
    elif 1600 <= x <= 1999:
        colors[4] = True
    elif 2000 <= x <= 2399:
        colors[5] = True
    elif 2400 <= x <= 2799:
        colors[6] = True
    elif 2800 <= x <= 3199:
        colors[7] = True
    else:
        over += 1

for i in range(len(colors)):
    if colors[i]:
        t_count += 1
    else:
        f_count += 1

min_ans = t_count
if f_count >= over:
    max_ans = t_count + over
else:
    max_ans = 8

print(min_ans, end=' ')
print(max_ans)

Submission status: Wrong Answer

Solution code:
s = input()
n = int(s)

t_count = 0
f_count = 0
over = 0

colors = []
for i in range(8):
    colors.append(False)

v = input().split()

for i in range(n):
    x = int(v[i])
    if 1 <= x <= 399:
        colors[0] = True
    elif 400 <= x <= 799:
        colors[1] = True
    elif 800 <= x <= 1199:
        colors[2] = True
    elif 1200 <= x <= 1599:
        colors[3] = True
    elif 1600 <= x <= 1999:
        colors[4] = True
    elif 2000 <= x <= 2399:
        colors[5] = True
    elif 2400 <= x <= 2799:
        colors[6] = True
    elif 2800 <= x <= 3199:
        colors[7] = True
    else:
        over += 1

for i in range(len(colors)):
    if colors[i]:
        t_count += 1
    else:
        f_count += 1

min_ans = t_count
if f_count >= over:
    max_ans = t_count + over
else:
    max_ans = t_count + f_count

print(min_ans, end=' ')
print(max_ans)