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():
    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)
    max_ = min_ + etc
    if max_ > 8:
        max_ = 8

    print(min_, max_)

main()

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input().split()
b = [0]*8
c = 0

for a in A:
    a = int(a)
    if 1<=a<=399:
        b[0] += 1
    elif 400<=a<=799:
        b[1] += 1
    elif 800<=a<=1199:
        b[2] += 1
    elif 1200<=a<=1599:
        b[3] += 1
    elif 1600<=a<=1999:
        b[4] += 1
    elif 2000<=a<=2399:
        b[5] += 1
    elif 2400<=a<=2799:
        b[6] += 1
    elif 2800<=a<=3199:
        b[7] += 1
    elif 3200<=a:
        c += 1

if c == 0:
    print(8-b.count(0), end=" ")
else:
    print(max(8-b.count(0),1), end=" ")

print(min(8-b.count(0)+c, 9))

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 == 0:
    cnt = len([b for b in B if b > 0])
    print(cnt, cnt)
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:
# - coding: utf-8 -*-

# 色を返却
def what_color(num):
    if num < 400: #灰色
        return 0
    elif num < 800: #茶色
        return 1
    elif num <1200 : #緑
        return 2
    elif num < 1600: #水色
        return 3
    elif num < 2000: #青
        return 4
    elif num < 2400: #黄色
        return 5
    elif num < 2800: #橙色
        return 6
    elif num < 3200: #赤色
        return 7
    else:
        return 8

n = raw_input()
a = map(int, raw_input().split())

colors = [0, 0, 0, 0, 0, 0, 0, 0]
god = 0
for rate in a:
    color = what_color(rate)
    if color == 8:
        god = god+1
    else:
        colors[color] = 1

sum_colors = sum(colors)

saidai = sum_colors + god
saisyo = max([sum_colors, god])

print '{0} {1}'.format(saisyo, saidai)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

colors = [0,0,0,0,0,0,0,0,0]

count = 0

def check(x):
	if 1<=x<=399:
		colors[0] += 1
	elif 400<=x<=799:
		colors[1] += 1
	elif 800<=x<=1199:
		colors[2] += 1
	elif 1200<=x<=1599:
		colors[3] += 1
	elif 1600<=x<=1999:
		colors[4] += 1
	elif 2000<=x<=2399:
		colors[5] += 1
	elif 2400<=x<=2799:
		colors[6] += 1
	elif 2800<=x<=3199:
		colors[7] += 1
	elif 3200<=x:
		colors[8] += 1

for i in a:
	check(i)

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

color_min = 8 - count
color_max = min(color_min+colors[8],8)

if color_min==0 and colors[8]!=0:
	color_min = 1

print(color_min,color_max)

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]
if maxCount > 8 :
    maxCount = 8

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

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

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

if max_scorerer >= 8-_least:
    most = 8
else:
    most = _least + max_scorerer

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

Submission status: Wrong Answer

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

color=[0]*8
free=0

for ai in a:
    if ai<400:
        color[0]+=1
    elif ai<800:
        color[1]+=1
    elif ai<1200:
        color[2]+=1
    elif ai<1600:
        color[3]+=1
    elif ai<2000:
        color[4]+=1
    elif ai<2400:
        color[5]+=1
    elif ai<2800:
        color[6]+=1
    elif ai<3200:
        color[7]+=1
    else:
        free+=1

c=len(color)-color.count(0)
if c==0:
    c=1

m=c+free

print c,m

Submission status: Wrong Answer

Solution code:
# coding: utf-8

n = input()
a = map(int, raw_input().split())
rate = [0] * 9

for i in xrange(n):
    if a[i] <= 399:
        rate[0] = 1
    elif a[i] <= 799:
        rate[1] = 1
    elif a[i] <= 1199:
        rate[2] = 1
    elif a[i] <= 1599:
        rate[3] = 1
    elif a[i] <= 1999:
        rate[4] = 1
    elif a[i] <= 2399:
        rate[5] = 1
    elif a[i] <= 2799:
        rate[6] = 1
    elif a[i] <= 3199:
        rate[7] = 1
    else:
        rate[8] += 1

print sum(rate[:8]), sum(rate)

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:
n = int(input())
a = list(map(int,input().split()))
kind = []
var = 0

def d_color(num):
     if 1<=num and num<=399:
         return "a"
     elif 400<=num and num<=799:
         return "b"
     elif 800<=num and num<=1199:
         return "c"
     elif 1200<=num and num<=1599:
         return "d"
     elif 1600<=num and num<=1999:
         return "e"
     elif 2000<=num and num<=2399:
         return "f"
     elif 2400<=num and num<=2799:
         return "g"
     else:
         return "h"

for i in range(n):
    if a[i]<3200:
        kind.append(d_color(a[i]))
    else:
        var += 1

kind = list(set(kind))

MAX = MIN = len(kind)
if 8 <= MAX+var :
    MAX = 8
else:
    MAX += var


print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
import numpy as np

if __name__ == "__main__":
    # N = int(input())
    # a = input().split()
    a = "800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990".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))

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
from math import *
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    color_list = [0 for i in range(8)]
    top_coder_num = 0
    for i in range(N):
        rate = int(input_raw[i])
        if rate>= 1 and rate < 400:
            color_list[0] = 1
        elif rate>= 400 and rate < 800:
            color_list[1] = 1
        elif rate>= 800 and rate < 1200:
            color_list[2] = 1
        elif rate>= 1200 and rate < 1600:
            color_list[3] = 1
        elif rate>= 1600 and rate < 2000:
            color_list[4] = 1
        elif rate>= 2000 and rate < 2400:
            color_list[5] = 1
        elif rate>= 2400 and rate < 2800:
            color_list[6] = 1
        elif rate>= 2800 and rate < 3200:
            color_list[7] = 1
        else:
            top_coder_num += 1

    min_color = sum(color_list)
    if min_color == 0 and top_coder_num >= 1:
        min_color = 1
    max_color = sum(color_list) + top_coder_num
    if max_color > 8:
        max_color = 8
    print min_color, max_color




if __name__ == '__main__':
    main()

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), min(8, len(color) + over)

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]
if 8 < mx:
    mx = 8
print str(mn) + " " + str(mx)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def get_ln_int_inputs():
    return list(map(int, input().split()))


def main():
    input()
    rates = get_ln_int_inputs()

    colors = [0] * 8
    free_colors = 0
    for rate in rates:
        if rate >= 3200:
            free_colors += 1
        else:
            colors[rate // 400] = 1
    fixed_colors = sum(colors)

    print(str(fixed_colors) + " " + str(fixed_colors + free_colors))


main()

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:
def get_color_index(rate):
    if 1 <= rate and rate <= 399:
        return 0
    elif 400 <= rate and rate <= 799:
        return 1
    elif 800 <= rate and rate <= 1199:
        return 2
    elif 1200 <= rate and rate <= 1599:
        return 3
    elif 1600 <= rate and rate <= 1999:
        return 4
    elif 2000 <= rate and rate <= 2399:
        return 5
    elif 2400 <= rate and rate <= 2799:
        return 6
    elif 2800 <= rate and rate <= 3199:
        return 7
    else:
        return -1

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

colors = []
wildcard_count = 0

for i in range(N):
    c = get_color_index(a[i])
    if c == -1:
        wildcard_count += 1
    elif c not in colors:
        colors.append(c)

c_min = max(min(len(colors), 8), 1)
c_max = min(len(colors) + wildcard_count, 8)

print(str(c_min) + ' ' + str(c_max))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input().split()
b = [0]*8
c = 0

for a in A:
    a = int(a)
    if 1<=a<=399:
        b[0] += 1
    elif 400<=a<=799:
        b[1] += 1
    elif 800<=a<=1199:
        b[2] += 1
    if 1200<=a<=1599:
        b[3] += 1
    if 1600<=a<=1999:
        b[4] += 1
    if 2000<=a<=2399:
        b[5] += 1
    if 2400<=a<=2799:
        b[6] += 1
    if 2800<=a<=3199:
        b[7] += 1
    if 3200<=a:
        c += 1

if c == 0:
    print(8-b.count(0), end=" ")
else:
    print(max(8-b.count(0),1), end=" ")

print(min(8-b.count(0)+c, 8))

Submission status: Wrong Answer

Solution code:
N = input()
rates = [int(x) for x in input().split()]
colors = [0,0,0,0,0,0,0,0]
target = 0

for rate in rates:
	if rate < 400:
		colors[0] = 1
	elif 400 <= rate < 800:
		colors[1] = 1
	elif 800 <= rate < 1200:
		colors[2] = 1
	elif 1200 <= rate < 1600:
		colors[3] = 1
	elif 1600 <= rate < 2000:
		colors[4] = 1
	elif 2000 <= rate < 2400:
		colors[5] = 1
	elif 2400 <= rate < 2800:
		colors[6] = 1
	elif 2800 <= rate < 3200:
		colors[7] = 1
	else:
		target += 1

non_target = sum(colors)
MAX = non_target + target

if non_target >= target:
	MIN = non_target
else:
	MIN = non_target + (target - non_target)

print(MIN,MAX)

Submission status: Wrong Answer

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

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_score = counts[-1]

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

most = _least + max_score

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

Submission status: Wrong Answer

Solution code:
N = int(input())
data = list(map(int,input().split()))
box = [0]*8
num = 0
for i in range(len(data)):
        x = int(data[i] / 400)
        if x < 8:
            box[x] += 1
        else:
            num += 1
answer = len(box)   - box.count(0)
print(answer,(answer+num))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
s = []
k = 0
l = 0

for i in range(N):
	if a[i] <= 399:
		s.append('a')
	elif a[i] <= 799:
		s.append('b')
	elif a[i] <= 1199:
		s.append('c')
	elif a[i] <= 1599:
		s.append('d')
	elif a[i] <= 1999:
		s.append('e')
	elif a[i] <= 2399:
		s.append('f')
	elif a[i] <= 2799:
		s.append('g')
	elif a[i] <= 3199:
		s.append('h')
	else:
		k += 1

if s.count("a") != 0:
	l += 1

if s.count("b") != 0:
	l += 1
	
if s.count("c") != 0:
	l += 1

if s.count("d") != 0:
	l += 1

if s.count("e") != 0:
	l += 1
	
if s.count("f") != 0:
	l += 1

if s.count("g") != 0:
	l += 1

if s.count("h") != 0:
	l += 1
	
m = k + l

if l == 0:
	if m < 8:
		print(1,m)
	else:
		print(1,8)
else:
	if m < 8:
		print(l,m)
	else:
		print(l,8)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

colors = [0,0,0,0,0,0,0,0,0]

color_max = 8

count = 0

def check(x):
	if 1<=x<=399:
		colors[0] += 1
	elif 400<=x<=799:
		colors[1] += 1
	elif 800<=x<=1199:
		colors[2] += 1
	elif 1200<=x<=1599:
		colors[3] += 1
	elif 1600<=x<=1999:
		colors[4] += 1
	elif 2000<=x<=2399:
		colors[5] += 1
	elif 2400<=x<=2799:
		colors[6] += 1
	elif 2800<=x<=3199:
		colors[7] += 1
	elif 3200<=x:
		colors[8] += 1

for i in a:
	check(i)

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

color_min = color_max - count
color_max = min(color_min+colors[8],color_max)

if color_min==0 and colors[8]!=0:
	color_min = 1

print(color_min,color_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if C:
    S = len(B)
    if S == 0:
        S = 1
    T = len(B) + len (C)
    print(str(S) + " " + str(T))
else:
    print(str(len(B)) + " " + str(len(B)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
kind = []
var = 0

def d_color(num):
     if 1<=num and num<=399:
         return "a"
     elif 400<=num and num<=799:
         return "b"
     elif 800<=num and num<=1199:
         return "c"
     elif 1200<=num and num<=1599:
         return "d"
     elif 1600<=num and num<=1999:
         return "e"
     elif 2000<=num and num<=2399:
         return "f"
     elif 2400<=num and num<=2799:
         return "g"
     else:
         return "h"

for i in range(n):
    if a[i]<3200:
        kind.append(d_color(a[i]))
    else:
        var += 1

kind = list(set(kind))

MAX = MIN = len(kind)
if 8 < MAX+var :
    MAX = 8
else:
    MAX += var


print(MIN,MAX)

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_score = counts[-1]

if _least == 0:
    least = 1
else:
    least = _least
    
if max_score >= 8 - _least:
    most = 8
else:
    most = _least + max_score

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    rates = get_ln_int_inputs()

    colors = list()
    for _ in range(8):
        colors.append(0)

    free_colors = 0
    for rate in rates:
        if rate >= 3200:
            free_colors += 1
        else:
            colors[rate // 400] = 1
    fixed_colors = sum(colors)

    print(str(fixed_colors) + " " + str(fixed_colors + free_colors))


main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
kind = []
var = 0

def d_color(num):
     if 1<=num and num<=399:
         return "a"
     elif 400<=num and num<=799:
         return "b"
     elif 800<=num and num<=1199:
         return "c"
     elif 1200<=num and num<=1599:
         return "d"
     elif 1600<=num and num<=1999:
         return "e"
     elif 2000<=num and num<=2399:
         return "f"
     elif 2400<=num and num<=2799:
         return "g"
     else:
         return "h"

for i in range(n):
    if a[i]<3200:
        kind.append(d_color(a[i]))
    else:
        var += 1

kind = list(set(kind))

MAX = MIN = len(kind)
if 9 < MAX+var :
    MAX = 9
else:
    MAX += var


print(MIN,MAX)

Submission status: Wrong Answer

Solution code:

borders = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
def getcolor(rate):
    i = 0
    for border in borders:
        if rate < border:
            return i
        i += 1
    return -1

N = int(input())
rates = [int(x) for x in input().split(" ")]
colors = [0 for _ in range(len(borders))]
topcoders = 0

for rate in rates:
    c = getcolor(rate)
    if c != -1:
        colors[c] = 1
    else:
        topcoders += 1

s_c = sum(colors)
ans = "{0} {1}".format(max(s_c, 1), min(s_c + topcoders, len(borders)))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if C:
    S = len(B)
    if S == 0:
        S = 1
    T = len(B) + len (C)
    if T > 8:
        T = 8
    print(str(S) + " " + str(T))
else:
    print(str(len(B)) + " " + str(len(B)))

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])
if sum(b)>=8:e=8
else:e=sum(b)
print d,e

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

n = input()
a = [int(i) for i in input().split()]
color = [0, 0, 0, 0, 0, 0, 0, 0]
tr = 0

for i in a:
  if i < 3200:
    color[int(i / 400)] += 1
  else:
    tr += 1

count = 0
for i in color:
  if i != 0:
    count += 1

if count > 0:
  print(str(count) + " ", end = '')
else:
  print(str(1) + " ", end = '')

if count + tr < 8:
  print(str(count + tr))
else:
  print(str(8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
kind = []
var = 0

def d_color(num):
     if 1<=num and num<=399:
         return "a"
     elif 400<=num and num<=799:
         return "b"
     elif 800<=num and num<=1199:
         return "c"
     elif 1200<=num and num<=1599:
         return "d"
     elif 1600<=num and num<=1999:
         return "e"
     elif 2000<=num and num<=2399:
         return "f"
     elif 2400<=num and num<=2799:
         return "g"
     else:
         return "h"

for i in range(n):
    if a[i]<3200:
        kind.append(d_color(a[i]))
    else:
        var += 1

kind = list(set(kind))

MAX = MIN = len(kind)
if 9 < MAX+var :
    MAX = 9
else:
    MAX += var

if MIN < var:
    MIN = var

print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

def get_index(rate):
    if 1 <= rate <= 399:
        return 0
    elif 400 <= rate <= 799:
        return 1
    elif 800 <= rate <= 1199:
        return 2
    elif 1200 <= rate <= 1599:
        return 3
    elif 1600 <= rate <= 1999:
        return 4
    elif 2000 <= rate <= 2399:
        return 5
    elif 2400 <= rate <= 2799:
        return 6
    elif 2800 <= rate <= 3199:
        return 7

if __name__ == "__main__":
    N = int(input())
    rates = list(map(int, input().split(" ")))
    color_list = [0] * 8

    free_num = 0
    for rate in rates:
        if rate >= 3200:
            free_num += 1
        else:
            color_list[get_index(rate)] += 1

    color_kind = len(list(filter(lambda x: x > 0, color_list)))
    if free_num == N:
        print(str(1) + " " + str(min(8, free_num)))
    else:
        print(str(color_kind) + " " + str(min(8, color_kind + free_num)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

n = input()
a = map(int, raw_input().split())
rate = [0] * 10

for i in xrange(n):
    if a[i] <= 399:
        rate[0] = 1
    elif a[i] <= 799:
        rate[1] = 1
    elif a[i] <= 1199:
        rate[2] = 1
    elif a[i] <= 1599:
        rate[3] = 1
    elif a[i] <= 1999:
        rate[4] = 1
    elif a[i] <= 2399:
        rate[5] = 1
    elif a[i] <= 2799:
        rate[6] = 1
    elif a[i] <= 3199:
        rate[7] = 1
    else:
        rate[8] = 1
        rate[9] += 1

print sum(rate[:8]), sum(rate[:8]) + rate[9]

Submission status: Wrong Answer

Solution code:
N = int(input())
data = input().split()
data = data[:N]

color = [0, 0, 0, 0, 0, 0, 0, 0]
count = 0

for i in data:
	i = int(i)
	if(i< 400):				#灰色
		if(color[0] == 0):
			color[0] = 1
	elif(i < 800):			#茶色
		if(color[1] == 0):
			color[1] = 1
	elif(i < 1200):			#緑色
		if(color[2] == 0):
			color[2] = 1
	elif(i < 1600):			#水色
		if(color[3] == 0):
			color[3] = 1
	elif(i < 2000):			#青色
		if(color[4] == 0):
			color[4] = 1
	elif(i < 2400):			#黄色
		if(color[5] == 0):
			color[5] = 1
	elif(i < 2800):			#橙色
		if(color[6] == 0):
			color[6] = 1
	elif(i < 3200):			#赤色
		if(color[7] == 0):
			color[7] = 1
	else:					#3200以上
		count += 1

min = sum(color)
max = min + count

print(min, max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
s = []
k = 0
l = 0

for i in range(N):
	if a[i] <= 399:
		s.append('a')
	elif a[i] <= 799:
		s.append('b')
	elif a[i] <= 1199:
		s.append('c')
	elif a[i] <= 1599:
		s.append('d')
	elif a[i] <= 1999:
		s.append('e')
	elif a[i] <= 2399:
		s.append('f')
	elif a[i] <= 2799:
		s.append('g')
	elif a[i] <= 3199:
		s.append('h')
	else:
		k += 1

if s.count("a") != 0:
	l += 1

if s.count("b") != 0:
	l += 1
	
if s.count("c") != 0:
	l += 1

if s.count("d") != 0:
	l += 1

if s.count("e") != 0:
	l += 1
	
if s.count("f") != 0:
	l += 1

if s.count("g") != 0:
	l += 1

if s.count("h") != 0:
	l += 1
	
m = k + l
if m < 8:
	print(l,m)
else:
	print(l,8)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

n = input()
a = [int(i) for i in input().split()]
color = [0, 0, 0, 0, 0, 0, 0, 0]
tr = 0

for i in a:
  if i < 3200:
    color[int(i / 400)] += 1
  else:
    tr += 1

count = 0
for i in color:
  if i != 0:
    count += 1

if count > 0:
  print(str(count) + " ", end='')
else:
  print(str(1))

if count + tr < 8:
  print(str(count + tr))
else:
  print(str(8))

Submission status: Wrong Answer

Solution code:
h=[0]*7

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

nu=0
for sa in a:
    fsa=int(sa/400)    
    if fsa<=6:
        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())
a.sort()

rank = [False] * 8

count = 0
for i in range(N):
  if 3200 <= a[i]:
    count += 1
  else:
    rank[int(a[i]/400)] = True

minimum = rank.count(True)
maximum = minimum + count
if minimum == 0:
  minimum = count
print minimum, maximum

Submission status: Wrong Answer

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

color=[0]*8
free=0

for ai in a:
    if ai<400:
        color[0]+=1
    elif ai<800:
        color[1]+=1
    elif ai<1200:
        color[2]+=1
    elif ai<1600:
        color[3]+=1
    elif ai<2000:
        color[4]+=1
    elif ai<2400:
        color[5]+=1
    elif ai<2800:
        color[6]+=1
    elif ai<3200:
        color[7]+=1
    else:
        free+=1

c=len(color)-color.count(0)

m=c+free

print c,m

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_score = counts[-1]

if max_score >= 8 - least:
    most = 8
else:
    most = least + max_score

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

colors = [0,0,0,0,0,0,0,0,0]

color_max = 8

count = 0

def check(x):
	if 1<=x<=399:
		colors[0] += 1
	elif 400<=x<=799:
		colors[1] += 1
	elif 800<=x<=1199:
		colors[2] += 1
	elif 1200<=x<=1599:
		colors[3] += 1
	elif 1600<=x<=1999:
		colors[4] += 1
	elif 2000<=x<=2399:
		colors[5] += 1
	elif 2400<=x<=2799:
		colors[6] += 1
	elif 2800<=x<=3199:
		colors[7] += 1
	elif 3200<=x:
		colors[8] += 1

for i in a:
	check(i)

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

color_min = color_max - count
color_max = min(color_min+colors[8],color_max)

print(color_min,color_max)