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:
N = int(input())
a = list(map(int, input().split()))
A = [0 for i in range(8)]
b = 0
for i in range(N):
  if a[i] < 400:
    A[0] = 1
  elif a[i] < 800:
    A[1] = 1
  elif a[i] < 1200:
    A[2] = 1
  elif a[i] < 1600:
    A[3] = 1
  elif a[i] < 2000:
    A[4] = 1
  elif a[i] < 2400:
    A[5] = 1
  elif a[i] < 2800:
    A[6] = 1
  elif a[i] < 3200:
    A[7] = 1
  else:
    b += 1
ans1 = sum(A)
ans2 = ans1 + b
if ans2 > 7:
  ans2 = 8
print(ans1, ans2, sep=' ')

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
c = []
other = 0
for a in A:
    if a< 400:c.append(1)
    elif a < 800: c.append(2)
    elif a < 1200: c.append(3)
    elif a < 1600: c.append(4)
    elif a < 2400: c.append(5)
    elif a < 2800: c.append(6)
    elif a < 3200: c.append(7)
    else: other+=1
c = set(c)
if c: print(len(c), len(c)+other)
else: print(1, other)

Submission status: Wrong Answer

Solution code:
N = int(input())
As = list(map(lambda x: int(x)//400, input().split()))

As_other = [a for a in As if a<8]
reds = len(As)-len(As_other)

print(len(set(As_other)), len(set(As_other))+reds)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
c = []
other = 0
for a in A:
    if a< 400:c.append(1)
    elif  a < 800: c.append(2)
    elif a < 1200: c.append(3)
    elif a < 1600: c.append(4)
    elif a < 2400: c.append(5)
    elif a < 2800: c.append(6)
    elif a < 3200: c.append(7)
    else: other+=1
if not c:print(1, other)
else: print(len(set(c)), len(set(c))+other)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

c = []
color = 0
for i in a:
    if 1 <= i <= 399:
        c.append(1)
    elif 400 <= i <= 799:
        c.append(2)
    elif 800 <= i <= 1199:
        c.append(3)
    elif 1200 <= i <= 1599:
        c.append(4)
    elif 1600 <= i <= 1999:
        c.append(5)
    elif 2000 <= i <= 2399:
        c.append(6)
    elif 2400 <= i <= 2799:
        c.append(7)
    elif 2800 <= i <= 3199:
        c.append(8)
    else:
        color += 1
c = set(c)

if color and N != 1:
    print(len(c),len(c)+color)
elif color:
    print(len(c),len(c))
else:
    print(len(c),len(c))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

c = []
color = 0
for i in a:
    if 1 <= i <= 399:
        c.append(1)
    elif 400 <= i <= 799:
        c.append(2)
    elif 800 <= i <= 1199:
        c.append(3)
    elif 1200 <= i <= 1599:
        c.append(4)
    elif 1600 <= i <= 1999:
        c.append(5)
    elif 2000 <= i <= 2399:
        c.append(6)
    elif 2400 <= i <= 2799:
        c.append(7)
    elif 2800 <= i <= 3199:
        c.append(8)
    else:
        color += 1
c = set(c)

if color :
    print(len(c),len(c)+color)
else:
    print(len(c),len(c))

Submission status: Wrong Answer

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

c = set()
k = 0
min_c = 1
max_c = 1
for i in range(n):
  if 1 <= a[i] <= 399:
    c.add(1)
  elif 400 <= a[i] <= 799:
    c.add(2)
  elif 800 <= a[i] <= 1199:
    c.add(3)
  elif 1200 <= a[i] <= 1599:
    c.add(4)
  elif 1600 <= a[i] <= 1999:
    c.add(5)
  elif 2000 <= a[i] <= 2399:
    c.add(6)
  elif 2400 <= a[i] <= 2799:
    c.add(7)
  elif 2800 <= a[i] <= 3199:
    c.add(8)
  elif a[i] >= 3200:
    k += 1

min_c = len(list(c))
max_c = len(list(c)) + k
print(min_c, max_c)

Submission status: Wrong Answer

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

c = set()
k = 0
min_c = 1
max_c = 1
for i in range(n):
  if 1 <= a[i] <= 399:
    c.add(1)
  elif 400 <= a[i] <= 799:
    c.add(2)
  elif 800 <= a[i] <= 1199:
    c.add(3)
  elif 1200 <= a[i] <= 1599:
    c.add(4)
  elif 1600 <= a[i] <= 1999:
    c.add(5)
  elif 2000 <= a[i] <= 2399:
    c.add(6)
  elif 2400 <= a[i] <= 2799:
    c.add(7)
  elif 2800 <= a[i] <= 3199:
    c.add(8)
  elif a[i] >= 3200:
    k += 1
if k == 0:
  min_c = len(list(c))
  max_c = len(list(c))
else:
  min_c = len(list(c))
  max_c = len(list(c)) + k
print(min_c, max_c)

Submission status: Wrong Answer

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

c = set()
k = 0
min_c = 1
max_c = 1
for i in range(n):
  if 1 <= a[i] <= 399:
    c.add(1)
  elif 400 <= a[i] <= 799:
    c.add(2)
  elif 800 <= a[i] <= 1199:
    c.add(3)
  elif 1200 <= a[i] <= 1599:
    c.add(4)
  elif 1600 <= a[i] <= 1999:
    c.add(5)
  elif 2000 <= a[i] <= 2399:
    c.add(6)
  elif 2400 <= a[i] <= 2799:
    c.add(7)
  elif 2800 <= a[i] <= 3199:
    c.add(8)
  elif a[i] >= 3200:
    k += 1
if k == 0:
  min_c = len(list(c))
  max_c = len(list(c))
else:
  min_c = len(list(c))
  max_c = len(list(c)) + k
  if max_c > 8:
    max_c = 8
print(min_c, max_c)

Submission status: Wrong Answer

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

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

if special==0:
    print(variety,variety)
elif variety==0:
    print(1,min(special,8))
else:
    print(variety,min(variety+special,8))

Submission status: Wrong Answer

Solution code:
def check(score):
  if score >= 3200:
    return -1
  for i,rating in enumerate(scores):
    if rating[0] <= score <= rating[1]:
      return i
n = int(input())
a = list(map(int,input().split()))
thopes = 0
colors = set()
scores = [(1,399),(400,799),(800,1199),(1200,1599),(1600,1999),(2000,2399),(2400,2799),(2800,3199)]
for score in a:
  ind = check(score)
  if ind==-1:
    thopes+=1
  else:
    colors.add(ind)
n = len(colors)
print(n,thopes+n)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
temp=[0,0,0,0,0,0,0,0]
r=0
for i in range(n):
  if a[i]>=3200:
    r=r+1
  elif a[i]>=2800:
    temp[7]=1
  elif a[i]>=2400:
    temp[6]=1
  elif a[i]>=2000:
    temp[5]=1
  elif a[i]>=1600:
    temp[4]=1
  elif a[i]>=1200:
    temp[3]=1
  elif a[i]>=800:
    temp[2]=1
  elif a[i]>=400:
    temp[1]=1
  else:
    temp[0]=1
print(sum(temp),sum(temp)+r)

Submission status: Wrong Answer

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

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=7:
    over += 1
  else:
    rate.append(x[i]//400)
elem = len(set(rate))

_min = elem
_max = elem +over
if elem  == 0:
  _min = 1
if elem + over >=8:
  _max = 8 

print(str(_min),str(_max))

Submission status: Wrong Answer

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

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
elem = len(set(rate))

_min = elem
_max = elem +over
if elem  == 0:
  _min = 1
if elem + over >=8:
  _max = 8 

print(str(_min),str(_max))

Submission status: Wrong Answer

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

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
elem = len(set(rate))

_min = elem
_max = elem +over
if elem  == 0:
  _min = 1
elif elem + over >=8:
  _max = 8 

print(str(_min),str(_max))

Submission status: Wrong Answer

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

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
result = ""
elem = len(set(rate))
if elem >= 8:
  result = "8 8"
elif elem + over >=8:
  result = str(elem) +" " +"8"
else:
  result = str(elem)+" "+ str(elem + over)
print(result)

Submission status: Wrong Answer

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

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
result = ""
if len(set(rate)) + over >=8:
  result = str(len(set(rate))) +" " +"8"
else:
  result = str(len(set(rate)))+" "+ str(len(set(rate)) + over)
print(result)

Submission status: Wrong Answer

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

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
if len(set(rate)) + over >=8:
  print(str(len(set(rate))) +" 8")
  exit()
else:
  print(str(len(set(rate)))+" "+ str(len(set(rate)) + over))

Submission status: Wrong Answer

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

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
if len(set(rate)) + over >=8:
  print(len(set(rate)), 8)
  exit()
else:
  print(len(set(rate)),len(set(rate)) + over)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
k=[0]*8
s=0
for i in a:
    if i<400:
        k[0]+=1
    elif i<800:
        k[1]+=1
    elif i<1200:
        k[2]+=1
    elif i<1600:
        k[3]+=1
    elif i<2000:
        k[4]+=1
    elif i<2400:
        k[5]+=1
    elif i<2800:
        k[6]+=1
    elif i<3200:
        k[7]+=1
    else:
        s+=1
b=8-k.count(0)
c=b+s
print(str(b)+" "+str(c))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
k=[0]*8
s=0
for i in a:
    if i<400:
        k[0]+=1
    elif i<800:
        k[1]+=1
    elif i<1200:
        k[2]+=1
    elif i<1600:
        k[3]+=1
    elif i<2000:
        k[4]+=1
    elif i<2400:
        k[5]+=1
    elif i<2800:
        k[6]+=1
    elif i<3200:
        k[7]+=1
    else:
        s+=1
b=8-k.count(0)
c=b+s
if b+s>=8:
    c=8
print(str(b)+" "+str(c))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
for i in a:
  b[min(i//400,8)]+=1
print(max(8-b[:8].count(0),1),min(8-b[:8].count(0)+b[8],8))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
for i in a:
  b[min(i//400,8)]+=1
print(8-b[:8].count(0),min(8-b[:8].count(0)+b[8],8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
gray = 399
brown = 799
green = 1199
lblue = 1599
blue = 1999
yellow = 2399
orange = 2799
red = 3199
count = 0
result = [0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
    if 0 < i <= gray:
        result[0] += 1
    elif gray < i <= brown:
        result[1] += 1
    elif brown < i <= green:
        result[2] += 1
    elif green < i <= lblue:
        result[3] += 1
    elif lblue < i <= blue:
        result[4] += 1
    elif blue < i <= yellow:
        result[5] += 1
    elif yellow < i <= orange:
        result[6] += 1
    elif orange < i <= red:
        result[7] += 1
    else:
        count += 1
minout = sum(i>0 for i in result)
maxout = minout + count
if minout == 0:
    minout = 1
print(minout, maxout)
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
gray = 399
brown = 799
green = 1199
lblue = 1599
blue = 1999
yellow = 2399
orange = 2799
red = 3199
count = 0
result = [0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
    if 0 < i < gray:
        result[0] += 1
    elif gray < i < brown:
        result[1] += 1
    elif brown < i < green:
        result[2] += 1
    elif green < i < lblue:
        result[3] += 1
    elif lblue < i < blue:
        result[4] += 1
    elif blue < i < yellow:
        result[5] += 1
    elif yellow < i < orange:
        result[6] += 1
    elif orange < i < red:
        result[7] += 1
    else:
        count += 1
minout = sum(i>0 for i in result)
maxout = minout + count
if minout == 0:
    minout = 1
print(minout, maxout)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
gray = 399
brown = 799
green = 1199
lblue = 1599
blue = 1999
yellow = 2399
orange = 2799
red = 3199
count = 0
result = [0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
    if 0 < i < gray:
        result[0] += 1
    elif gray < i < brown:
        result[1] += 1
    elif brown < i < green:
        result[2] += 1
    elif green < i < lblue:
        result[3] += 1
    elif lblue < i < blue:
        result[4] += 1
    elif blue < i < yellow:
        result[5] += 1
    elif yellow < i < orange:
        result[6] += 1
    elif orange < i < red:
        result[7] += 1
    elif 3200 < i:
        count += 1
minout = sum(i>0 for i in result)
maxout = minout + count
print('{} {}'.format(minout, maxout))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
gray = 399
brown = 799
green = 1199
lblue = 1599
blue = 1999
yellow = 2399
orange = 2799
red = 3199
count = 0
result = [0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
    if 0 < i < gray:
        result[0] += 1
    elif gray < i < brown:
        result[1] += 1
    elif brown < i < green:
        result[2] += 1
    elif green < i < lblue:
        result[3] += 1
    elif lblue < i < blue:
        result[4] += 1
    elif blue < i < yellow:
        result[5] += 1
    elif yellow < i < orange:
        result[6] += 1
    elif orange < i < red:
        result[7] += 1
    else:
        count += 1
minout = sum(i>0 for i in result)
maxout = minout + count
print('{} {}'.format(minout, maxout))

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

colors = []
over = 0

for a in A:
    if 1 <= a <= 399:
        colors.append("gray")
    if 400 <= a <= 799:
        colors.append("brawn")
    if 800 <= a <= 1199:
        colors.append("green")
    if 1200 <= a <= 1599:
        colors.append("water")
    if 1600 <= a <= 1999:
        colors.append("blue")
    if 2000 <= a <= 2399:
        colors.append("yellow")
    if 2400 <= a <= 2799:
        colors.append("orange")
    if 2800 <= a <= 3199:
        colors.append("red")
    if 3200 <= a:
        over += 1

counter = Counter(colors)

if over > 0:
    max_num = len(counter) + over
    print(len(counter), max_num)
else:
    print(len(counter), len(counter))

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

colors = []
over = 0

for a in A:
    if 1 <= a <= 399:
        colors.append("gray")
    if 400 <= a <= 799:
        colors.append("brawn")
    if 800 <= a <= 1199:
        colors.append("green")
    if 1200 <= a <= 1599:
        colors.append("water")
    if 1600 <= a <= 1999:
        colors.append("blue")
    if 2000 <= a <= 2399:
        colors.append("yellow")
    if 2400 <= a <= 2799:
        colors.append("orange")
    if 2800 <= a <= 3199:
        colors.append("red")
    if 3200 <= a:
        over += 1

counter = Counter(colors)

if over > 0:
    max_num = min(8, len(counter) + over)
    print(len(counter), max_num)
else:
    print(len(counter), len(counter))

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

colors = []

for a in A:
    if 1 <= a <= 399:
        colors.append("gray")
    if 400 <= a <= 799:
        colors.append("brawn")
    if 800 <= a <= 1199:
        colors.append("green")
    if 1200 <= a <= 1599:
        colors.append("water")
    if 1600 <= a <= 1999:
        colors.append("blue")
    if 2000 <= a <= 2399:
        colors.append("yellow")
    if 2400 <= a <= 2799:
        colors.append("orange")
    if 2800 <= a <= 3199:
        colors.append("red")
    if 3200 <= a:
        colors.append("any")

counter = Counter(colors)

if "any" in counter:
    any_num = counter["any"]
    max_num = min(8, len(counter) - 1 + any_num)
    print(len(counter) - 1, max_num)
else:
    print(len(counter), len(counter))

Submission status: Wrong Answer

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

colors = [False for _ in range(8)]

# rate 3200+
allmite = 0
for i in range(N):
  if 1 <= A[i] <= 399:
    colors[0] = True
  elif 400 <= A[i] <= 799:
    colors[1] = True
  elif 800 <= A[i] <= 1199:
    colors[2] = True
  elif 1200 <= A[i] <= 1599:
    colors[3] = True
  elif 1600 <= A[i] <= 1999:
    colors[4] = True
  elif 2000 <= A[i] <= 2399:
    colors[5] = True
  elif 2400 <= A[i] <= 2799:
    colors[6] = True
  elif 2800 <= A[i] <= 3199:
    colors[7] = True  
  else:
    allmite += 1

ans_min = colors.count(True)
ans_max = ans_min + allmite

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import copy
from collections import defaultdict

input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n = I()
mylist = [0 for i in range(8)]
mylist2 = MI()
num = 0

for i in mylist2:
    temp = i // 400
    if temp <= 7:
        mylist[temp] = 1
    else:
        num += 1
        
max = sum(mylist) + num
if max >= 9:
    max = 8

min = sum(mylist)
if min == 0:
    min = 1
    
print(str(min) + " " + str(max))

Submission status: Wrong Answer

Solution code:
n = int(input())

a = map(int, input().split())
d = {0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}

for i in a:
    col = i//400
    if col == 8:
        d[col] += 1
    else:
        d[col] = 1

ans_min = -1
ans_max = -1
cnt = 0
for key, value in d.items():
    if key != 8:
        cnt += value
    else:
        ans_min = max(cnt,1)
        ans_max = min(cnt+value,8)
if ans_min == -1:
    print(str(cnt) + ' ' + str(cnt))
else:
    print(str(ans_min) + ' ' + str(ans_max))

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import copy
from collections import defaultdict

input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n = I()
mylist = [0 for i in range(8)]
mylist2 = MI()
num = 0

for i in mylist2:
    temp = i // 400
    if temp <= 7:
        mylist[temp] = 1
    else:
        num += 1
        
max = sum(mylist) + num
if max >= 9:
    max = 8

min = sum(mylist)
if min == 0:
    min = 1
    
print(str(min)+ " "+ str(max))

Submission status: Wrong Answer

Solution code:
n = int(input())

a = map(int, input().split())
d = {0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}

for i in a:
    if i <=399:
        d[0]=1
    elif 400<=i<=799:
        d[1]=1
    elif 800<=i<=1199:
        d[2]=1
    elif 1200<=i<=1599:
        d[3]=1
    elif 1600<=i<=1999:
        d[4]=1
    elif 2000<=i<=2399:
        d[5]=1
    elif 2400<=i<=2799:
        d[6]=1
    elif 2800<=i<=3199:
        d[7]=1
    elif 3200<=i:
        d[8]=d[8]+1
ans_min = -1
ans_max = -1
cnt = 0
for key, value in d.items():
    if key != 8:
        cnt += value
    else:
        ans_min = max(cnt,1)
        ans_max = min(cnt+value,8)
if ans_min == -1:
    print(str(cnt) + ' ' + str(cnt))
else:
    print(str(ans_min) + ' ' + str(ans_max))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
num=[0]*8
up2800=0
for i in range(n):
    if a[i]<400:
        num[0]+=1
    elif a[i]<800:
        num[1]+=1
    elif a[i]<1200:
        num[2]+=1
    elif a[i]<1600:
        num[3]+=1
    elif a[i]<2000:
        num[4]+=1
    elif a[i]<2400:
        num[5]+=1
    elif a[i]<2800:
        num[6]+=1
    elif a[i]<3200:
        num[7]+=1
    else:
        up2800+=1
num2=8-num.count(0)
print(num2,num2+up2800)

Submission status: Wrong Answer

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

rank = [0] * 9

for i in range(n):
    index = a_list[i] // 400
    if index >= 8:
        index = 8
    rank[index] += 1

minimum = sum([1 if x>0 else 0 for x in rank[0:8]])
maximum = min(8, minimum + rank[8])

print('{0} {1}'.format(max(minimum, 1), maximum))

Submission status: Wrong Answer

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

rank = [0] * 9

for i in range(n):
    index = a_list[i] // 400
    if index >= 8:
        index = 8
    rank[index] += 1

minimum = sum([1 if x>0 else 0 for x in rank[0:8]])
maximum = min(8, minimum + rank[8])

print('{0} {1}'.format(minimum, maximum))

Submission status: Wrong Answer

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

rank = [False] * 9

for i in range(n):
    index = a_list[i] // 400
    if index >= 8:
        index = 8
    rank[index] += 1

minimum = sum([1 if x>0 else 0 for x in rank[0:8]])
maximum = min(8, minimum + rank[8])

print('{0} {1}'.format(minimum, maximum))

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    rate_count = [0] * 13
    a = tuple(map(int, input().split()))
    for ae in a:
        rank = ae // 400
        rate_count[rank] += 1

    reds = sum(rate_count[8:])
    res = 0
    for i1 in range(8):
        res += rate_count[i1] > 0
    r_min = max(res, 1)
    r_max = min(8, res + reds)
    print(r_min, r_max)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

n = int(sys.stdin.readline().rstrip())
a = [int(x) for x in sys.stdin.readline().rstrip().split()]

a_set = set()
counter_wild = 0
for x in a:
    if x>=3200:
        counter_wild+=1
    else:
        a_set.add(x//400)
print(max(1,len(a_set)),min(8,len(a_set)+counter_wild))

Submission status: Wrong Answer

Solution code:
import sys
 
n = int(sys.stdin.readline().rstrip())
a = [int(x) for x in sys.stdin.readline().rstrip().split()]
 
counter = [0,0,0,0,0,0,0,0]
counter_wild = 0
 
for x in a:
    if x < 400:
        counter[0] += 1
    elif x < 800:
        counter[1] += 1
    elif x < 1200:
        counter[2] += 1
    elif x < 1600:
        counter[3] += 1
    elif x < 2000:
        counter[4] += 1
    elif x < 2400:
        counter[5] += 1
    elif x < 2800:
        counter[6] += 1
    elif x < 3200:
        counter[7] += 1
    else:
        counter_wild += 1

c = len(list(filter(lambda x: x != 0,counter)))

if counter_wild == 0:
    minimum_num = c
    maximum_num = c
else:
    minimum_num = max(1,c)
    maximum_num = min(c+counter_wild,8)
 
print(minimum_num,maximum_num)

Submission status: Wrong Answer

Solution code:
import sys
 
n = int(sys.stdin.readline().rstrip())
a = [int(x) for x in sys.stdin.readline().rstrip().split()]
 
counter = [0,0,0,0,0,0,0,0]
counter_wild = 0
 
for x in a:
    if x < 400:
        counter[0] += 1
    elif x < 800:
        counter[1] += 1
    elif x < 1200:
        counter[2] += 1
    elif x < 1600:
        counter[3] += 1
    elif x < 2000:
        counter[4] += 1
    elif x < 2400:
        counter[5] += 1
    elif x < 2800:
        counter[6] += 1
    elif x < 3200:
        counter[7] += 1
    else:
        counter_wild += 1
 
minimum_num = len(list(filter(lambda x: x != 0,counter)))
if minimum_num == 0:
    minimum_num = 1

maximum_num = min(minimum_num + counter_wild,8)
 
print(minimum_num,maximum_num)

Submission status: Wrong Answer

Solution code:
import sys

n = int(sys.stdin.readline().rstrip())
a = [int(x) for x in sys.stdin.readline().rstrip().split()]

counter = [0,0,0,0,0,0,0,0]
counter_wild = 0

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

minimum_num = len(list(filter(lambda x: x != 0,counter)))
maximum_num = min(minimum_num + counter_wild,8)

print(minimum_num,maximum_num)

Submission status: Wrong Answer

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

others = 0
rates = [False for i in range(8)]
for i in a:
    if i <= 0: continue
    elif i <= 399: rates[0] = True
    elif i <= 799: rates[1] = True
    elif i <= 1199: rates[2] = True
    elif i <= 1599: rates[3] = True
    elif i <= 1999: rates[4] = True
    elif i <= 2399: rates[5] = True
    elif i <= 2799: rates[6] = True
    elif i <= 3199: rates[7] = True
    else:
        others += 1
        
min_ans = rates.count(True)
max_ans = rates.count(True)
if others > 0:
    max_ans += others

print(min_ans, max_ans)

Submission status: Wrong Answer

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

a.sort()
others = 0
rates = [False for i in range(8)]
for i in a:
    if i <= 399:
        rates[0] = True
    elif i <= 799:
        rates[1] = True
    elif i <= 1199:
        rates[2] = True
    elif i <= 1599:
        rates[3] = True
    elif i <= 1999:
        rates[4] = True
    elif i <= 2399:
        rates[5] = True
    elif i <= 2799:
        rates[6] = True
    elif i <= 3199:
        rates[7] = True
    else:
        others += 1
min_ans = rates.count(True)
max_ans = rates.count(True)
if others > 0:
    max_ans += others

print(min_ans, max_ans)

Submission status: Wrong Answer

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

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

## Logic

ans = [0,0,0,0,0,0,0,0]
tmp = 0

for i in range(0,N):
    if A[i] >= 3200:
        tmp += 1
    else:
        ans[A[i]//400] = 1

print(max(1,sum(ans)),min(8,sum(ans)+tmp))

Submission status: Wrong Answer

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

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

## Logic

ans = [0,0,0,0,0,0,0,0]
tmp = 0

for i in range(0,N):
    if A[i]//400 >= 8:
        tmp += 1
    else:
        ans[A[i]//400] = 1

print(max(1,sum(ans)),min(8,sum(ans)+tmp))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[]
for i in range(n):
    if a[i]<400:
        l.append("hai")
    elif a[i]<800:
        l.append("cha")
    elif a[i]<1200:
        l.append("midori")
    elif a[i]<1600:
        l.append("mizu")
    elif a[i]<2000:
        l.append("ao")
    elif a[i]<2400:
        l.append("ki")
    elif a[i]<2800:
        l.append("orange")
    elif a[i]<3200:
        l.append("red")
    else:
        l.append("free")
ls=set(l)
if "free" not in ls:
    print(len(ls),len(ls))
else:
    x=len(ls)-1#free以外の色の数
    y=x+l.count("free")
    if y>8:
        y=8
    
    if x==0:
        x=1
    print(x,y)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[]
for i in range(n):
    if a[i]<400:
        l.append("hai")
    elif a[i]<800:
        l.append("cha")
    elif a[i]<1200:
        l.append("midori")
    elif a[i]<1600:
        l.append("mizu")
    elif a[i]<2000:
        l.append("ao")
    elif a[i]<2400:
        l.append("ki")
    elif a[i]<2800:
        l.append("orange")
    elif a[i]<3200:
        l.append("red")
    else:
        l.append("free")
ls=set(l)
if "free" not in ls:
    print(len(ls),len(ls))
else:
    x=len(ls)-1#free以外の色の数
    if l.count("free")>=(8-x):
        y=8
    else:
        y=l.count("free")+x
    if x==0:
        x=1
    print(x,y)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[]
for i in range(n):
    if a[i]<400:
        l.append("hai")
    elif a[i]<800:
        l.append("cha")
    elif a[i]<1200:
        l.append("midori")
    elif a[i]<1600:
        l.append("mizu")
    elif a[i]<2000:
        l.append("ao")
    elif a[i]<2400:
        l.append("ki")
    elif a[i]<2800:
        l.append("orange")
    elif a[i]<3200:
        l.append("red")
    else:
        l.append("free")
ls=set(l)
if "free" not in ls:
    print(len(ls),len(ls))
else:
    x=len(ls)-1#free以外の色の数
    if l.count("free")>=(8-x):
        y=8
    else:
        y=l.count("free")+x
    
    print(x,y)

Submission status: Wrong Answer

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

fix_color = set()
n_any_color = 0
for color in a:

  if color < 400:
    fix_color.add(400)
  elif color < 800:
    fix_color.add(800)
  elif color < 1200:
    fix_color.add(1200)
  elif color < 1600:
    fix_color.add(1600)
  elif color < 2000:
    fix_color.add(2000)
  elif color < 2400:
    fix_color.add(2400)
  elif color < 2800:
    fix_color.add(2800)
  elif color < 3200:
    fix_color.add(3200)
  else:
    n_any_color += 1

n_min = max(1, len(fix_color))
n_max = n_min + n_any_color
print(n_min, n_max)