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()))

ans=[0]*8
c=0

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

mi=sum(ans)
ma=sum(ans)+c

if mi==0:
    mi=1

if ma>8:
    ma=8

print(' '.join([str(mi),str(ma)]))

Submission status: Wrong Answer

Solution code:

n=int(input())

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

ans=[0]*8
c=0

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

mi=sum(ans)
ma=sum(ans)+c

if ma>8:
    ma=8

print(' '.join([str(mi),str(ma)]))

Submission status: Wrong Answer

Solution code:
n=int(input())
code=input().split()
a=[0]*8
i=0
k=0
for j in range(n):
    if int(code[j])<400:
        a[0]=1
    elif int(code[j])<800:
        a[1]=1
    elif int(code[j])<1200:
        a[2]=1
    elif int(code[j])<1600:
        a[3]=1
    elif int(code[j])<2000:
        a[4]=1
    elif int(code[j])<2400:
        a[5]=1
    elif int(code[j])<2800:
        a[6]=1
    elif int(code[j])<3200:
        a[7]=1
    else:
        i+=1
for z in range(8):
    if a[z]==1:
        k+=1
if k>0:
    print(k, min(8,i+k),sep=" ")
else:
    print(1, min(8,i),sep=" ")

Submission status: Wrong Answer

Solution code:
n=int(input())
code=input().split()
a=[0]*8
i=0
k=0
for j in range(n):
    if int(code[j])<400:
        a[0]=1
    elif int(code[j])<800:
        a[1]=1
    elif int(code[j])<1200:
        a[2]=1
    elif int(code[j])<1600:
        a[3]=1
    elif int(code[j])<2000:
        a[4]=1
    elif int(code[j])<2400:
        a[5]=1
    elif int(code[j])<2800:
        a[6]=1
    elif int(code[j])<3200:
        a[7]=1
    else:
        i+=1
for z in range(8):
    k+=a[z]
print(k, min(8,i+k),sep=" ")

Submission status: Wrong Answer

Solution code:
num=int(input())
line=input().split(" ")
a=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
k=0
for i in range(num):
	if int(line[i])<400:
		a=1
	elif int(line[i])>=400 and int(line[i])<800:
		b=1
	elif int(line[i])>=800 and int(line[i])<1200:
		c=1
	elif int(line[i])>=1200 and int(line[i])<1600:
		d=1
	elif int(line[i])>=1600 and int(line[i])<2000:
		e=1
	elif int(line[i])>=2000 and int(line[i])<2400:
		f=1
	elif int(line[i])>=2400 and int(line[i])<2800:
		g=1
	elif int(line[i])>=2800 and int(line[i])<3200:
		h=1
	elif int(line[i])>=3200:
		k+=1
if a+b+c+d+e+f+g+h==0:
	print(1)
else:
	print(a+b+c+d+e+f+g+h, a+b+c+d+e+f+g+h+k)

Submission status: Wrong Answer

Solution code:
x=int(input())
A=[int(x) for x in str(input()).split()]
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
orange=0
red=0
others=0
for i in A:
  if i<400:
    gray=1
  elif i<800:
    brown=1
  elif i<1200:
    green=1
  elif i<1600:
    cyan=1
  elif i<2000:
    blue=1
  elif i<2400:
    yellow=1
  elif i<2800:
    orange=1
  elif i<3200:
    red=1
  else:
    others+=1
mi=gray+brown+green+cyan+blue+yellow+orange+red
ma=mi+others
print(str(mi),str(ma))

Submission status: Wrong Answer

Solution code:
num=int(input())
line=input().split(" ")
a=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
k=0
for i in range(num):
	if int(line[i])<400:
		a=1
	elif int(line[i])>=400 and int(line[i])<800:
		b=1
	elif int(line[i])>=800 and int(line[i])<1200:
		c=1
	elif int(line[i])>=1200 and int(line[i])<1600:
		d=1
	elif int(line[i])>=1600 and int(line[i])<2000:
		e=1
	elif int(line[i])>=2000 and int(line[i])<2400:
		f=1
	elif int(line[i])>=2400 and int(line[i])<2800:
		g=1
	elif int(line[i])>=2800 and int(line[i])<3200:
		h=1
	elif int(line[i])>=3200:
		k+=1
print(str(a+b+c+d+e+f+g+h)+" "+str(a+b+c+d+e+f+g+h+k))

Submission status: Wrong Answer

Solution code:
n=int(input())
x=input().split()
y=0
while y<n:
    x[y]=int(x[y])
    y+=1
other=0
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
orange=0
red=0
for i in x:
    if i<=399:
        gray=1
    elif i<=799:
        brown=1
    elif i<=1199:
        green=1
    elif i<=1599:
        cyan=1
    elif i<=1999:
        blue=1
    elif i<=2399:
        yellow=1
    elif i<=2799:
        orange=1
    elif i<=3199:
        red=1
    else:
        other+=1
mi=gray+brown+green+cyan+blue+yellow+orange+red
ma=other+mi
print(mi,ma)

Submission status: Wrong Answer

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

'''
gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
'''

colour = [0]*8
free = 0

for i in range(N):
    if a[i]>=1 and a[i]<=399:
        colour[0] = 1
    elif a[i]>=400 and a[i]<=799:
        colour[1] = 1
    elif a[i]>=800 and a[i]<=1199:
        colour[2] = 1
    elif a[i]>=1200 and a[i]<=1599:
        colour[3] = 1
    elif a[i]>=1600 and a[i]<=1999:
        colour[4] = 1
    elif a[i]>=2000 and a[i]<=2399:
        colour[5] = 1
    elif a[i]>=2400 and a[i]<=2799:
        colour[6] = 1
    elif a[i]>=2800 and a[i]<=3199:
        colour[7] = 1
    else:
        free += 1
        
kinds = 0
for i in range(8):
    if colour[i] == 1:
        kinds += 1

minimum = kinds

maximum = kinds+free

    
print(minimum,maximum)

Submission status: Wrong Answer

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

'''
gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
'''

colour = [0]*8
free = 0

for i in range(N):
    if a[i]>=1 and a[i]<=399:
        colour[0] = 1
    elif a[i]>=400 and a[i]<=799:
        colour[1] = 1
    elif a[i]>=800 and a[i]<=1199:
        colour[2] = 1
    elif a[i]>=1200 and a[i]<=1599:
        colour[3] = 1
    elif a[i]>=1600 and a[i]<=1999:
        colour[4] = 1
    elif a[i]>=2000 and a[i]<=2399:
        colour[5] = 1
    elif a[i]>=2400 and a[i]<=2799:
        colour[6] = 1
    elif a[i]>=2800 and a[i]<=3199:
        colour[7] = 1
    else:
        free += 1
        
kinds = 0
for i in range(8):
    if colour[i] == 1:
        kinds += 1

minimum = kinds

maximum = kinds+free
if maximum > 8:
    maximum = 8
    
print(minimum,maximum)

Submission status: Wrong Answer

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

'''
gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
'''

colour = [0]*8
free = 0

for i in range(N):
    if a[i]>=1 and a[i]<=399:
        colour[0] = 1
    elif a[i]>=400 and a[i]<=799:
        colour[1] = 1
    elif a[i]>=800 and a[i]<=1199:
        colour[2] = 1
    elif a[i]>=1200 and a[i]<=1599:
        colour[3] = 1
    elif a[i]>=1600 and a[i]<=1999:
        colour[4] = 1
    elif a[i]>=2000 and a[i]<=2399:
        colour[5] = 1
    elif a[i]>=2400 and a[i]<=2799:
        colour[6] = 1
    elif a[i]>=2800 and a[i]<=3199:
        colour[7] = 1
    else:
        free += 1
        
kinds = 0
for i in range(8):
    if colour[i] > 0:
        kinds += 1

minimum = kinds

maximum = kinds+free
if maximum > 8:
    maximum = 8
    
print(minimum,maximum)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())

count_counter = Counter()
result = 0
over = 0

for i in input().split():
    count_counter[int(i) // 400] += 1

for key in count_counter.keys():
    if key < 8:
        result += 1
    else:
        over += count_counter[key]
if result + over > 8:
    print(result, 8)
else:
    print(result, result+over)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())

count_counter = Counter()
result = 0
over = 0

for i in input().split():
    count_counter[int(i) // 400] += 1

for key in count_counter.keys():
    if key < 8:
        result += 1
    else:
        over += count_counter[key]

print(result, result+over)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int, input().split()))
b=[]
t=0
for x in a:
    if x<3200:
        b.append(x//400)
    else:
        t+=1
import collections
c=len(list(collections.Counter(b).keys()))
print(max(1,c), min(8, c+t))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int, input().split()))
b=[]
t=0
for x in a:
    if x<3200:
        b.append(x//400)
    else:
        t+=1
import collections
c=len(list(collections.Counter(b).keys()))
print(c, min(8, c+t))

Submission status: Wrong Answer

Solution code:
n = int(input())

dic = [0 for i in range(9)]

arr = map(int,raw_input().split())

for i in range(n):
	if arr[i] < 3200:
		dic[arr[i]/400] += 1

	else :
		dic[8] += 1

minimum = 0
count =  0
for i in range(8):
	if dic[i] > 0:
		count += 1

if sum(dic[:8]) == 0:
	minimum = 1

else :
	minimum = count 


maximum = min(8,count + dic[8])

print minimum,maximum

Submission status: Wrong Answer

Solution code:
a = int(input())

b = list(map(int,input().split()))

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

ma = sum(c) + d

if sum(c) == 0:
	print(ma,ma)
else:
	print(sum(c),ma)

Submission status: Wrong Answer

Solution code:
a = int(input())

b = list(map(int,input().split()))

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

ma = sum(c) + d

print(sum(c), ma)

Submission status: Wrong Answer

Solution code:
a = int(input())

b = list(map(int,input().split()))

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

if sum(c) + d < 8:
	ma = sum(c) + d
else:
	ma = 8

print(sum(c), ma)

Submission status: Wrong Answer

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

gray = 0
blown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
constant = 0
variable = 0

for i in a:
    if i < 400 and gray == 0:
        gray = 1
        constant += 1
        continue
    elif 400 <= i < 800 and blown == 0:
        blown = 1
        constant += 1
        continue
    elif 800 <= i < 1200 and green == 0:
        green = 1
        constant += 1
        continue
    elif 1200 <= i < 1600 and light_blue == 0:
        light_blue = 1
        constant += 1
        continue
    elif 1600 <= i < 2000 and blue == 0:
        blue = 1
        constant += 1
        continue
    elif 2000 <= i < 2400 and yellow == 0:
        yellow = 1
        constant += 1
        continue
    elif 2400 <= i < 2800 and orange == 0:
        orange = 1
        constant += 1
        continue
    elif 2800 <= i < 3200 and red == 0:
        red = 1
        constant += 1
        continue
    elif i >= 3200:
        variable += 1

if constant < variable:
    print(variable, constant+variable)
else:
    print(constant, constant)

Submission status: Wrong Answer

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

gray = 0
blown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
constant = 0
variable = 0

for i in a:
    if i < 400 and gray == 0:
        gray = 1
        constant += 1
        continue
    elif 400 <= i < 800 and blown == 0:
        blown = 1
        constant += 1
        continue
    elif 800 <= i < 1200 and green == 0:
        green = 1
        constant += 1
        continue
    elif 1200 <= i < 1600 and light_blue == 0:
        light_blue = 1
        constant += 1
        continue
    elif 1600 <= i < 2000 and blue == 0:
        blue = 1
        constant += 1
        continue
    elif 2000 <= i < 2400 and yellow == 0:
        yellow = 1
        constant += 1
        continue
    elif 2400 <= i < 2800 and orange == 0:
        orange = 1
        constant += 1
        continue
    elif 2800 <= i < 3200 and red == 0:
        red = 1
        constant += 1
        continue
    elif i >= 3200:
        variable += 1

if constant < variable:
    print(variable, constant+variable)
else:
    print(constant, constant+variable)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

flag=[0]*8

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

count=0

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

print(sum(flag),min(8,sum(flag)+count))

Submission status: Wrong Answer

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

dic = {i : 0 for i in range(9)}
for i in range(N):
	if (a[i] // 400) > 7:
		dic[8] += 1
	else:
		dic[(a[i] // 400)] += 1

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

print(minv,minv+dic[8])

Submission status: Wrong Answer

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

dic = {i : 0 for i in range(9)}
for i in range(N):
	if (a[i] // 400) > 7:
		dic[8] += 1
	else:
		dic[(a[i] // 400)] += 1

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

print(minv,min(8,minv+dic[8]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int, input().split()))
b=dict()
for i in a:
    b[i//400]=b.get(i//400,0)+1
count=0
count2=0
for i in b:
    if i>7:count2+=b[i]
    else:count+=1
print(max(count,1),min(count+count2,8))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int, input().split()))
b=dict()
for i in a:
    b[i//400]=b.get(i//400,0)+1
count=0
count2=0
for i in b:
    if i>7:count2+=b[i]
    else:count+=1
print(count,min(count+count2,8))

Submission status: Wrong Answer

Solution code:

def m():
    n = int(input())
    a = list(map(int, input().split()))
    ans = set()
    freecont = 0
    for i in range(n):
        t = a[i] // 400
        if t >= 8:
            freecont+=1
            continue
        ans.add(t)
    if len(ans) == 0:
        minc = 1
        maxc = min(freecont, 8)
        return "{} {}".format(minc, maxc)
    minc = len(ans)
    maxc = min(len(ans) + freecont, 8)
    return "{} {}".format(minc, maxc)


print(m())

Submission status: Wrong Answer

Solution code:

def m():
    n = int(input())
    a = list(map(int, input().split()))
    ans = set()
    freecont = 0
    for i in range(n):
        t = a[i] // 400
        if t >= 8:
            freecont+=1
            continue
        ans.add(t)
    minc = len(ans)
    maxc = min(len(ans) + freecont, 8)
    return "{} {}".format(minc, maxc)


print(m())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
s, x = set(), 0
for i in a:
    if(i < 3200):
        s.add(i//400)
    else:
        x += 1
print(len(s), min(8, len(s)+x))

Submission status: Wrong Answer

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

colors = [False] * 8
crown_owners = 0

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

print(colors.count(True), colors.count(True) + crown_owners)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
ans1 = 0
ans2 = 0
b = []
for i in a:
    if i < 3200:
        k = i // 400
        if not k in b:
            ans2 += 1
            ans1 += 1
            b.append(k)
    else:
        ans2 += 1
print(min(ans1,1), ans2)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
ans1 = 0
ans2 = 0
b = []
for i in a:
    if i < 3200:
        k = i // 400
        if not k in b:
            ans2 += 1
            ans1 += 1
            b.append(k)
    else:
        ans2 += 1
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
col = []
for i in range(0,n):
    tmp = int(a[i]/400)
    col.append(tmp)
colcnt = Counter(col)

nonsle = 0
slct = 0
for i in colcnt.keys():
    if i == 8:
        slct = colcnt[i]
    else:
        nonsle += 1

if nonsle==0:
    min = 1
    max = slct
else:
    min = nonsle
    max = slct + nonsle

print(min,max)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
col = []
for i in range(0,n):
    tmp = int(a[i]/400)
    col.append(tmp)
colcnt = Counter(col)

nonsle = 0
slct = 0
for i in colcnt.keys():
    if i == 8:
        slct = colcnt[i]
    else:
        nonsle += 1

if nonsle==0:
    min = 1
    max = 1
else:
    min = nonsle
    max = slct + nonsle

print(min,max)

Submission status: Wrong Answer

Solution code:
N = int(input())
rates = list(map(int, input().split(' ')))
colors = [0] * 9 # colors[8] = anything
for r in rates:
    if r < 400: colors[0] += 1
    elif r < 800: colors[1] += 1
    elif r < 1200: colors[2] += 1
    elif r < 1600: colors[3] += 1
    elif r < 2000: colors[4] += 1
    elif r < 2400: colors[5] += 1
    elif r < 2800: colors[6] += 1
    elif r < 3200: colors[7] += 1
    else: colors[8] += 1
color_max = 0
color_min = 0
zeros = colors.count(0)
if colors[8] == 0:
    color_max = 9 - zeros
    color_min = color_max
else:
    if zeros == 8:
        color_min = 1
    else:
        color_min = 8 - zeros
    if zeros <= colors[8]:
        color_max = 8
    else:
        color_max = 8 - zeros + colors[8]
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
rates = list(map(int, input().split(' ')))
colors = [0] * 9 # colors[8] = anything
for r in rates:
    if r < 400: colors[0] += 1
    elif r < 800: colors[1] += 1
    elif r < 1200: colors[2] += 1
    elif r < 1600: colors[3] += 1
    elif r < 2000: colors[4] += 1
    elif r < 2400: colors[5] += 1
    elif r < 2800: colors[6] += 1
    elif r < 3200: colors[7] += 1
    else: colors[8] += 1
color_max = 0
color_min = 0
zeros = colors.count(0)
if colors[8] == 0:
    color_max = 9 - zeros
    color_min = color_max
else:
    color_min = 8 - zeros
    if zeros <= colors[8]:
        color_max = 8
    else:
        color_max = 8 - zeros + colors[8]
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
t = [0 for k in range(8)]
s = 0

for x in A:
    if x < 400:
        t[0] = 1
    elif x < 800:
        t[1] = 1
    elif x < 1200:
        t[2] = 1
    elif x < 1600:
        t[3] = 1
    elif x < 2000:
        t[4] = 1
    elif x < 2400:
        t[5] = 1
    elif x < 2800:
        t[6] = 1
    elif x < 3200:
        t[7] = 1
    else:
        s += 1

print(max(1,t.count(1)),min(t.count(1)+s,8))

Submission status: Wrong Answer

Solution code:
from collections import Counter


def getinputdata():
    # 配列初期化
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

n = int(arr_data[0][0])

arr = [int(x) for x in arr_data[1]]
arr_result = [0 for x in range(8)]

cnt = 0
for v in arr:

    if v < 400:

        arr_result[0] = 1

    elif v < 400 * 2:

        arr_result[1] = 1
    elif v < 400 * 3:

        arr_result[2] = 1
    elif v < 400 * 4:

        arr_result[3] = 1
    elif v < 400 * 5:

        arr_result[4] = 1
    elif v < 400 * 6:

        arr_result[5] = 1
    elif v < 400 * 7:

        arr_result[6] = 1

    elif v < 400 * 8:

        arr_result[7] = 1

    else:

        cnt += 1


if cnt == 0:

    print(sum(arr_result), sum(arr_result))

else:
    print(sum(arr_result), sum(arr_result) + cnt)

Submission status: Wrong Answer

Solution code:
from collections import Counter


def getinputdata():
    # 配列初期化
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

n = int(arr_data[0][0])

arr = [int(x) for x in arr_data[1]]
arr_result = [0 for x in range(8)]

cnt = 0
for v in arr:

    if v < 400:

        arr_result[0] = 1

    elif v < 400 * 2:

        arr_result[1] = 1
    elif v < 400 * 3:

        arr_result[2] = 1
    elif v < 400 * 4:

        arr_result[3] = 1
    elif v < 400 * 5:

        arr_result[4] = 1
    elif v < 400 * 6:

        arr_result[5] = 1
    elif v < 400 * 7:

        arr_result[6] = 1

    elif v < 400 * 8:

        arr_result[7] = 1

    else:

        cnt += 1


if cnt == 0:

    print(sum(arr_result), sum(arr_result))

elif sum(arr_result) + cnt >= 8:
    print(sum(arr_result), 8)

else:
    print(sum(arr_result), sum(arr_result) + cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = 0
color = []
for a_i in a:
    if a_i>=3200:
        c += 1
    else:
        color.append(a_i//400)
    
ans_min = len(set(color))

print(ans_min, ans_min+c)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = 0
color = []
for a_i in a:
    if a_i//400>7:
        c += 1
    else:
        color.append(a_i//400)
    
ans_min = len(set(color))

print(ans_min, ans_min+c)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = 0
color = []
for a_i in a:
    if a_i//400>7:
        c += 1
    color.append(a_i//400)
    
ans_min = len(set(color))
if c>0:
    ans_min -= 1
print(ans_min, ans_min+c)

Submission status: Wrong Answer

Solution code:
n = int(input())
lis = [0,0,0,0,0,0,0,0]
pro = 0
li = list(map(int,input().split()))
for i in range(n):
	if li[i] >= 3200:
		pro += 1
	else:
		lis[(li[i])//400] = 1
su = lis.count(1)
print(max(su,1),min(su+pro,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
c = set([])
free = 0
for r in l:
  if 1 <= r <= 399:
    c.add('grey')
  elif 400 <= r <= 799:
    c.add('brown')
  elif 800 <= r <= 1199:
    c.add('green')
  elif 1200 <= r <= 1599:
    c.add('cyan')
  elif 1600 <= r <= 1999:
    c.add('blue')
  elif 2000 <= r <= 2399:
    c.add('yellow')
  elif 2400 <= r <= 2799:
    c.add('orange')
  elif 2800 <= r <= 3199:
    c.add('red')
  elif r >= 3200:
    free += 1

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

Submission status: Wrong Answer

Solution code:
import collections

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

d = collections.defaultdict(int)

for i in a:
    i_ = i // 400
    if i_ >= 8:
        i_ = 8
    d[i_] += 1

if 8 in d:
    min_ = max(len(d) - 1, 1)
    max_ = min(len(d) + d[8] - 1, 8)

else:
    min_ = len(d)
    max_ = len(d)

print(min_, max_)

Submission status: Wrong Answer

Solution code:
import collections

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

d = collections.defaultdict(int)

for i in a:
    i_ = i // 400
    d[i_] += 1

if 8 in d:
    min_ = max(len(d) - 1, 1)
    max_ = min(len(d) + d[8] - 1, 8)

else:
    min_ = len(d)
    max_ = len(d)

print(min_, max_)

Submission status: Wrong Answer

Solution code:
import collections

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

d = collections.defaultdict(int)

for i in a:
    i_ = i // 400
    d[i_] += 1

if 8 in d:
    min_ = min(len(d) - 1, 1)
    max_ = min(len(d) + d[8] - 1, 8)

else:
    min_ = len(d)
    max_ = len(d)

print(min_, max_)

Submission status: Wrong Answer

Solution code:
import collections

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

d = collections.defaultdict(int)

for i in a:
    i_ = i // 400
    d[i_] += 1

if 8 in d:
    min_ = len(d) - 1
    max_ = min(len(d) + d[8] - 1, 8)

else:
    min_ = len(d)
    max_ = len(d)

print(min_, max_)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = [x//400 for x in A]
a,b = 0,0
for i in range(13):
    if i < 8:
        if i in B:
            a+=1
    else:
        b+=B.count(i)
print(a,a+b)

Submission status: Wrong Answer

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

dict={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}

for a in A:
  if a>=3200:
    dict[8]+=1
  elif a>=2800:
    dict[7]+=1
  elif a>=2400:
    dict[6]+=1
  elif a>=2000:
    dict[5]+=1
  elif a>=1600:
    dict[4]+=1
  elif a>=1200:
    dict[3]+=1
  elif a>=800:
    dict[2]+=1
  elif a>=400:
    dict[1]+=1
  else:
    dict[0]+=1
ans=0
for i in range(8):
  if dict[i]>0:
    ans+=1
print(max(ans,1),min(ans+dict[8],8))

Submission status: Wrong Answer

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

dict={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}

for a in A:
  if a>=3200:
    dict[8]+=1
  elif a>=2800:
    dict[7]+=1
  elif a>=2400:
    dict[6]+=1
  elif a>=2000:
    dict[5]+=1
  elif a>=1600:
    dict[4]+=1
  elif a>=1200:
    dict[3]+=1
  elif a>=800:
    dict[2]+=1
  elif a>=400:
    dict[1]+=1
  else:
    dict[0]+=1
ans=0
for i in range(8):
  if dict[i]>0:
    ans+=1
print(ans,min(ans+dict[8],8))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
gray=brown=green=cyan=blue=yellow=orange=red=num=0
for i in range(n):
    if 1<=a[i]<=399:
        gray=1
    if 400<=a[i]<=799:
        brown=1
    if 800<=a[i]<=1199:
        green=1
    if 1200<=a[i]<=1599:
        cyan=1
    if 1600<=a[i]<=1999:
        blue=1
    if 2000<=a[i]<=2399:
        yellow=1
    if 2400<=a[i]<=2799:
        orange=1
    if 2800<=a[i]<=3199:
        red=1
    if 3200<=a[i]:
        num+=1
total=gray+brown+green+cyan+blue+yellow+orange+red
if total==0:
    print(num,num)
else:
    print(total,total+num)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
gray,brown,green,cyan,blue,yellow,orange,red,num=0,0,0,0,0,0,0,0,0,
for i in range(n):
    if 1<=a[i]<=399:
        gray=1
    if 400<=a[i]<=799:
        brown=1
    if 800<=a[i]<=1199:
        green=1
    if 1200<=a[i]<=1599:
        cyan=1
    if 1600<=a[i]<=1999:
        blue=1
    if 2000<=a[i]<=2399:
        yellow=1
    if 2400<=a[i]<=2799:
        orange=1
    if 2800<=a[i]<=3199:
        red=1
    if 3200<=a[i]:
        num+=1
total=gray+brown+green+cyan+blue+yellow+orange+red
print(total,total+num)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
gray,brown,green,cyan,blue,yellow,orange,red,num=0,0,0,0,0,0,0,0,0,
for i in range(n):
    if 1<=a[i]<=399:
        gray=1
    elif 400<=a[i]<=799:
        brown=1
    elif 800<=a[i]<=1199:
        green=1
    elif 1200<=a[i]<=1599:
        cyan=1
    elif 1600<=a[i]<=1999:
        blue=1
    elif 2000<=a[i]<=2399:
        yellow=1
    elif 2400<=a[i]<=2799:
        orange=1
    elif 2800<=a[i]<=3199:
        red=1
    elif 3200<=a[i]:
        num+=1
total=gray+brown+green+cyan+blue+yellow+orange+red
print(total,total+num)