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 c():
    n = int(input())
    a = list(map(int, input().split()))
    x = []
    def set_col(rate):
        r = rate // 400
        r = min(8, r)

    res = set(map(set_col, a))
    if 8 in res: res.remove(8)
    mi = max(1, len(res))
    ma = len(res) + len(x)
    print(mi, ma)

c()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
 
N = int(input())
 
a = list(map(int, input().split()))
b = [0, 0, 0, 0, 0, 0, 0, 0, 0]
 
for i in range(len(a)):
    if 1 <= a[i] <= 399:
        b[0] = 1
    elif 400 <= a[i] <= 799:
        b[1] = 1
    elif 800 <= a[i] <= 1199:
        b[2] = 1
    elif 1200 <= a[i] <= 1599:
        b[3] = 1
    elif 1600 <= a[i] <= 1999:
        b[4] = 1
    elif 2000 <= a[i] <= 2399:
        b[5] = 1
    elif 2400 <= a[i] <= 2799:
        b[6] = 1
    elif 2800 <= a[i] <= 3199:
        b[7] = 1
    else:
        b[8] += 1

num_min = sum(b) - b[8]
 
num_max = sum(b)
 
print(num_min, num_max)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
 
N = int(input())
 
a = list(map(int, input().split()))
b = [0, 0, 0, 0, 0, 0, 0, 0, 0]
 
for i in range(len(a)):
    if 1 <= a[i] <= 399:
        b[0] = 1
    elif 400 <= a[i] <= 799:
        b[1] = 1
    elif 800 <= a[i] <= 1199:
        b[2] = 1
    elif 1200 <= a[i] <= 1599:
        b[3] = 1
    elif 1600 <= a[i] <= 1999:
        b[4] = 1
    elif 2000 <= a[i] <= 2399:
        b[5] = 1
    elif 2400 <= a[i] <= 2799:
        b[6] = 1
    elif 2800 <= a[i] <= 3199:
        b[7] = 1
    elif 3200 <= a[i]:
        b[8] += 1
    else:
        pass
 
other_min = 0
 
if b[8] > 0:
    other_min = 0
 
num_min = sum(b) - b[8] + other_min
 
num_max = sum(b)
 
print(num_min, num_max)

Submission status: Wrong Answer

Solution code:
N =int(input())
scores = [min(int(i)//400, 8) for i in input().split()]
d = [0]*9
for s in scores:
    d[s] = d[s] + 1
m = max(1, [bool(i) for i in d[:8]].count(True))
M = m+d[8]
print('{} {}'.format(m, M))

Submission status: Wrong Answer

Solution code:
N =int(input())
scores = [min(int(i)//400, 8) for i in input().split()]
d = [0]*9
for s in scores:
    d[s] = d[s] + 1
print(d)
m = max(1, [bool(i) for i in d[:8]].count(True))
M = m+d[8]
print('{} {}'.format(m, M))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

N = int(input())

a = list(map(int, input().split()))
b = [0, 0, 0, 0, 0, 0, 0, 0, 0]

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

other_min = 0

if b[8] > 0:
    other_min = 1

num_min = sum(b) - b[8] + other_min

num_max = sum(b)

print(num_min, num_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N):
    if a[i] < 400:
        gray = 1
    elif a[i] < 800:
        brown = 1
    elif a[i] < 1200:
        green = 1
    elif a[i] < 1600:
        sky = 1
    elif a[i] < 2000:
        blue = 1
    elif a[i] < 2400:
        yellow = 1
    elif a[i] < 2800:
        orange = 1
    elif a[i] < 3200:
        red = 1
    else:
        god+=1
if god > 0:
    color_max = gray + brown + green + sky + blue + yellow + orange + red + god
    color_min = gray + brown + green + sky + blue + yellow + orange + red + 1
else:
    color_max = gray + brown + green + sky + blue + yellow + orange + red
    color_min = color_max
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
import sys
 
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
a = na()


s = set()
x = 0
for v in a:
    if v < 3200:
        s.add(int(v / 400))
    else:
        x += 1

y = len(s)


if x > 0:
    y = max(1, y)

print("%d %d" % (y, x + y))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + 1
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

N = int(input())

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

gray = []
brown = []
green = []
sky = []
blue = []
yellow = []
orange = []
red = []
other = []

for i in range(len(a)):
    if 1 <= a[i] <= 399:
        gray.append(a[i])
    elif 400 <= a[i] <= 799:
        brown.append(a[i])
    elif 800 <= a[i] <= 1199:
        green.append(a[i])
    elif 1200 <= a[i] <= 1599:
        sky.append(a[i])
    elif 1600 <= a[i] <= 1999:
        blue.append(a[i])
    elif 2000 <= a[i] <= 2399:
        yellow.append(a[i])
    elif 2400 <= a[i] <= 2799:
        orange.append(a[i])
    elif 2800 <= a[i] <= 3199:
        red.append(a[i])
    elif 3200 <= a[i]:
        other.append(a[i])
    else:
        pass

num_gray = 0
num_brown = 0
num_green = 0
num_sky = 0
num_blue = 0
num_yellow = 0
num_orange = 0
num_red = 0
num_other_min = 0
num_other_max = 0
num_min = 0
num_max = 0

if len(brown) > 0:
    num_brown += 1
if len(green) > 0:
    num_green += 1
if len(sky) > 0:
    num_sky += 1
if len(blue) > 0:
    num_blue += 1
if len(yellow) > 0:
    num_yellow += 1
if len(orange) > 0:
    num_orange += 1
if len(red) > 0:
    num_red += 1
if len(other) > 0:
    num_other_min += 1
    num_other_max = len(other)

num_min = num_gray + num_brown + num_green + num_sky + num_blue + num_yellow \
          + num_orange + num_red + num_other_min

num_max = num_gray + num_brown + num_green + num_sky + num_blue + num_yellow \
          + num_orange + num_red + num_other_max

print(num_min, num_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1599:
        color.append("water")
    elif arr[j] >= 1600 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)
result = num + all_num

if "all" in over:
    if num == 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1 8")
            else:
                print("1" + " " +str(all_num) )
        if result >= 8 and num != 0:
            print(str(num) + " " + "8")
        elif result < 8 and num != 0:
            print(str(num) + " " +str(result))
else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

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

def cl(n):
    return n//400

buff=[0]*9

for i in a:
    color=cl(i)
    if color>8:
        color=8
    buff[color]+=1


min=0
for i in range(len(buff)-1):
    if buff[i]>=1:
        min+=1

max=min+buff[8]
if max>8:
    max=8
if min==0:
    min=1

print(str(min)+" "+str(max))

Submission status: Wrong Answer

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

def cl(n):
    return n//400

buff=[0]*9


for i in a:
    color=cl(i)
    if color>8:
        color=8
    buff[color]+=1


print(buff)

min=0
for i in range(len(buff)-1):
    if buff[i]>=1:
        min+=1




max=min+buff[8]
if max>8:
    max=8
if min==0:
    min=1
print(str(min)+" "+str(max))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1599:
        color.append("water")
    elif arr[j] >= 1600 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)
result = num + all_num

if "all" in over:
    if num == 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1 8")
            else:
                print("1" + " " +str(all_num) )
        if result >= 8:
            print(str(num) + " " + "8")
        else:
            print(str(num) + " " +str(result))
else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god + 1
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_min, color_max)

Submission status: Wrong Answer

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

def cl(n):
    return n//400

buff=[0]*9


for i in a:
    color=cl(i)
    if color>8:
        color=8
    buff[color]+=1


print(buff)

min=0
for i in range(len(buff)-1):
    if buff[i]>=1:
        min+=1




max=min+buff[8]
if max>8:
    max=8
if min==0:
    min+=1
print(str(min)+" "+str(max))

Submission status: Wrong Answer

Solution code:
N =int(input())
scores = [int(i)//400 for i in input().split()]
d = [0]*10
for s in scores:
    if s > 7:
        s = 8
    d[s] = d[s] + 1
if any(d[:8]):
    m = [bool(i) for i in d[:8]].count(True)
else:
    m = 1
M = min(8, m+d[8])
print(m, M)

Submission status: Wrong Answer

Solution code:
def main():
    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 <= 799:
            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
    n_rest = N - n_min
    if n_min == 0 and n_free > 0:
        n_min = 1

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

    print(n_min, n_max)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
choice=0
colour={}
for elements in a:
	if elements>=1 and elements<=399:colour[1]=1
	elif elements>=400 and elements<=799:colour[2]=2
	elif elements>=800 and elements<=1199:colour[3]=3
	elif elements>=1200 and elements<=1599:colour[4]=4
	elif elements>=1600 and elements<=1999:colour[5]=5
	elif elements>=2000 and elements<=2399:colour[6]=6
	elif elements>=2400 and elements<=2799:colour[7]=7
	elif elements>=2800 and elements<=3199:colour[8]=8
	else:choice+=1
print(len(colour),len(colour)+choice)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1599:
        color.append("water")
    elif arr[j] >= 1600 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)

if "all" in over:
    if num >= 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1 8")
            else:
                print("1" + " " +str(all_num) )
        if num + all_num >= 8:
            print(str(num) + " " + "8")
        else:
            if all_num >= 8:
                print(str(num) + " " +str(num + all_num))
else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
 
COLOR = 8
cnt, ov = [0] * COLOR, 0
for i in range(N):
    if a[i] < 3200:
        cnt[a[i] // 400] += 1
    else:
        ov += 1
 
used, unused = 0, 0
for c in cnt:
    if c > 0:
        used += 1
    else:
        unused += 1
 
print(max(1, used), used + min(unused, ov))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god + 1
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + 1
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
if color_max>8:
    print(color_min, 8)
else:
    print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1599:
        color.append("water")
    elif arr[j] >= 1600 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)

if "all" in over:
    if num >= 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1 8")
            else:
                print("1" + " " +str(all_num) )
        if num + all_num >= 8:
            print(str(num) + " " + "8")
        elif num + all_num < 8:
            print(str(num) + " " +str(num + all_num))

else:
    print(str(num) + " " +str(num))

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))
else:
   max=min+chan
   if max>8:
      max=9
   if min==0:
      min=1
   print(str(min)+' '+str(max))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1599:
        color.append("water")
    elif arr[j] >= 1600 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)

if "all" in over:
    if num >= 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1" + " " +"8")
            else:
                print("1 8")
        if num + all_num >= 8:
            print(str(num) + " " + "8")
        elif num + all_num < 8:
            print(str(num) + " " +str(num + all_num))

else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

Solution code:
N =int(input())
scores = [int(i)//400 for i in input().split()]
d = [0]*10
for s in scores:
    if s > 7:
        s = 8
    d[s] = d[s] + 1
print(d)
if any(d[:8]):
    m = [bool(i) for i in d[:8]].count(True)
else:
    m = 1
M = min(8, m+d[8])
print(m, M)

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 <= 799:
            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:
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
if len(a2_n) == 0:
    num = 1
    n_min = 1
else:
    num = 0
    n_min = len(set(a2_n))
if n_min+count >= 8:
    n_max =8
else:
    n_max = n_min+count-num

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

Submission status: Wrong Answer

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

num=[0,0,0,0,0,0,0,0,0]
counter=0

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

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0 and num[8]==0:
    min=0
    max=0

elif counter==0 and num[8]!=0:
    min=1
    if num[8]>=8:
        max=8
    else:
        max=num[8]

else:
    min=counter
    if counter+num[8]>=8:
        max=8
    else:
        max=counter+num[8]

#print(num)
print(str(min)+" "+str(max))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1599:
        color.append("water")
    elif arr[j] >= 1600 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)

if "all" in over:
    if num >= 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1" + " " +str(all_num))
            else:
                print("1 8")
        if num + all_num >= 8:
            print(str(num) + " " + "8")
        elif num + all_num < 8:
            print(str(num) + " " +str(num + all_num))

else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

Solution code:
rates=[int(i) for i in input().split()]
del rates[0]
colors=[]
over=[]
for rate in rates:
    if rate<=399:
        colors.append('gray')
    elif rate>=400 and rate<=799:
        colors.append('brown')
    elif rate>=800 and rate<=1199:
        colors.append('green')
    elif rate>=1200 and rate<=1599:
        colors.append('lightblue')
    elif rate>=1600 and rate<=1999:
        colors.append('blue')
    elif rate>=2000 and rate<=2399:
        colors.append('yellow')
    elif rate>=2400 and rate<=2799:
        colors.append('orange')
    elif rate>=2800 and rate<=3199:
        colors.append('')
    elif rate>=3200:
        over.append('a')
length=len(set(colors))
print(length, length+len(over))

Submission status: Wrong Answer

Solution code:

h=[0]*8
nu=0

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

#a=[3200]*99

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

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
choice=0
colour={}
for elements in a:
	if elements>=1 and elements<=399:colour[1]=1
	elif elements>=400 and elements<=799:colour[2]=2
	elif elements>=800 and elements<=1199:colour[3]=3
	elif elements>=1200 and elements<=1599:colour[4]=4
	elif elements>=1600 and elements<=1999:colour[5]=5
	elif elements>=2000 and elements<=2399:colour[6]=6
	elif elements>=2400 and elements<=2799:colour[7]=7
	elif elements>=2800 and elements<=3199:colour[8]=8
	else:choice+=1
print(len(colour),len(colour)+choice if len(colour)+choice<=8 else 8 )

Submission status: Wrong Answer

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

color = [0] * 8
supercoder = 0
ctn = 0

for i in range(N):
    if ratio[i] <= 399:
        color[0] += 1
    elif ratio[i] <= 799:
        color[1] += 1
    elif ratio[i] <= 1199:
        color[2] += 1
    elif ratio[i] <= 1599:
        color[3] += 1
    elif ratio[i] <= 1999:
        color[4] += 1
    elif ratio[i] <= 2399:
        color[5] += 1
    elif ratio[i] <= 2799:
        color[6] += 1
    elif ratio[i] <= 3199:
        color[7] += 1
    else:
        supercoder += 1

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

print (ctn,ctn + supercoder)

Submission status: Wrong Answer

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

num=[0,0,0,0,0,0,0,0,0]
counter=0

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

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0 and num[8]==0:
    min=0
    max=0

elif counter==0 and num[8]!=0:
    min=1
    if num[8]>=8:
        max=8
    else:
        max=num[8]

else:
    min=counter
    if counter+num[8]>=8:
        max=8
    else:
        max=counter+num[8]

print(num)
print(str(min)+" "+str(max))

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
if len(a2_n) == 0:
    num = 1
    n_min = 1
else:
    num = 0
    n_min = len(set(a2_n))
n_max = n_min+count-num

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god + 1
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + 1
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_min, color_max)