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:
from collections import Counter
n = int(input())
xs = list(map(int, input().split()))

count = 9
def r2c(r):
    global count
    if r >= 3200:
        count += 1
        return (None, count)
    else:
        return (r//400 + 1, r//400+1)

x, y = zip(*map(r2c, xs))

print(len(Counter(filter(None, x))), len(Counter(y)))

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
xs = list(map(int, input().split()))

count = 8
def r2c(r):
    global count
    if r >= 3200:
        count += 1
        return (None, count)
    else:
        return (r//400, r//400)

x, y = zip(*map(r2c, xs))

print(len(Counter(filter(None, x))), len(Counter(filter(None, y))))

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int,input().split()))
color = [0] * 9

for i in range(N):
    if P[i] >= 3200:
        color[8] += 1
    elif 3200 > P[i] >= 2800:
        color[7] += 1
    elif 2800 > P[i] >= 2400:
        color[6] += 1
    elif 2400 > P[i] >= 2000:
        color[5] += 1
    elif 2000 > P[i] >= 1600:
        color[4] += 1
    elif 1600 > P[i] >= 1200:
        color[3] += 1
    elif 1200 > P[i] >= 800:
        color[2] += 1
    elif 800 > P[i] >= 400:
        color[1] += 1
    elif 400 > P[i]:
        color[0] += 1
        
if color[8] == 0:
    ans1 = 9 - color.count(0)
else:
    ans1 = 9 - color.count(0) - 1
ans2 = ans1 + color[8]

print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
cl = [0,0,0,0,0,0,0,0]
def classify(rate):
    if rate <= 399:
        return 0
    elif rate <= 799:
        return 1
    elif rate <= 1199:
        return 2
    elif rate <= 1599:
        return 3
    elif rate <= 1999:
        return 4
    elif rate <= 2399:
        return 5
    elif rate <= 2799:
        return 6
    elif rate <= 3199:
        return 7
    else:
        return 8

N = int(input())
L=input().split(' ')
Lint = []
c8=0
for i in L:
    rate = classify(int(i))
    if rate == 8:
        c8+=1
    else:
        cl[rate] = 1
q=0
for i in cl:
    if i == 0:
        q += 1
Cmax=8 - max(q-c8,0)
if q == 8:
    if c8 == 0:
        Cmin = 0
    else:
        Cmin = 1
else:
    Cmin = 8 - q
print(str(Cmin) + ' ' + str(Cmax))

Submission status: Wrong Answer

Solution code:
N=int(input())

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

T=[0]*9
for i in range(N):
    if S[i] < 400:
        T[0]+=1
    elif S[i] < 800:
        T[1]+=1
    elif S[i] < 1200:
        T[2]+=1
    elif S[i] < 1600:
        T[3]+=1
    elif S[i] < 2000:
        T[4]+=1
    elif S[i] < 2400:
        T[5]+=1
    elif S[i] < 2800:
        T[6]+=1
    elif S[i] < 3200:
        T[7]+=1
    elif S[i] >= 3200:
        T[8]+=1

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

if K>0:
    print(K,K+T[8])
else:
    print(T[8],T[8])

Submission status: Wrong Answer

Solution code:
N=int(input())

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

T=[0]*9
for i in range(N):
    if S[i] < 400 and S[i] >= 1:
        T[0]+=1
    elif S[i] < 800:
        T[1]+=1
    elif S[i] < 1200:
        T[2]+=1
    elif S[i] < 1600:
        T[3]+=1
    elif S[i] < 2000:
        T[4]+=1
    elif S[i] < 2400:
        T[5]+=1
    elif S[i] < 2800:
        T[6]+=1
    elif S[i] < 3200:
        T[7]+=1
    elif S[i] >= 3200:
        T[8]+=1

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


if K<8:
    if T[8]<=8:
        print(K,K+T[8])
    else:
        print(K,K+8)
else:
    print(K,K)

Submission status: Wrong Answer

Solution code:
N=int(input())

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

T=[0]*9
for i in range(N):
    if S[i] < 400 and S[i] >= 1:
        T[0]+=1
    elif S[i] < 800:
        T[1]+=1
    elif S[i] < 1200:
        T[2]+=1
    elif S[i] < 1600:
        T[3]+=1
    elif S[i] < 2000:
        T[4]+=1
    elif S[i] < 2400:
        T[5]+=1
    elif S[i] < 2800:
        T[6]+=1
    elif S[i] < 3200:
        T[7]+=1
    elif S[i] >= 3200:
        T[8]+=1

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


if K!=8:
    if T[8]<=8:
        print(K,K+T[8])
    else:
        print(K,K+8)
else:
    print(K,K)

Submission status: Wrong Answer

Solution code:
N=int(input())

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

T=[0]*9
for i in range(N):
    if S[i] < 400:
        T[0]+=1
    elif S[i] < 800:
        T[1]+=1
    elif S[i] < 1200:
        T[2]+=1
    elif S[i] < 1600:
        T[3]+=1
    elif S[i] < 2000:
        T[4]+=1
    elif S[i] < 2400:
        T[5]+=1
    elif S[i] < 2800:
        T[6]+=1
    elif S[i] < 3200:
        T[7]+=1
    else:
        T[8]+=1

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

if K!=8:
    print(K,K+T[8])
else:
    print(K,K)

Submission status: Wrong Answer

Solution code:
N=int(input())

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

T=[0]*9
for i in range(N):
    if S[i] < 400:
        T[0]+=1
    elif S[i] < 800:
        T[1]+=1
    elif S[i] < 1200:
        T[2]+=1
    elif S[i] < 1600:
        T[3]+=1
    elif S[i] < 2000:
        T[4]+=1
    elif S[i] < 2400:
        T[5]+=1
    elif S[i] < 2800:
        T[6]+=1
    elif S[i] < 3200:
        T[7]+=1
    else:
        T[8]+=1

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

print(K,K+T[8])

Submission status: Wrong Answer

Solution code:
N=int(input())

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

T=[0]*9
for i in range(N):
    if S[i] < 400:
        T[0]+=1
    elif S[i] < 800:
        T[1]+=1
    elif S[i] < 1200:
        T[2]+=1
    elif S[i] < 1600:
        T[3]+=1
    elif S[i] < 2000:
        T[4]+=1
    elif S[i] < 2400:
        T[5]+=1
    elif S[i] < 2800:
        T[6]+=1
    elif S[i] < 3200:
        T[7]+=1
    elif S[i] >= 3200:
        T[8]+=1

K=0
for i in range(9):
    if T[i] >= 1:
        K+=1

print(K,K+T[8])

Submission status: Wrong Answer

Solution code:
N=int(input())

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

T=[0]*8
for i in range(N):
    if S[i] < 400:
        T[0]+=1
    elif S[i] < 800:
        T[1]+=1
    elif S[i] < 1200:
        T[2]+=1
    elif S[i] < 1600:
        T[3]+=1
    elif S[i] < 2000:
        T[4]+=1
    elif S[i] < 2400:
        T[5]+=1
    elif S[i] < 2800:
        T[6]+=1
    elif S[i] >= 3200:
        T[7]+=1

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

print(K,K+T[7])

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
found = set()
f = 0
for i in l:
  if i <= 399:
    found.add("灰色")
  elif i <= 799:
    found.add("茶色")
  elif i <= 1199:
    found.add("緑色")
  elif i <= 1599:
    found.add("水色")
  elif i <= 1999:
    found.add("青色")
  elif i <= 2399:
    found.add("黄色")
  elif i <= 2799:
    found.add("橙色")
  elif i <= 3199:
    found.add("赤色")
  else:
    f += 1
if len(found) == 0:
  print(1, min(f, 8))
elif len(found) + f > 8:
   print(len(found), 8)
else:
  print(len(found), len(found) + f)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
found = set()
f = 0
for i in l:
  if i <= 399:
    found.add("灰色")
  elif i <= 799:
    found.add("茶色")
  elif i <= 1199:
    found.add("緑色")
  elif i <= 1599:
    found.add("水色")
  elif i <= 1999:
    found.add("青色")
  elif i <= 2399:
    found.add("黄色")
  elif i <= 2799:
    found.add("橙色")
  elif i <= 3199:
    found.add("赤色")
  else:
    f += 1
if len(found) == 0:
  print(1, min(i, 8))
elif len(found) + f > 8:
   print(len(found), 8)
else:
  print(len(found), len(found) + f)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
found = set()
f = 0
for i in l:
  if i <= 399:
    found.add("灰色")
  elif i <= 799:
    found.add("茶色")
  elif i <= 1199:
    found.add("緑色")
  elif i <= 1599:
    found.add("水色")
  elif i <= 1999:
    found.add("青色")
  elif i <= 2399:
    found.add("黄色")
  elif i <= 2799:
    found.add("橙色")
  elif i <= 3199:
    found.add("赤色")
  else:
    f += 1
if len(found) == 0:
  print(1, 1)
elif len(found) + f > 8:
   print(len(found), 8)
else:
  print(len(found), len(found) + f)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
found = set()
f = 0
for i in l:
  if i <= 399:
    found.add("灰色")
  elif i <= 799:
    found.add("茶色")
  elif i <= 1199:
    found.add("緑色")
  elif i <= 1599:
    found.add("水色")
  elif i <= 1999:
    found.add("青色")
  elif i <= 2399:
    found.add("黄色")
  elif i <= 2799:
    found.add("橙色")
  elif i <= 3199:
    found.add("赤色")
  else:
    f += 1

if len(found) + f > 8:
   print(len(found), 8)
else:
  print(len(found), len(found) + f)

Submission status: Wrong Answer

Solution code:
ignore = input()
l = map(int, raw_input().split())
temp = []
counter = 0
if ignore == 1:
    print 1, 1
    exit()
for i in range(len(l)):
    if (1 <= l[i] <= 399) and ("Grey" not in temp):
        temp.append("Grey")
    elif (400 <= l[i] <= 799) and ("Brown" not in temp):
        temp.append("Brown")
    elif (800 <= l[i] <= 1199) and ("Green" not in temp):
        temp.append("Green")
    elif (1200 <= l[i] <= 1599) and ("Water" not in temp):
        temp.append("Water")
    elif (1600 <= l[i] <= 1999) and ("Blue" not in temp):
        temp.append("Blue")
    elif (2000 <= l[i] <= 2399) and ("Yellow" not in temp):
        temp.append("Yellow")
    elif (2400 <= l[i] <= 2799) and ("Turq" not in temp):
        temp.append("Turq")
    elif (2800 <= l[i] <= 3199) and ("Red" not in temp):
        temp.append("Red")
    elif (l[i] >= 3200):
        counter+=1
if counter == 0:
    print len(temp), len(temp)
else:
    print len(temp), (len(temp) + counter)

Submission status: Wrong Answer

Solution code:
ignore = input()
l = map(int, raw_input().split())
temp = []
counter = 0
for i in range(len(l)):
    if (1 <= l[i] <= 399) and ("Grey" not in temp):
        temp.append("Grey")
    elif (400 <= l[i] <= 799) and ("Brown" not in temp):
        temp.append("Brown")
    elif (800 <= l[i] <= 1199) and ("Green" not in temp):
        temp.append("Green")
    elif (1200 <= l[i] <= 1599) and ("Water" not in temp):
        temp.append("Water")
    elif (1600 <= l[i] <= 1999) and ("Blue" not in temp):
        temp.append("Blue")
    elif (2000 <= l[i] <= 2399) and ("Yellow" not in temp):
        temp.append("Yellow")
    elif (2400 <= l[i] <= 2799) and ("Turq" not in temp):
        temp.append("Turq")
    elif (2800 <= l[i] <= 3199) and ("Red" not in temp):
        temp.append("Red")
    elif (l[i] >= 3200):
        counter+=1
if counter == 0:
    print len(temp), len(temp)
else:
    print len(temp), (len(temp) + counter)

Submission status: Wrong Answer

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

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

print(con, con+var)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split(' ')))
A.sort()
count=0
s=0

for i in A:
    print(i)
    if 1<=i<400:
        count +=1
        i=400
        continue
    elif 400<=i<800:
        count +=1
        i=800
        continue
    elif 800<=i<1200:
        count +=1
        i=1200
        continue
    elif 1200<=i<1600:
        count +=1
        i=1600
        continue
    elif 1600<=i<2000:
        count +=1
        i=2000
        continue
    elif 2000<=i<2400:
        count +=1
        i=2400
        continue
    elif 2400<=i<2800:
        count +=1
        i=2800
        continue
    elif 2800<=i<3200:
        count +=1
        i=3200
        continue
    elif 3200<=i<=4800:
        count +=1
        s +=1
        continue
    else:
        break
ss=[int(count)-2, int(count+s)-2]

print(" ".join(map(str, ss)))

Submission status: Wrong Answer

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

base=0
counter=0
min_counter=0
scores=[3200, 2800, 2400, 2000, 1600, 1200, 800, 400, 1]
N=int(input())
a=[ int(i) for i in input().split() ]
a.sort()

for i in range(1, len(scores)):
    for j in range(0, N):
        if(scores[i-1]>a[j] and a[j]>=scores[i]):
            # print("scores[i]", scores[i], "a[j]", a[j])
            counter+=1
            break;

for i in range(0, len(a)):
    if(a[i]>=3200):
        min_counter+=1

if(len(set(a))==1 and a[0]>=3200):
    base+=1

if(len(scores)-1==counter):
    min_counter+=1

print(base+counter, counter+min_counter)

Submission status: Wrong Answer

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

base=0
counter=0
min_counter=0
scores=[3200, 2800, 2400, 2000, 1600, 1200, 800, 400, 1]
N=int(input())
a=[ int(i) for i in input().split() ]
a.sort()

for i in range(1, len(scores)):
    for j in range(0, N):
        if(scores[i-1]>a[j] and a[j]>=scores[i]):
            # print("scores[i]", scores[i], "a[j]", a[j])
            counter+=1
            break;

for i in range(0, len(a)):
    if(a[i]>=3200):
        min_counter+=1

if(len(set(a))==1 and a[0]>=3200):
    base+=1

print(base+counter, counter+min_counter)

Submission status: Wrong Answer

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

base=0
counter=0
min_counter=0
scores=[3200, 2800, 2400, 2000, 1600, 1200, 800, 400, 1]
N=int(input())
a=[ int(i) for i in input().split() ]
a.sort()

for i in range(1, len(scores)):
    for j in range(0, N):
        if(scores[i-1]>a[j] and a[j]>=scores[i]):
            # print("scores[i]", scores[i], "a[j]", a[j])
            counter+=1
            break;

for i in range(0, len(a)):
    if(a[i]>=3200):
        min_counter+=1

if(len(set(a))==1):
    base+=1

print(base+counter, counter+min_counter)

Submission status: Wrong Answer

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

counter=0
min_counter=0
scores=[3200, 2800, 2400, 2000, 1600, 1200, 800, 400, 1]
N=int(input())
a=[ int(i) for i in input().split() ]
a.sort()

for i in range(1, len(scores)):
    for j in range(0, N):
        if(scores[i-1]>a[j] and a[j]>=scores[i]):
            # print("scores[i]", scores[i], "a[j]", a[j])
            counter+=1
            break;

for i in range(0, len(a)):
    if(a[i]>=3200):
        min_counter+=1

print(counter, counter+min_counter)

Submission status: Wrong Answer

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

def labeling(A):
    # ラベル数は9
    label = [0] * 9
    
    for i in A:
        if (0 <= i) and (i < 400):
            label[0] += 1
        elif (400 <= i) and (i < 800):
            label[1] += 1
        elif (800 <= i) and (i < 1200):
            label[2] += 1
        elif (1200 <= i) and (i < 1600):
            label[3] += 1
        elif (1600 <= i) and (i < 2000):
            label[4] += 1
        elif (2000 <= i) and (i < 2400):
            label[5] += 1
        elif (2400 <= i) and (i < 2800):
            label[6] += 1
        elif (2800 <= i) and (i < 3200):
            label[7] += 1
        else:
            label[8] += 1

    return label

label = labeling(A)
label_number = 0

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

print(max(label_number, 1), min(8, (label_number+label[-1])))

Submission status: Wrong Answer

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

def labeling(A):
    # ラベル数は9
    label = [0] * 9
    
    for i in A:
        if (0 <= i) and (i < 400):
            label[0] += 1
        elif (400 <= i) and (i < 800):
            label[1] += 1
        elif (800 <= i) and (i < 1200):
            label[2] += 1
        elif (1200 <= i) and (i < 1600):
            label[3] += 1
        elif (1600 <= i) and (i < 2000):
            label[4] += 1
        elif (2000 <= i) and (i < 2400):
            label[5] += 1
        elif (2400 <= i) and (i < 2800):
            label[6] += 1
        elif (2800 <= i) and (i < 3200):
            label[7] += 1
        else:
            label[8] += 1

    return label

label = labeling(A)
label_number = 0

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

print(label_number, min(8, (label_number+label[-1])))

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right as br
a = range(400, 3201, 400)
minn, maxx = 0, 0
n, s = input(), map(int, raw_input().split())
d = {k: 0 for k in xrange(9)}
for e in s:
    d[br(a, e)] += 1
minn = sum([1 for k in d if d[k] and k != 8])
if not minn:
    minn = 1
    maxx = min(8, d[8])
else:
    maxx = min(8, d[8] + minn)
print minn, maxx

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right as br
a = range(400, 3201, 400)
minn, maxx = 0, 0
n, s = input(), map(int, raw_input().split())
d = {k: 0 for k in xrange(9)}
for e in s:
    d[br(a, e)] += 1
minn = sum([1 for v in d.values() if v])
maxx = minn
if d[8]:
    if minn > 1:
        minn -= 1
    if d[8] <= 8:
        maxx += (d[8] - 1)
    else:
        maxx += 7
print minn, maxx

Submission status: Wrong Answer

Solution code:
num = int(input())

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

dict = {"rainbow":0, "red":0, "orange":0, "yellow":0, "blue":0, "water":0, "green":0, "brown":0, "gray":0}
for i in rate:
    if i >= 3200:
        dict["rainbow"] += 1
    elif i >= 2800:
        dict["red"] = 1
    elif i >= 2400:
        dict["orange"]= 1
    elif i >= 2000:
        dict["yellow"] = 1
    elif i >= 1600:
        dict["blue"] += 1
    elif i >= 1200:
        dict["water"] = 1
    elif i >= 800:
        dict["green"] = 1
    elif i >= 400:
        dict["brown"] = 1
    elif i >= 0:
        dict["gray"] = 1

color = 0
rainbow = 0
for item, value in dict.items():
    if value > 0 and item != "rainbow":
        color += 1

color_min = color if color != 0 else 1
color_max = color if dict["rainbow"] == 0 else color + dict["rainbow"]

if color_max > 8:
    color_max = 8

print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
num = int(input())

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

dict = {"rainbow":0, "red":0, "orange":0, "yellow":0, "blue":0, "water":0, "green":0, "brown":0, "gray":0}
for i in rate:
    if i >= 3200:
        dict["rainbow"] += 1
    elif i >= 2800:
        dict["red"] = 1
    elif i >= 2400:
        dict["orange"]= 1
    elif i >= 2000:
        dict["yellow"] = 1
    elif i >= 1600:
        dict["blue"] += 1
    elif i >= 1200:
        dict["water"] = 1
    elif i >= 800:
        dict["green"] = 1
    elif i >= 400:
        dict["brown"] = 1
    elif i >= 0:
        dict["gray"] = 1

color = 0
rainbow = 0
for item, value in dict.items():
    print(item, value)
    if value > 0 and item != "rainbow":
        color += 1

color_min = color if color != 0 else 1
color_max = color if dict["rainbow"] == 0 else color + dict["rainbow"]

if color_max > 8:
    color_max = 8

print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
num = int(input())

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

dict = {"rainbow":0, "red":0, "orange":0, "yellow":0, "blue":0, "water":0, "green":0, "brown":0, "gray":0}
for i in rate:
    if i >= 3200:
        dict["rainbow"] += 1
    if i >= 2800:
        dict["red"] = 1
    elif i >= 2400:
        dict["orange"]= 1
    elif i >= 2000:
        dict["yellow"] = 1
    elif i >= 1600:
        dict["blue"] += 1
    elif i >= 1200:
        dict["water"] = 1
    elif i >= 800:
        dict["green"] = 1
    elif i >= 400:
        dict["brown"] = 1
    elif i >= 0:
        dict["gray"] = 1

color = 0
rainbow = 0
for i, j in dict.items():
    if j > 0 and i != "rainbow":
        color += 1

color_min = color if color != 0 else 1
color_max = color if dict["rainbow"] == 0 else color+ dict["rainbow"]

if color_max > 8:
    color_max = 8

print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
rate = [0] * 9
for ai in a:
    if ai < 400:
        rate[0] = 1
    elif ai < 800:
        rate[1] = 1
    elif ai < 1200:
        rate[2] = 1
    elif ai < 1600:
        rate[3] = 1
    elif ai < 2000:
        rate[4] = 1
    elif ai < 2400:
        rate[5] = 1
    elif ai < 2800:
        rate[6] = 1
    elif ai < 3200:
        rate[7] = 1
    else:
        rate[8] += 1

if rate[8]:
    if sum(rate[:8]) == 0:
        print(1, rate[8])
    else:
        maxv = min(rate[8], len(list(filter(lambda x: x == 0, rate))))
        minv = sum(rate[:8])
        print(minv, minv + maxv)
else:
    ans = sum(rate)
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
rate = [0] * 9
for ai in a:
    if ai < 400:
        rate[0] = 1
    elif ai < 800:
        rate[1] = 1
    elif ai < 1200:
        rate[2] = 1
    elif ai < 1600:
        rate[3] = 1
    elif ai < 2000:
        rate[4] = 1
    elif ai < 2400:
        rate[5] = 1
    elif ai < 2800:
        rate[6] = 1
    elif ai < 3200:
        rate[7] = 1
    else:
        rate[8] += 1

if rate[8]:
    if sum(rate[:8]) == 0:
        print(rate[8], rate[8])
    else:
        maxv = min(rate[8], len(list(filter(lambda x: x == 0, rate))))
        minv = sum(rate[:8])
        print(minv, minv + maxv)
else:
    ans = sum(rate)
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
rate = [0] * 9
for ai in a:
    if ai < 400:
        rate[0] = 1
    elif ai < 800:
        rate[1] = 1
    elif ai < 1200:
        rate[2] = 1
    elif ai < 1600:
        rate[3] = 1
    elif ai < 2000:
        rate[4] = 1
    elif ai < 2400:
        rate[5] = 1
    elif ai < 2800:
        rate[6] = 1
    elif ai < 3200:
        rate[7] = 1
    else:
        rate[8] += 1

if rate[8]:
    maxv = min(rate[8], len(list(filter(lambda x: x == 0, rate))))
    minv = sum(rate[:8])
    print(minv, minv + maxv)
else:
    ans = sum(rate)
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
gray = 0
brown = 0
green = 0
lightblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
rainbow = 0
for i in range(n):
	if a[i]<=399:
		gray += 1
	elif a[i]<=799:
		brown += 1
	elif a[i]<=1199:
		green += 1
	elif a[i]<=1599:
		lightblue += 1
	elif a[i]<=1999:
		blue += 1
	elif a[i]<=2399:
		yellow += 1
	elif a[i]<=2799:
		orange += 1
	elif a[i]<=3199:
		red += 1
	else:
		rainbow += 1
counter = 0
max = 0
min = 0
if gray>=1:
	counter += 1
if brown>=1:
	counter += 1
if green>=1:
	counter += 1
if lightblue>=1:
	counter += 1
if blue>=1:
	counter += 1
if yellow>=1:
	counter += 1
if orange>=1:
	counter += 1
if red>=1:
	counter += 1
if counter >= 1 and (rainbow + counter)<=8:
	min = counter
	max = counter + rainbow
elif counter == 0:
	min = 1
	if rainbow <= 8:
		max = rainbow
	else:
		max = 8
else:
	min = counter
	max = 8
print('{0} {1}'.format(min,max))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
gray = 0
brown = 0
green = 0
lightblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
rainbow = 0
for i in range(n):
	if a[i]<=399:
		gray += 1
	elif a[i]<=799:
		brown += 1
	elif a[i]<=1199:
		green += 1
	elif a[i]<=1599:
		lightblue += 1
	elif a[i]<=1999:
		blue += 1
	elif a[i]<=2399:
		yellow += 1
	elif a[i]<=2799:
		orange += 1
	elif a[i]<=3199:
		red += 1
	else:
		rainbow += 1
counter = 0
max = 0
min = 0
if gray>=1:
	counter += 1
if brown>=1:
	counter += 1
if green>=1:
	counter += 1
if lightblue>=1:
	counter += 1
if blue>=1:
	counter += 1
if yellow>=1:
	counter += 1
if orange>=1:
	counter += 1
if red>=1:
	counter += 1
if (rainbow + counter)<=8:
	min = counter
	max = counter + rainbow
else:
	min = counter
	max = 8
print('{0} {1}'.format(min,max))

Submission status: Wrong Answer

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

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

N = int (raw_input ())
l = [int (i) for i in raw_input ().split ()]

d = defaultdict (int)
c = 0
for i in l:
    if i < 400: d ["gray"] += 1
    if i < 800: d ["brown"] += 1
    elif i < 1200: d ["green"] += 1
    elif i < 1600: d ["cyan"] += 1
    elif i < 2000: d ["blue"] += 1
    elif i < 2400: d ["yellow"] += 1
    elif i < 2800: d ["orange"] += 1
    elif i < 3200: d ["red"] += 1
    else: c += 1

print max (1, len (d.keys ())), len (d.keys ()) + c

Submission status: Wrong Answer

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

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

N = int (raw_input ())
l = [int (i) for i in raw_input ().split ()]

d = defaultdict (int)
c = 0
for i in l:
    if i < 400: d ["gray"] += 1
    elif i < 1200: d ["brown"] += 1
    elif i < 1600: d ["green"] += 1
    elif i < 2000: d ["blue"] += 1
    elif i < 2400: d ["yellow"] += 1
    elif i < 2800: d ["orange"] += 1
    elif i < 3200: d ["red"] += 1
    else: c += 1

# print d
# x = sum (1 for i in d if not i.startswith ("*"))
# y = sum (1 for i in d if i.startswith ("*"))
# print max (1, len (d.keys ())), min (8, len (d.keys ()) + c)
x = len (d.keys ())
y = 0
if c > 0: y = 1
print max (x, y), x + c

Submission status: Wrong Answer

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

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

N = int (raw_input ())
l = [int (i) for i in raw_input ().split ()]

d = defaultdict (int)
c = 0
for i in l:
    if i < 400: d ["gray"] += 1
    elif i < 1200: d ["brown"] += 1
    elif i < 1600: d ["green"] += 1
    elif i < 2000: d ["blue"] += 1
    elif i < 2400: d ["yellow"] += 1
    elif i < 2800: d ["orange"] += 1
    elif i < 3200: d ["red"] += 1
    else: c += 1

print max (1, len (d.keys ())), min (8, len (d.keys ()) + c)

Submission status: Wrong Answer

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

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

N = int (raw_input ())
l = [int (i) for i in raw_input ().split ()]

d = defaultdict (int)
c = 0
for i in l:
    if i < 400: d ["gray"] += 1
    elif i < 1200: d ["brown"] += 1
    elif i < 1600: d ["green"] += 1
    elif i < 2000: d ["blue"] += 1
    elif i < 2400: d ["yellow"] += 1
    elif i < 2800: d ["orange"] += 1
    elif i < 3200: d ["red"] += 1
    else: c += 1

print max (1, len (d.keys ())), len (d.keys ()) + c

Submission status: Wrong Answer

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

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

N = int (raw_input ())
l = [int (i) for i in raw_input ().split ()]

d = defaultdict (int)
c = 0
for i in l:
    if i < 400: d ["gray"] += 1
    elif i < 1200: d ["brown"] += 1
    elif i < 1600: d ["green"] += 1
    elif i < 2000: d ["blue"] += 1
    elif i < 2400: d ["yellow"] += 1
    elif i < 2800: d ["orange"] += 1
    elif i < 3200: d ["red"] += 1
    else: c += 1

print len (d.keys ()), len (d.keys ()) + c

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
    n = input()
    a = readLine_int_list()

    c = []
    _c = [] 
    f = False

    for i in a:
        rank = i//400
        if rank == 8:
           _c.append(rank) 
        else:    
            c.append(rank)
    
    
    p = len(set(c))
    print(max(1,p), p+len(_c))

        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
    n = input()
    a = readLine_int_list()

    c = []
    _c = [] 
    f = False

    for i in a:
        rank = i//400
        if rank == 8:
           _c.append(rank) 
        else:    
            c.append(rank)
    
    
    p = len(set(c))

    
    if p == 0:
        p = 1
        print(p, min(8, len(_c)))
    else:
        print(p, min(8, p+len(_c)))

        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
    n = input()
    a = readLine_int_list()

    c = []
    _c = [] 
    f = False

    for i in a:
        rank = i//400
        if rank == 8:
           _c.append(rank) 
        else:    
            c.append(rank)
    
    
    p = len(set(c))

    
    if p == 0:
        p = 1
        print(p, min(7, len(_c)))
    else:
        print(p, min(7, p+len(_c)))

        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
    n = input()
    a = readLine_int_list()

    c = []
    _c = [] 
    f = False

    for i in a:
        rank = i//400
        if rank == 8:
           _c.append(rank) 
        else:    
            c.append(rank)
    
    
    p = len(set(c))
    any_col = min(7, len(_c))
    
    if p == 0:
        p = 1
        print(p, p + any_col-1)
    else:
        print(p, min(7, p+any_col))

        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
    n = input()
    a = readLine_int_list()

    c = []
    _c = [] 
    f = False

    for i in a:
        rank = i//400
        if rank == 8:
           _c.append(rank) 
        else:    
            c.append(rank)
    
    
    p = len(set(c))
    any_col = len(_c)
    
    if p == 0:
        p = 1
        print(p, p + any_col-1)
    else:
        print(p, p+any_col)

    
        
if __name__ == "__main__":
    main()