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:
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
min, max = d, d+e
if d == 0:
    min = 1
if d + e > 8:
    max = 8
print(min, max)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = input()
c = Counter([int(i)//400 for i in input().split()])
ans = 0
for i in  range(8):
  ans += bool(c[i])
print(max(ans,1),ans+c[8])

Submission status: Wrong Answer

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

a.sort()

hFlag=0
cFlag=0
gFlag=0
wFlag=0
bFlag=0
yFlag=0
dFlag=0
rFlag=0
oFlag=0
sumMin=0
sumMax=0
Sum = 0

for i in range(len(a)):
    if 1<=a[i] and a[i]<=399:
        hFlag=1
    elif 400<=a[i] and a[i]<=799:
        cFlag=1
    elif 800<=a[i] and a[i]<=1199:
        gFlag=1
    elif 1200<=a[i] and a[i]<=1599:
        wFlag=1
    elif 1600<=a[i] and a[i]<=1999:
        bFlag=1
    elif 2000<=a[i] and a[i]<=2399:
        yFlag=1
    elif 2400<=a[i] and a[i]<=2799:
        dFlag=1
    elif 2800<=a[i] and a[i]<=3199:
        rFlag=1
    elif 3200<=a[i]:
        Sum = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
        if Sum == 0:
            sumMin = 1
            sumMax = 1
        elif Sum == 8:
            sumMin = 8
            sumMax = 8
        elif oFlag == 1:
            if sumMax == 8:
                sumMax = 8
            else:
                sumMax += 1
        else:
            sumMin = Sum
            sumMax = Sum + 1
            oFlag = 1

if Sum == 0:
    sumMin = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
    sumMax = sumMin

print(str(sumMin) + " " + str(sumMax))

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

if ctn >= 6:
    print (ctn,8)
else:
    print (ctn,ctn + supercoder)

Submission status: Wrong Answer

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

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

    min_ = len(color)
    if min_ == 0:
        min_ = 1
    max_ = len(color) + etc
    if max_ > 8:
        max_ = 8

    print(min_, max_)

main()

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = input()
c = Counter([int(i)//400 for i in input().split()])
print(c)
ans = 0
for i in  range(8):
  ans += bool(c[i])
print(max(ans,1),ans+c[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = map(int, input().split())
rate_under = []
rate_upper = []
for i in a:
    x = i // 400
    if(x >= 8):
        rate_upper.append(x)
    else:
        rate_under.append(x)
min = len(set(rate_under))
max = min + len(rate_upper)
if(min == 0):
    min = 1
if(max >= 8):
    max = 8
print(str(min) + " " + str(max))

Submission status: Wrong Answer

Solution code:

n=int(input())
a=input().split()
min=0
max=0
c=[]
for i in range(n):
    per=int(int(a[i])/400)
    
    if per not in c and per<8:
        min+=1
        max+=1
    if (per>=8):
        max+=1
    c.append(per)
print(min," ",max)

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)

MAX += var


print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = [int(_) for _ in input().split()]
a = np.array(a)
a = np.sort(a)
min = 0
max = 0
m = 0

if np.min(a)>=3200:
    min = 1
    if len(a)>8:
        max = 8
    else:
        max = len(a)
else:
    for i in range(N):
        if m==0 and a[i]<400:
            min+=1
        if m<400 and 400<=a[i]<800:
            min+=1
        if m<800 and 800<=a[i]<1200:
            min+=1
        if m<1200 and 1200<=a[i]<1600:
            min+=1
        if m<1600 and 1600<=a[i]<2000:
            min+=1
        if m<2000 and 2000<=a[i]<2400:
            min+=1
        if m<2400 and 2400<=a[i]<2800:
            min+=1
        if m<2800 and 2800<=a[i]<3200:
            min+=1
        m = a[i]

    if len(np.where(a>=3200)[0])==0:
        max = min
    else:
        max = min + len(np.where(a>=3200)[0])
        if max>8:
            max = 8
print (min, max)

Submission status: Wrong Answer

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

a.sort()
color = []
other = 0
for i in a:
    if i < 400 * 1:
        color.append('1')
    elif i < 400 * 2:
        color.append('2')
    elif i < 400 * 3:
        color.append('3')
    elif i < 400 * 4:
        color.append('4')
    elif i < 400 * 5:
        color.append('5')
    elif i < 400 * 6:
        color.append('6')
    elif i < 400 * 7:
        color.append('7')
    elif i < 400 * 8:
        color.append('8')
    else:
        other += 1
max_ans = len(set(color)) + other
if max_ans > 8:
    max_ans = 8
min_ans = len(set(color))
if min_ans == 0 and other != 0:
    min_ans = 1
print(min_ans, max_ans)

Submission status: Wrong Answer

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

N=int(raw_input().strip())
a=map(int,raw_input().split())

b=[]
c=0
for i in a:
    if i>=1 and i<400*1:
        b.append(1)
    if i>=400*1 and i<400*2:
        b.append(2)
    if i>=400*2 and i<400*3:
        b.append(3)
    if i>=400*3 and i<400*4:
        b.append(4)
    if i>=400*4 and i<400*5:
        b.append(5)
    if i>=400*5 and i<400*6:
        b.append(6)
    if i>=400*6 and i<400*7:
        b.append(7)
    if i>=400*7 and i<400*8:
        b.append(8)
    if i>=3200:
        c+=1

mincolor=len(set(b))
maxcolor=mincolor+c
print mincolor,
print maxcolor

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
print(d, d+e)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
list = []
list_of_topcoder = []

for i in range(n):
    if 1<=int(a[i])<=399:
        if "gray" not in list:
            list.append("gray")
        else:
            pass
    elif 400<=int(a[i])<=799:
        if "brown" not in list:
            list.append("brown")
        else:
            pass
    elif 800<=int(a[i])<=1199:
        if "green" not in list:
            list.append("green")
        else:
            pass
    elif 1200<=int(a[i])<=1599:
        if "water" not in list:
                list.append("water")
        else:
            pass
    elif 1600<=int(a[i])<=1999:
        if "blue" not in list:
            list.append("blue")
        else:
            pass
    elif 2000<=int(a[i])<=2399:
        if "brown" not in list:
            list.append("yellow")
        else:
            pass
    elif 2400<=int(a[i])<=2799:
        if "orange" not in list:
            list.append("orange")
        else:
            pass
    elif 2800<=int(a[i])<=3199:
        if "red" not in list:
            list.append("red")
        else:
            pass
    elif 3200<=int(a[i])<=4800:
        list_of_topcoder.append(i)

if len(list) != 0:
    print(len(list), len(list)+len(list_of_topcoder))
else:
    print(1, len(list_of_topcoder))

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:
n = int(input())
a = list(int(i) for i in input().split())

hai = 0
tya = 0
midori = 0
mizu = 0
ao = 0
ki = 0
daidai = 0
aka = 0

niji = 0

for i in range(n):
    if 1 <= a[i] and a[i] <=399:
        hai = 1
    elif 400 <= a[i] and a[i] <= 799:
        tya = 1
    elif 800 <= a[i] and a[i] <= 1199:
        midori = 1
    elif 1200 <= a[i] and a[i] <=1599:
        mizu = 1
    elif 1600 <= a[i] and a[i] <= 1999:
        ao = 1
    elif 2000 <= a[i] and a[i] <= 2399:
        ki = 1
    elif 2400 <= a[i] and a[i] <=2799:
        daidai = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        aka = 1
    elif 3200 <= a[i]:
        niji += 1

mincolor = hai + tya + midori + mizu + ao + ki + daidai + aka
maxcolor = mincolor + niji

if maxcolor >= 9:
    maxcolor = 8

print(mincolor, maxcolor)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = map(int, input().split())
rate_under = []
rate_upper = []
for i in a:
    x = i // 400
    if(x >= 8):
        rate_upper.append(x)
    else:
        rate_under.append(x)
min = len(set(rate_under))
if(min == 0):
    min = 1
max = min + len(rate_upper)
if(max >= 8):
    max = 8
print(str(min) + " " + str(max))

Submission status: Wrong Answer

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

a.sort()
color = []
other = 0
for i in a:
    if i < 400 * 1:
        color.append('1')
    elif i < 400 * 2:
        color.append('2')
    elif i < 400 * 3:
        color.append('3')
    elif i < 400 * 4:
        color.append('4')
    elif i < 400 * 5:
        color.append('5')
    elif i < 400 * 6:
        color.append('6')
    elif i < 400 * 7:
        color.append('7')
    elif i < 400 * 8:
        color.append('8')
    else:
        other += 1
max_ans = len(set(color)) + other
if max_ans > 8:
    max_ans = 8
min_ans = len(set(color))
print(min_ans, max_ans)

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 == 0 and e <= 8:
    print(1, e)
elif d == 0 and e > 8:
    print(0, 8)
elif d+e <= 8:
    print(d, d+e)
elif d+e > 8:
    print(d, 8)

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:
   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())
n = [int(i)//400 for i in input().split()]
c = 0
for i in n:
    if i >= 8:
        c += 1
n_kind = [i for i in n if i<8]
print(n_kind)
a = len(set(n_kind))
if a == 0:
    print(1,c)
else:print(a,a+c)

Submission status: Wrong Answer

Solution code:
n = input()
a = input()
tmp_a = a.split()
a_list = []
o_list = []
flag = 0

for i in range(int(n)):
    if int(tmp_a[i]) < 400:
        a_list.append("gray")
    elif 400 <= int(tmp_a[i]) and int(tmp_a[i]) < 800:
        a_list.append("brown")
    elif 800 <= int(tmp_a[i]) and int(tmp_a[i]) < 1200:
        a_list.append("green")
    elif 1200 <= int(tmp_a[i]) and int(tmp_a[i]) < 1600:
        a_list.append("sky")
    elif 1600 <= int(tmp_a[i]) and int(tmp_a[i]) < 2000:
        a_list.append("blue")
    elif 2000 <= int(tmp_a[i]) and int(tmp_a[i]) < 2400:
        a_list.append("yellow")
    elif 2400 <= int(tmp_a[i]) and int(tmp_a[i]) < 2800:
        a_list.append("orange")
    elif 2800 <= int(tmp_a[i]) and int(tmp_a[i]) < 3200:
        a_list.append("red")
    else:
        o_list.append("other")

n_other = len(o_list)

if len(set(a_list))==0:
    min_num = 1
else:
    min_num = len(set(a_list))

max_num = len(set(a_list))+n_other
if max_num > 8:
    max_num = 8

print(min_num, max_num)

Submission status: Wrong Answer

Solution code:
#Python

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

#print A
i=0
free_color_counts=0
colors=[]
while i<N:
	if A[i]>=1 and A[i]<=399:
		c='Hai'
		colors.append(c)
	elif A[i]>=400 and A[i]<=799:
		c='Cha'
		colors.append(c)
	elif A[i]>=800 and A[i]<=1199:
		c='Midori'
		colors.append(c)
	elif A[i]>=1200 and A[i]<=1599:
		c='Mizu'
		colors.append(c)
	elif A[i]>=1600 and A[i]<=1999:
		c='Ao'
		colors.append(c)
	elif A[i]>=2000 and A[i]<=2399:
		c='Ki'
		colors.append(c)
	elif A[i]>=2400 and A[i]<=2799:
		c='Dai'
		colors.append(c)
	elif A[i]>=2800 and A[i]<=3199:
		c='Aka'
		colors.append(c)
	elif A[i]>=3200:
		free_color_counts+=1

	i+=1


#print colors
#print list(set(colors))
print len(list(set(colors))),
print len(list(set(colors)))+ free_color_counts

Submission status: Wrong Answer

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

hai = 0
tya = 0
midori = 0
mizu = 0
ao = 0
ki = 0
daidai = 0
aka = 0

niji = 0

mincolor = 0
maxcolor = 0

for i in range(n):
    if 1 <= a[i] and a[i] <=399:
        hai = 1
    elif 400 <= a[i] and a[i] <= 799:
        tya = 1
    elif 800 <= a[i] and a[i] <= 1199:
        midori = 1
    elif 1200 <= a[i] and a[i] <=1599:
        mizu = 1
    elif 1600 <= a[i] and a[i] <= 1999:
        ao = 1
    elif 2000 <= a[i] and a[i] <= 2399:
        ki = 1
    elif 2400 <= a[i] and a[i] <=2799:
        daidai = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        aka = 1
    elif 3200 <= a[i]:
        niji += 1

mincolor = hai + tya + midori + mizu + ao + ki + daidai + aka
maxcolor = mincolor + niji

if maxcolor >= 9:
    maxcolor = 8

print(mincolor, maxcolor)

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 minvalue == 0:
    minvalue = 1
    maxvalue = rainbow
if maxvalue > 8:
    maxvalue = 8
print(minvalue,maxvalue)

Submission status: Wrong Answer

Solution code:
input();A=map(int,input().split());C=[0]*99;D=0
for a in A:a//=400;D+=a>7;C[a]+=a<8
E=sum(C);print(max(E,1),E+D)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = np.array(list(map(int, input().split())))

c = np.array([0] * 8)

a //= 400

for i in range(8):
    num = np.sum(a == i)
    c[i] = num
red = np.sum(a >= 8)

mincol = np.sum(c != 0)
maxcol = mincol + red

print(mincol, maxcol)

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 == 0:
    print(1, e)
elif d+e <= 8:
    print(d, d+e)
elif d+e > 8:
    print(d, 8)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
list = []
list_of_topcoder = []

for i in range(n):
    if 1<=int(a[i])<=399:
        if "gray" not in list:
            list.append("gray")
        else:
            pass
    elif 400<=int(a[i])<=799:
        if "brown" not in list:
            list.append("brown")
        else:
            pass
    elif 800<=int(a[i])<=1199:
        if "green" not in list:
            list.append("green")
        else:
            pass
    elif 1200<=int(a[i])<=1599:
        if "water" not in list:
                list.append("water")
        else:
            pass
    elif 1600<=int(a[i])<=1999:
        if "blue" not in list:
            list.append("blue")
        else:
            pass
    elif 2000<=int(a[i])<=2399:
        if "brown" not in list:
            list.append("yellow")
        else:
            pass
    elif 2400<=int(a[i])<=2799:
        if "orange" not in list:
            list.append("orange")
        else:
            pass
    elif 2800<=int(a[i])<=3199:
        if "red" not in list:
            list.append("red")
        else:
            pass
    elif 3200<=int(a[i])<=4800:
        list_of_topcoder.append(i)

if len(list) != 0:
    print(len(list), len(list)+len(list_of_topcoder))
else:
    print(0, len(list_of_topcoder))

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
if count == 0 and a[8] > 0:
 count = 1
print(count,max)

Submission status: Wrong Answer

Solution code:
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.append(color // 400)
maxColor = len(colorList) + highLate
print(str(len(colorList)) + " " + str(maxColor))

Submission status: Wrong Answer

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

N=int(raw_input().strip())
a=map(int,raw_input().split())

b=[]
c=0
for i in a:
    if i>=1 and i<400*1:
        b.append(1)
    if i>=400*1 and i<400*2:
        b.append(2)
    if i>=400*2 and i<400*3:
        b.append(3)
    if i>=400*3 and i<400*4:
        b.append(4)
    if i>=400*4 and i<400*5:
        b.append(5)
    if i>=400*5 and i<400*6:
        b.append(6)
    if i>=400*6 and i<400*7:
        b.append(7)
    if i>=400*7 and i<400*8:
        b.append(8)
    if i>=3200:
        c+=1

mincolor=len(set(b))
maxcolor=min(mincolor+c,8)
print mincolor,
print maxcolor

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

print(color_contain)

if free_color == 0:
	min_ans = sum(color_contain)
	max_ans = sum(color_contain)
else:
    min_ans = max(1, sum(color_contain))
    max_ans = 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,min(8,sum(h)))
Max=min(8,Min+nu)

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

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

if r1==r2==r3==r4==r5==r6==r7==r8==0 :
    if 1<=r9<=8:
        p1=r9
        p2=1
    else:
        p1=8
        p2=1
else:
    p1=r1+r2+r3+r4+r5+r6+r7+r8+r9
    p2=r1+r2+r3+r4+r5+r6+r7+r8

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+e <= 8:
    print(d, d+e)
elif d+e > 8:
    print(d, 8)

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

    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(int(i) for i in input().split())

hai = 0
tya = 0
midori = 0
mizu = 0
ao = 0
ki = 0
daidai = 0
aka = 0

niji = 0

mincolor = 0
maxcolor = 0

for i in range(n):
    if 1 <= a[i] and a[i] <=399:
        hai = 1
    elif 400 <= a[i] and a[i] <= 799:
        tya = 1
    elif 800 <= a[i] and a[i] <= 1199:
        midori
    elif 1200 <= a[i] and a[i] <=1599:
        mizu = 1
    elif 1600 <= a[i] and a[i] <= 1999:
        ao = 1
    elif 2000 <= a[i] and a[i] <= 2399:
        ki = 1
    elif 2400 <= a[i] and a[i] <=2799:
        daidai = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        aka = 1
    elif 3200 <= a[i]:
        niji += 1

mincolor = hai + tya + midori + mizu + ao + ki + daidai + aka
maxcolor = mincolor

for i in range(niji):
    maxcolor += 1

if maxcolor >= 9:
    maxcolor = 8

print(mincolor, maxcolor)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
list = []
list_of_topcoder = []

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

if len(list) != 0:
    print(len(list), len(list)+len(list_of_topcoder))
else:
    print(0, len(list_of_topcoder))

Submission status: Wrong Answer

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

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 and d+e <= 8:
    print(d, d+e)
elif d !=8 and d+e > 8:
    print(d, 8)
else:
    print(d, d)

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 >= 8:
        c += 1
n_kind = [i for i in n if i<8]
a = len(set(n_kind))
print(a,a+c)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = input().split()
b = []
for ii in range(9):
    b.append(0)
for ii in range(N):
    if int(a[ii]) < 400:
        b[0] = b[0] + 1
    elif int(a[ii]) < 800:
        b[1] = b[1] + 1
    elif int(a[ii]) < 1200:
        b[2] = b[2] + 1
    elif int(a[ii]) < 1600:
        b[3] = b[3] + 1
    elif int(a[ii]) < 2000:
        b[4] = b[4] + 1
    elif int(a[ii]) < 2400:
        b[5] = b[5] + 1
    elif int(a[ii]) < 2800:
        b[6] = b[6] + 1
    elif int(a[ii]) < 3200:
        b[7] = b[7] + 1
    else:
        b[8] = b[8] + 1
min = 0
max = 0
for ii in range(8):
    if b[ii] > 0:
        min = min + 1
        max = max + 1
max = max + b[8]
print(str(min) + ' ' + str(max))

Submission status: Wrong Answer

Solution code:
n = input()
a = input()
tmp_a = a.split()
a_list = []
o_list = []
flag = 0

for i in range(int(n)):
    if int(tmp_a[i]) < 400:
        a_list.append("gray")
    elif 400 <= int(tmp_a[i]) and int(tmp_a[i]) < 800:
        a_list.append("brown")
    elif 800 <= int(tmp_a[i]) and int(tmp_a[i]) < 1200:
        a_list.append("green")
    elif 1200 <= int(tmp_a[i]) and int(tmp_a[i]) < 1600:
        a_list.append("sky")
    elif 1600 <= int(tmp_a[i]) and int(tmp_a[i]) < 2000:
        a_list.append("blue")
    elif 2000 <= int(tmp_a[i]) and int(tmp_a[i]) < 2400:
        a_list.append("yellow")
    elif 2400 <= int(tmp_a[i]) and int(tmp_a[i]) < 2800:
        a_list.append("orange")
    elif 2800 <= int(tmp_a[i]) and int(tmp_a[i]) < 3200:
        a_list.append("red")
    else:
        o_list.append("other")

n_other = len(o_list)

if len(a_list)==0:
    min_num = 1
else:
    min_num = len(set(a_list))

max_num = len(set(a_list))+n_other
if max_num > 8:
    max_num = 8

print(min_num, max_num)