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:
def main():
    # not use N
    _ = int(input().strip())

    n_399 = 0
    n_799 = 0
    n_1199 = 0
    n_1599 = 0
    n_1999 = 0
    n_2399 = 0
    n_2799 = 0
    n_3199 = 0
    n_free = 0
    rates = list(map(int, input().strip().split()))
    for r in rates:
        if r <= 399:
            n_399 = 1
        elif r <= 399:
            n_799 = 1
        elif r <= 1199:
            n_1199 = 1
        elif r <= 1599:
            n_1599 = 1
        elif r <= 1999:
            n_1999 = 1
        elif r <= 2399:
            n_2399 = 1
        elif r <= 2799:
            n_2799 = 1
        elif r <= 3199:
            n_3199 = 1
        else:
            n_free += 1

    n_min = n_399 + n_799 + n_1199 + n_1599 + n_1999 + n_2399 + n_2799 + n_3199
    if n_min == 0 and n_free > 0:
        n_min = 1

    if n_min + n_free >= 8:
        n_max = 8
    else:
        n_max = n_min + n_free

    print(n_min, n_max)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = input()
b = input().split()
b.sort()
c = [0, 0, 0, 0, 0, 0, 0, 0]
d = 0
e = 0
for i in b:
    j = 0
    while j < len(c):
        if j == 0 and c[j] == 0 and (1 <= int(i) < 400):
            c[j] += 1
            d += 1
        elif c[j] == 0 and (400 * j <= int(i) < 400 * (j+1)):
            c[j] += 1
            d += 1
        j += 1
    if int(i) >= 3200:
        e += 1
if d != 8:
    print(d, d+e)
else:
    print(d, d)

Submission status: Wrong Answer

Solution code:
inf=float('inf')
N = int(input())
x = list(map(int, input().split()))
a=[0]*8
b=0
for i in range(0,N):
    if x[i]>=3200:
        b +=1
for j in range(0,8):
    for i in range(0,N):
        if x[i]<400:
            a[j] +=1
            x[i] = inf
        x[i] -= 400

zerox=0
mincolar=0

for i in a:
    if i==0:
        zerox +=1  
    else:
        mincolar +=1

print(mincolar,mincolar+b)


quit()

Submission status: Wrong Answer

Solution code:
N=int(input())
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
dai=0
red=0
chan=0
A=input().split()
for i in range(N):
    a=int(A[i])
    if a<400:
        gray=1    
    elif a<800:
        brown=1
    elif a<1200:
        green=1   
    elif a<1600:
        cyan=1
    elif a<2000:
        blue=1
    elif a<2400:
        yellow=1
    elif a<2800:
        dai=1
    elif a<3200:
        red=1    
    else:
        chan=chan+1
min=gray+brown+green+cyan+blue+yellow+dai+red
if chan==0:
   print(str(min)+' '+str(min))
elif chan!=0 and min<7:
   max=min+chan
   if max>=8:
      max=8
   if min==0:
       min=1
   print(str(min)+' '+str(max))
else:
    print(str(8)+' '+str(8))

Submission status: Wrong Answer

Solution code:
N = int(input())
n = [int(i)//400 for i in input().split()]
c = 0
for i in n:
    if i >= 10:
        c += 1
n_kind = [i for i in n if i<10]
a = len(set(n_kind))
print(a,a-c)

Submission status: Wrong Answer

Solution code:
N = int(input())

exist = [False for i in range(8)]
colorful = 0
min = 0

rates = list(map(int, input().split(" ")))

for rate in rates:
    if rate >= 3200:
        colorful += 1
        continue
    if not exist[int(rate/400)]:
        exist[int(rate / 400)] = True
        min += 1

max_color = colorful + min


result = str(min) + " " + str(max_color)
print(result)

Submission status: Wrong Answer

Solution code:


N = int(input())
rates = [int(x) for x in input().split()]

rates.sort()
uppers = [399, 799, 1199, 1599, 1999, 2399, 2700, 3199, 4800]
accum = list()
counts = list()

for upper in uppers:
    accum.append(len([x for x in rates if x <= upper]))

counts.append(accum[0])
for i in range(1, 9):
    counts.append(accum[i] - accum[i-1])

_least = sum([1 for count in counts[:-1] if count > 0])
max_scorerer = counts[-1]

if _least == 0:
    least = 1
    most = max_scorerer
else:
    least = _least
    most = least + max_scorerer

print("{} {}".format(least, most))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])%400)
    else:
        count += 1

n_min = len(set(a2_n))
if n_min+count >= 8:
    n_max=8
else:
    n_max = n_min+count

print(str(n_min)+" "+str(n_max))

Submission status: Wrong Answer

Solution code:
inf=float('inf')
N = int(input())
x = list(map(int, input().split()))
a=[0]*8
b=0
for i in range(0,N):
    if x[i]>=3200:
        b +=1
for j in range(0,8):
    for i in range(0,N):
        if x[i]<400:
            a[j] +=1
            x[i] = inf
        x[i] -= 400

zerox=0
mincolar=0
print(b,a)
for i in a:
    if i==0:
        zerox +=1  
    else:
        mincolar +=1

print(mincolar,mincolar+b)


quit()

Submission status: Wrong Answer

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

col = [0,0,0,0,0,0,0,0]
all_col = 0 

for i in range(len(a_int)):
    if a_int[i] < 400:
        col[0] += 1
    elif a_int[i] < 800:
        col[1] += 1
    elif a_int[i] < 1200:
        col[2] += 1
    elif a_int[i] < 1600:
        col[3] += 1
    elif a_int[i] < 2000:
        col[4] += 1
    elif a_int[i] < 2400:
        col[5] += 1
    elif a_int[i] < 2800:
        col[6] += 1
    elif a_int[i] < 3200:
        col[7] += 1
    else:
        all_col += 1

min_c = len(list(filter((lambda x: x > 0), col)))
max_c = min_c + all_col
if max_c > 8:
    max_c -= max_c -8
print(str(min_c)+' ' +str(max_c))

Submission status: Wrong Answer

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

COLOR_LIST = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
free_color = 0
color_contain = [0, 0, 0, 0, 0, 0, 0, 0]



for i in a:
	cnt = 0
	for j in COLOR_LIST:
		if i > j:
			cnt += 1
	
	if cnt < len(color_contain):
	    color_contain[cnt] = 1
	else:
	    free_color += 1

if free_color == 0:
	min_ans = sum(color_contain)
	max_ans = sum(color_contain)
else:
    min_ans = max(min(8, sum(color_contain)+1), sum(color_contain))
    max_ans = min(8, sum(color_contain) + free_color)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
h=[0]*8
nu=0

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


for sa in a:
    fsa=int(sa/400)
    if fsa<8:
        h[fsa]=1
    else:
        nu+=1

Min=max(1,sum(h))
Max=min(8,Min+nu)

print(str(Min)+" "+str(Max))

Submission status: Wrong Answer

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

def get_cols(rates):
    col_flags = [False for _ in range(8)]
    wild_colors = 0
    for rate in rates:
        if rate >= 3200:
            wild_colors += 1
        else:
            col_flags[rate // 400] = True

    decided_cols = col_flags.count(True)
    # if decided_cols + wild_colors > 8:
    #     max_cols = 8
    # else:
    #     max_cols = decided_cols + wild_colors
    max_cols = decided_cols + wild_colors
    
    if decided_cols > 0:
        min_cols = decided_cols
    else:
        min_cols = wild_colors
    return (min_cols, max_cols)

print("{} {}".format(*get_cols(rates)))

Submission status: Wrong Answer

Solution code:
N=int(input())
nums=input().split()
r1=0
r2=0
r3=0
r4=0
r5=0
r6=0
r7=0
r8=0
r9=0
for n in range(0,N):
    if 1<=int(nums[n])<=399:
        r1=1
    if 400<=int(nums[n])<=799:
        r2=1
    if 800<=int(nums[n])<=1199:
        r3=1
    if 1200<=int(nums[n])<=1599:
        r4=1
    if 1600<=int(nums[n])<=1999:
        r5=1
    if 2000<=int(nums[n])<=2399:
        r6=1
    if 2400<=int(nums[n])<=2799:
        r7=1
    if 2800<=int(nums[n])<=3199:
        r8=1
    if 3200<=int(nums[n]):
        r9=r9+1

p1=r1+r2+r3+r4+r5+r6+r7+r8+r9
p2=r1+r2+r3+r4+r5+r6+r7+r8

print(p2,p1)

Submission status: Wrong Answer

Solution code:

h=[0]*8
nu=0

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


for sa in a:
    fsa=int(sa/400)
    if fsa<8:
        h[fsa]=1
    else:
        nu+=1

Min=min(1,sum(h))
Max=min(8,Min+nu)

print(str(Min)+" "+str(Max))

Submission status: Wrong Answer

Solution code:
import numpy as np
N=raw_input()
a=raw_input().split()


a=map(int,a)

th=np.arange(0,3600,400)

th=np.append(th,5000)

z=np.zeros(9)
for aa in a:
    for k in range(len(th)-1):
        if th[k] <= aa and aa < th[k+1]:
            if z[k]==0:z[k]=1


mi=np.sum(z[:-1]>0)
m=max(mi,1)
ma=mi+z[-1]
ma=int(min(ma,8))

print('{} {}'.format(m,ma))

Submission status: Wrong Answer

Solution code:
N=int(input())
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
dai=0
red=0
chan=0
A=input().split()
for i in range(N):
    a=int(A[i])
    if a<400:
        gray=1    
    elif a<800:
        brown=1
    elif a<1200:
        green=1   
    elif a<1600:
        cyan=1
    elif a<2000:
        blue=1
    elif a<2400:
        yellow=1
    elif a<2800:
        dai=1
    elif a<3200:
        red=1    
    else:
        chan=chan+1
min=gray+brown+green+cyan+blue+yellow+dai+red
if chan==0:
   print(str(min)+' '+str(min))
elif chan!=0 and min<7:
   max=min+chan
   if max>=8:
      max=8
   if min==0:
       min=1
   print(str(min)+' '+str(max))

Submission status: Wrong Answer

Solution code:

N = int(input())
a = [int(e) for e in input().split()]

def colors(score):
    if score < 400:
        return 1
    elif score < 800:
        return 2
    elif score < 1200:
        return 3
    elif score < 1600:
        return 4
    elif score < 2000:
        return 5
    elif score < 2400:
        return 6
    elif score < 2800:
        return 7
    elif score < 3200:
        return 8
    elif score >= 3200:
        return 0

ary = [colors(s) for s in a]
ary_n = set(ary)

if not 0 in ary_n:
    n_min = len(ary_n)
    n_max = len(ary_n)
else:
    n_zero = sum([e == 0 for e in ary])
    n_min = len(ary_n) - 1
    n_max = len(ary_n) + n_zero - 1

print(n_min, n_max)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 28 21:42:33 2016

@author: you
"""

n = int(input())
a = list(map(int, input().split()))
a.sort()
colornum = 0
colorflag = [0,0,0,0,0,0,0,0]
rainbow = 0
maxvalue = 0
minvalue = 0
for i in range(n):
    if colorflag[0] == 0 and a[i] < 400:
        colornum = colornum + 1
        colorflag[0] = 1
    elif colorflag[1] == 0 and a[i] >= 400 and a[i] < 800:
        colornum = colornum + 1
        colorflag[1] = 1
    elif colorflag[2] == 0 and a[i] >= 800 and a[i] < 1200:
        colornum = colornum + 1
        colorflag[2] = 1
    elif colorflag[3] == 0 and a[i] >= 1200 and a[i] < 1600:
        colornum = colornum + 1
        colorflag[3] = 1
    elif colorflag[4] == 0 and a[i] >= 1600 and a[i] < 2000:
        colornum = colornum + 1
        colorflag[4] = 1
    elif colorflag[5] == 0 and a[i] >= 2000 and a[i] < 2400:
        colornum = colornum + 1
        colorflag[5] = 1
    elif colorflag[6] == 0 and a[i] >= 2400 and a[i] < 2800:
        colornum = colornum + 1
        colorflag[6] = 1
    elif colorflag[7] == 0 and a[i] >= 2800 and a[i] < 3200:
        colornum = colornum + 1
        colorflag[7] = 1
    elif a[i] >= 3200:
        rainbow = rainbow + 1
for j in range(8):
    if colorflag[j] == 1:
        minvalue = minvalue + 1
maxvalue = minvalue + rainbow
if maxvalue > 8:
    maxvalue = 8
print(minvalue,maxvalue)

Submission status: Wrong Answer

Solution code:
import numpy as np

if __name__ == "__main__":
    N = int(input())
    a = input().split()

    a = list(map(int, a))
    a = np.array(a)

    colors_flag = np.zeros(8)
    other = 0
    for rate in a:
        if(rate >= 3200):
            other += 1
        elif(colors_flag[int(rate/400)] == 1):
            continue
        else:
            colors_flag[int(rate/400)] = 1
    color_num = np.sum(colors_flag)
    print(int(color_num), int(color_num+other if color_num + other <= 8 else 8))

Submission status: Wrong Answer

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

COLOR_LIST = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
free_color = 0
color_contain = [0, 0, 0, 0, 0, 0, 0, 0]



for i in a:
	cnt = 0
	for j in COLOR_LIST:
		if i > j:
			cnt += 1
	
	if cnt < len(color_contain):
	    color_contain[cnt] = 1
	else:
	    free_color += 1

if free_color == 0:
	min_ans = sum(color_contain)
	max_ans = sum(color_contain)
else:
    min_ans = max(1, sum(color_contain))
    max_ans = min(8, sum(color_contain) + free_color)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
h=[0]*8
nu=0

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


for sa in a:
    fsa=int(sa/400)
    if fsa<8:
        h[fsa]=1
    else:
        nu+=1

Min=sum(h)
Max=min(8,Min+nu)

print(str(Min)+" "+str(Max))

Submission status: Wrong Answer

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

def get_cols(rates):
    col_flags = [False for _ in range(8)]
    wild_colors = 0
    for rate in rates:
        if rate >= 3200:
            wild_colors += 1
        else:
            col_flags[rate // 400] = True

    decided_cols = col_flags.count(True)
    if decided_cols + wild_colors > 8:
        max_cols = 8
    else:
        max_cols = decided_cols + wild_colors
    
    if decided_cols > 0:
        min_cols = decided_cols
    else:
        min_cols = wild_colors
    return (min_cols, max_cols)

print("{} {}".format(*get_cols(rates)))

Submission status: Wrong Answer

Solution code:
a = input()
b = input().split()
b.sort()
c = [0, 0, 0, 0, 0, 0, 0, 0]
d = 0
e = 0
for i in b:
    j = 0
    while j < len(c):
        if c[j] == 0 and (400 * j <= int(i) < 400 * (j+1)):
            c[j] += 1
            d += 1
        j += 1
    if int(i) >= 3200:
        e += 1
print(d, d+e)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
a_int = sorted(list(map(int,a )))
print(a_int)
max_a = max(a_int)

col = [0,0,0,0,0,0,0,0]
all_col = 0 

for i in range(len(a_int)):
    if a_int[i] < 400:
        col[0] += 1
    elif a_int[i] < 800:
        col[1] += 1
    elif a_int[i] < 1200:
        col[2] += 1
    elif a_int[i] < 1600:
        col[3] += 1
    elif a_int[i] < 2000:
        col[4] += 1
    elif a_int[i] < 2400:
        col[5] += 1
    elif a_int[i] < 2800:
        col[6] += 1
    elif a_int[i] < 3200:
        col[7] += 1
    else:
        all_col += 1

min_c = len(list(filter((lambda x: x > 0), col)))
max_c = min_c + all_col
if max_c > 8:
    max_c -= max_c -8
print(str(min_c)+' ' +str(max_c))

Submission status: Wrong Answer

Solution code:
import math

ranks = [False for i in range(9)]
highs = 0
n = int(input())
inps = [int(i) for i in input().split()]
highs = len([i for i in inps if i > 3199])
inps = [i for i in inps if i <= 3199]
for i in inps:
    ranks[math.floor(i/399)] = True

lows = len([i for i in ranks if i == True])

minimum = max(lows, 1)
maximum = lows + highs

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])/400)
    else:
        count += 1

n_min = len(set(a2_n))
if n_min+count > 8:
    n_max=8
else:
    n_max = n_min+count

print(str(n_min)+" "+str(n_max))

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
N = int(input())
a = list(map(int, input().split()))
rate = [ 0 for tmp in range(9) ]
factor = 0
empty = 0
for tmp in range(N):
    if 1 <= a[tmp] and  a[tmp] <= 399:
        rate[0] += 1
    elif 400 <= a[tmp] and a[tmp] <= 799:
        rate[1] += 1
    elif 800 <= a[tmp] and a[tmp] <= 1199:
        rate[2] += 1
    elif 1200 <= a[tmp] and a[tmp] <= 1599:
        rate[3] += 1
    elif 1600 <= a[tmp] and a[tmp] <= 1999:
        rate[4] += 1
    elif 2000 <= a[tmp] and a[tmp]<= 2399:
        rate[5] += 1
    elif 2400 <= a[tmp] and a[tmp] <= 2799:
        rate[6] += 1
    elif 2800 <= a[tmp] and a[tmp] <= 3199:
        rate[7] += 1
    else:
        rate[8] += 1
for tmp in range(len(rate)-1):
    if rate[tmp] > 0:
        factor += 1
    else:
        empty += 1
if rate[8] > 0:
    #if rate[8] >= empty:
        #print(str(factor)+' '+str(factor+empty))
    #else:
    print(str(factor)+' '+str(factor+rate[8]))
else:
    print(str(factor)+' '+str(factor))

Submission status: Wrong Answer

Solution code:
def main():
    # not use N
    _ = int(input().strip())

    n_399 = 0
    n_799 = 0
    n_1199 = 0
    n_1599 = 0
    n_1999 = 0
    n_2399 = 0
    n_2799 = 0
    n_3199 = 0
    n_free = 0
    rates = list(map(int, input().strip().split()))
    for r in rates:
        if r <= 399:
            n_399 = 1
        elif r <= 399:
            n_799 = 1
        elif r <= 1199:
            n_1199 = 1
        elif r <= 1599:
            n_1599 = 1
        elif r <= 1999:
            n_1999 = 1
        elif r <= 2399:
            n_2399 = 1
        elif r <= 2799:
            n_2799 = 1
        elif r <= 3199:
            n_3199 = 1
        else:
            n_free += 1

    n_min = n_399 + n_799 + n_1199 + n_1599 + n_1999 + n_2399 + n_2799 + n_3199
    if n_min + n_free >= 8:
        n_max = 8
    else:
        n_max = n_min + n_free

    print(n_min, n_max)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

COLOR_LIST = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
free_color = 0
color_contain = [0, 0, 0, 0, 0, 0, 0, 0]



for i in a:
	cnt = 0
	for j in COLOR_LIST:
		if i > j:
			cnt += 1
	
	if cnt < len(color_contain):
	    color_contain[cnt] = 1
	else:
	    free_color += 1

if free_color == 0:
	min_ans = sum(color_contain)
	max_ans = sum(color_contain)
else:
    min_ans = max(1, sum(color_contain))
    max_ans = min(7, sum(color_contain) + free_color)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:


N = int(input())
rates = [int(x) for x in input().split()]

rates.sort()
uppers = [399, 799, 1199, 1599, 1999, 2399, 2700, 3199, 4800]
accum = list()
counts = list()

for upper in uppers:
    accum.append(len([x for x in rates if x <= upper]))

counts.append(accum[0])
for i in range(1, 9):
    counts.append(accum[i] - accum[i-1])

_least = sum([1 for count in counts[:-1] if count > 0])
max_scorerer = counts[-1]

if _least == 0:
    least = 1
else:
    least = _least

most = _least + max_scorerer

print("{} {}".format(least, most))

Submission status: Wrong Answer

Solution code:
r = [
[1,399],
[400,799],
[800,1199],
[1200,1599],
[1600,1999],
[2000,2399],
[2400,2799],
[2800,3199],
]

field = [0 for x in range(len(r))]

ok = 3200
oknum = 0

n = int(input())

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

for x in a:
    if x >= ok:
        oknum += 1
        continue
    for i, v in enumerate(r):
        if v[0] <= x <= v[1]:
            field[i] = 1


sumf = sum(field)

print(sumf if sumf != 0 else 1, min(sumf + oknum, len(r) + 1))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])/400)
    else:
        count += 1

n_min = len(set(a2_n))
if n_min+count > 8:
    n_max=7
else:
    n_max = n_min+count

print(str(n_min)+" "+str(n_max))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys
import os

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

B = [0] * 8
any_color = 0

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

if any_color == N:
    print(1, min(any_color, 8))
else:
    colored_num = len([b for b in B if b > 0])
    zero_num = len([b for b in B if b == 0])
    if zero_num <= any_color:
        max_num = 8
    else:
        max_num = colored_num + any_color
    print(colored_num, max_num)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
a_int = sorted(list(map(int,a )))
print(a_int)
max_a = max(a_int)

col = [0,0,0,0,0,0,0,0]
all_col = 0 

for i in range(len(a_int)):
    if a_int[i] < 400:
        col[0] += 1
    elif a_int[i] < 800:
        col[1] += 1
    elif a_int[i] < 1200:
        col[2] += 1
    elif a_int[i] < 1600:
        col[3] += 1
    elif a_int[i] < 2000:
        col[4] += 1
    elif a_int[i] < 2400:
        col[5] += 1
    elif a_int[i] < 2800:
        col[6] += 1
    elif a_int[i] < 3200:
        col[7] += 1
    else:
        all_col += 1

min_c = len(list(filter((lambda x: x > 0), col)))
max_c = min_c + all_col
if max_c > 8:
    max_c -= max_c -8
print(str(min_c)+' ' +str(max_c))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
b = set(ai//400 for ai in a)
m = len([ai for ai in a if ai > 3199])

if m == 0:
    print("{0} {0}".format(len(b)))
else:
    print("{0} {1}".format(max(len(b) - 1, 1), len(b) - 1 + m))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import re
import string

_ = input()
As = list(map(int, input().split()))
bins = [0] * 9
table = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 10000]
for a in As:
    for i, t in enumerate(table):
        if a < t:
            bins[i] += 1
            break
mn = sum(1 for x in bins[:-1] if x > 0)
mx = mn + bins[-1]
print(mn, mx)

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

a_n.sort()
for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])/400)
    else:
        count += 1
print(a2_n)
n_min = len(set(a2_n))
if n_min+count > 8:
    n_max=7
else:
    n_max = n_min+count

print(str(n_min)+" "+str(n_max))

Submission status: Wrong Answer

Solution code:
colors = {"hai": False,
          "cha": False,
          "midori": False,
          "mizu": False,
          "ao": False,
          "ki": False,
          "daidai": False,
          "aka": False}
i2c = [None]*3200
for i in range(3200):
    if i < 400:
        i2c[i] = "hai"
    elif i < 800:
        i2c[i] = "cha"
    elif i < 1200:
        i2c[i] = "midori"
    elif i < 1600:
        i2c[i] = "mizu"
    elif i < 2000:
        i2c[i] = "ao"
    elif i < 2400:
        i2c[i] = "ki"
    elif i < 2800:
        i2c[i] = "daidai"
    else:
        i2c[i] = "aka"
n = int(input())
rates = [int(i) for i in input().split()]
jiyu = 0
for x in rates:
    if x >= 3200:
        jiyu += 1
    else:
        colors[i2c[x]] = True
saisho = 0
# print(jiyu, colors)
for x in colors:
    if(colors[x]):
        saisho += 1
if(saisho < 1):
    saisho = 1
print(saisho, saisho+jiyu)

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=map(int,raw_input().split())
b=[0]*9
for i in a:
	c=i//400
	if c>=8:b[8]+=1
	else:b[c]=b[c] or 1

if sum(b[:-1])==0 and b[-1]!=0:d=1
else:d=sum(b[:-1])

print d,d+b[-1]

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    color = [0] * 8
    etc = 0
    for a in A:
        idx = a // 400
        if idx >= 8:
            etc += 1
        else:
            color[idx] = 1

    num = list(filter(lambda n: n > 0, color))
    min_ = len(num)
    if min_ == 0:
        min_ = 1
    max_ = len(num) + etc
    if max_ > 8:
        max_ = 8

    print(min_, max_)

main()

Submission status: Wrong Answer

Solution code:
import numpy as np
 
n = int(input())
a = list(int(i) for i in input().split()) 
a.sort()
minCount = 0
maxCount = 0
count = np.zeros(9)

for i in range(n) :
    if a[i] < 400 :
        count[0] = count[0] + 1
    elif a[i] < 800 :
        count[1] = count[1] + 1
    elif a[i] < 1200 :
        count[2] = count[2] + 1
    elif a[i] < 1600 :
        count[3] = count[3] + 1
    elif a[i] < 2000 :
        count[4] = count[4] + 1
    elif a[i] < 2400 :
        count[5] = count[5] + 1
    elif a[i] < 2800 :
        count[6] = count[6] + 1
    elif a[i] < 3200 :
        count[7] = count[7] + 1
    elif a[i] < 4801 :
        count[8] = count[8] + 1

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

maxCount = maxCount + count[8]

#print (a)
print (minCount, end =' ')
print (int(maxCount))

Submission status: Wrong Answer

Solution code:
h=[0]*8
nu=0

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


for sa in a:
    fsa=int(sa/400)    
    if fsa<=7:
        h[fsa]=1
    else:
        nu+=1

Min=sum(h)
Max=min(8,Min+nu)

print(str(Min)+" "+str(Max))

Submission status: Wrong Answer

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

X = [0 for _ in range(13)]
for a in A:
    X[a / 400] += 1
cnt = 0
for x in X[:8]:
    if x != 0:
        cnt += 1
cnt2 = sum(X[8:])

print max(1, cnt), min(8, cnt + cnt2)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(raw_input())
a = map(int, raw_input().split()) 

over = 0
color = set()
for ai in a:
    if ai/400 >= 8:
        over += 1
    else:
        color.add(ai/400)

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

Submission status: Wrong Answer

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

def get_cols(rates):
    col_flags = [False for _ in range(8)]
    wild_colors = 0
    for rate in rates:
        if rate >= 3200:
            wild_colors += 1
        else:
            col_flags[rate // 400] = True
    min_cols = col_flags.count(True)
    max_cols = min_cols + wild_colors
    if min_cols == 0: min_cols = 1
    if max_cols > 8: max_cols = 8
    return (min_cols, max_cols)

print("{} {}".format(*get_cols(rates)))

Submission status: Wrong Answer

Solution code:


N = int(input())
rates = [int(x) for x in input().split()]

rates.sort()
uppers = [399, 799, 1199, 1599, 1999, 2399, 2700, 3199, 4800]
accum = list()
counts = list()

for upper in uppers:
    accum.append(len([x for x in rates if x <= upper]))

for i in range(1, len(accum)):
    counts.append(accum[i] - accum[i-1])

_least = sum([1 for count in counts[:-1] if count > 0])
max_scorerer = counts[-1]

if _least == 0:
    least = 1
else:
    least = _least

most = _least + max_scorerer

print("{} {}".format(least, most))

Submission status: Wrong Answer

Solution code:
import numpy as np
N=raw_input()
a=raw_input().split()


a=map(int,a)

th=np.arange(0,3600,400)

th=np.append(th,5000)

z=np.zeros(9)
for aa in a:
    for k in range(len(th)-1):
        if th[k] <= aa and aa < th[k+1]:
            z[k]+=1

a

mi=np.sum(z[:-1]>0)
mi

m=max(mi,1)
m

ma=mi+z[-1]
ma=int(min(ma,8))

ma
print('{} {}'.format(m,ma))

Submission status: Wrong Answer

Solution code:
inf=float('inf')
N = int(input())
x = list(map(int, input().split()))
a=[0]*8
b=0
for i in range(0,N):
    if x[i]>=3200:
        b +=1
for j in range(0,8):
    for i in range(0,N):
        if x[i]<400:
            a[j] +=1
            x[i] = inf
        x[i] -= 400

zerox=0
mincolar=0
 
for i in a:
    if i==0:
        zerox +=1  
    else:
        mincolar +=1

if(zerox<b):
    print(mincolar,mincolar+zerox)
else:
    print(mincolar,mincolar+b)


quit()

Submission status: Wrong Answer

Solution code:
h=[0]*8
nu=0

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


for sa in a:
    fsa=int(sa/400)
    print(fsa)
    if fsa<=7:
        h[fsa]=1
    else:
        nu+=1

Min=sum(h)
Max=min(8,Min+nu)

print(str(Min)+" "+str(Max))

Submission status: Wrong Answer

Solution code:
memTime = int(input())
memLate = input().split()
# memTime = int(input())
# memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in memLate:
    if color // 400 >= 8:
        highLate += 1
    elif (color // 400) in colorList == False:
        colorList += color // 400
maxColor = len(colorList) + highLate
print(str(len(colorList)) + " " + str(maxColor))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
col = [0 for i in range(n)]
cnt = 0
for i in range(n):
    if 1 <= a[i] <=399:
        col[i] = "b"
    elif 400<= a[i]<=799:
        col[i] = "c"
    elif 800<= a[i]<=1199:
        col[i] = "d"
    elif 1200<= a[i]<=1599:
        col[i] = "e"
    elif 1600<= a[i]<=1999:
        col[i] = "f"
    elif 2000<= a[i]<=2399:
        col[i] = "g"
    elif 2400<= a[i]<=2799:
        col[i] = "h"
    elif 2800<= a[i]<=3199:
        col[i] = "j"
    else:
        col[i] = "k"
        cnt += 1
colv = list(set(col))
mn =mx = len(colv)
if "k" in colv:
        mn -=1
        mx += cnt-1
        if mn == 0:
            mn =1
        if mx >=8:
            mx =8
print(str(mn)+" "+str(mx))

Submission status: Wrong Answer

Solution code:
N = int(input())
x = list(map(int, input().split()))
a=[0]*8
b=0
for i in range(0,N):
    if x[i]>=3200:
        b +=1
for j in range(0,8):
    for i in range(0,N):
        if x[i]<400:
            a[j] +=1
            x[i] = 10000000
        x[i] -= 400

zerox=0
mincolar=0
 
for i in a:
    if i==0:
        zerox +=1  
    else:
        mincolar +=1

if(zerox<b):
    print(mincolar,mincolar+zerox)
else:
    print(mincolar,mincolar+b)


quit()

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
a = map(int, raw_input().split())
c = [0] * 9
for r in a:
    if r <= 399:
        c[1] = c[1] + 1
    elif r <= 799:
        c[2] = c[2] + 1
    elif r <= 1199:
        c[3] = c[3] + 1
    elif r <= 1599:
        c[4] = c[4] + 1
    elif r <= 1999:
        c[5] = c[5] + 1
    elif r <= 2399:
        c[6] = c[6] + 1
    elif r <= 2799:
        c[7] = c[7] + 1
    elif r <= 3199:
        c[8] = c[8] + 1
    elif 3200 <= r:
        c[0] = c[0] + 1
ans = 0
for i in c[1:]:
    if i != 0:
        ans = ans + 1
mn = ans
mx = ans + c[0]
print str(mn) + " " + str(mx)