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()))
C = [400, 800, 1200, 2000, 2400, 2800, 3200]
A_class = []
free_color = 0
from bisect import bisect_right
for a in A:
  cls = bisect_right(C, a)
  if cls == 7:
    free_color += 1
  else:
    A_class.append(cls)
max_class = min(8, len(set(A_class)) + free_color)
min_class = len(set(A_class))
print(min_class, max_class)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    C=[0]*9
    n=int(input())
    for a in map(int,input().split()):
        s=a//400
        if(s>=8): C[8]+=1
        else: C[s]+=1

    cnt=sum(1 for i in range(8) if(C[i]))
    print(cnt,cnt+C[-1])
resolve()

Submission status: Wrong Answer

Solution code:
from sys import stdin
input = stdin.readline

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

iro=[0]*8
free=0
for i in range(n):
    if a[i]>=3200:
        free+=1
    else:
        iro[a[i]//400]+=1
print(max(1,8-iro.count(0)),min(8,8-iro.count(0)+free))

Submission status: Wrong Answer

Solution code:
from sys import stdin
input = stdin.readline

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

iro=[0]*8
free=0
for i in range(n):
    if a[i]>=3200:
        free+=1
    else:
        iro[a[i]//400]+=1
print(8-iro.count(0),min(8,8-iro.count(0)+free))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
c=0
for i in range(n):
    if A[i]>=3200:
        c+=1
        A[i]=8
    else:
        A[i]//=400
m=len(set(A))
if c:
    print(m-1,m-1+c)
else:
    print(m,m)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
c=0
for i in range(n):
    if A[i]>=3200:
        c+=1
        A[i]=8
    else:
        A[i]//=400
print(A)
m=len(set(A))
if c:
    print(m-1,m-1+c)
else:
    print(m,m)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
c=0
for i in range(n):
    if A[i]>=3200:
        c+=1
        A[i]==8
    else:
        A[i]//=400
m=len(set(A))
if c:
    print(m-1,m-1+c)
else:
    print(m,m)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int,input().split()))
if N==1:
    print('1 1')
    exit()
hai = []
tya = []
midori = []
mizu = []
ao = []
ki = []
dai = []
aka = []
mu = []
for i in array:
    if i <= 399:
        hai.append(i)
        continue
    if i <= 799:
        tya.append(i)
        continue
    if i <= 1199:
        midori.append(i)
        continue
    if i <= 1599:
        mizu.append(i)
        continue
    if i <= 1999:
        ao.append(i)
        continue
    if i <= 2399:
        ki.append(i)
        continue
    if i <= 2799:
        dai.append(i)
        continue
    if i <= 3199:
        aka.append(i)
        continue
    mu.append(i)
ans = 0
if len(hai) != 0:
    ans += 1
if len(tya) != 0:
    ans += 1
if len(midori) != 0:
    ans += 1
if len(mizu) != 0:
    ans += 1
if len(ao) != 0:
    ans += 1
if len(ki) != 0:
    ans += 1
if len(dai) != 0:
    ans += 1
if len(aka) != 0:
    ans += 1
ans_min = max(ans,1)
ans_max = min(ans + len(mu),8)
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int,input().split()))
if N==1:
    print('1 1')
    exit()
hai = []
tya = []
midori = []
mizu = []
ao = []
ki = []
dai = []
aka = []
mu = []
for i in array:
    if i <= 399:
        hai.append(i)
        continue
    if i <= 799:
        tya.append(i)
        continue
    if i <= 1199:
        midori.append(i)
        continue
    if i <= 1599:
        mizu.append(i)
        continue
    if i <= 1999:
        ao.append(i)
        continue
    if i <= 2399:
        ki.append(i)
        continue
    if i <= 2799:
        dai.append(i)
        continue
    if i <= 3199:
        aka.append(i)
        continue
    if 3200 <= i:
        mu.append(i)
ans = 0
if len(hai) != 0:
    ans += 1
if len(tya) != 0:
    ans += 1
if len(midori) != 0:
    ans += 1
if len(mizu) != 0:
    ans += 1
if len(ao) != 0:
    ans += 1
if len(ki) != 0:
    ans += 1
if len(dai) != 0:
    ans += 1
if len(aka) != 0:
    ans += 1
ans_min = ans
ans_max = ans + len(mu)
if ans_min == 8:
    print('8 8')
else:
    print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int,input().split()))
if N==1:
    print('1 1')
    exit()
hai = []
tya = []
midori = []
mizu = []
ao = []
ki = []
dai = []
aka = []
mu = []
for i in array:
    if i <= 399:
        hai.append(i)
        continue
    if i <= 799:
        tya.append(i)
        continue
    if i <= 1199:
        midori.append(i)
        continue
    if i <= 1599:
        mizu.append(i)
        continue
    if i <= 1999:
        ao.append(i)
        continue
    if i <= 2399:
        ki.append(i)
        continue
    if i <= 2799:
        dai.append(i)
        continue
    if i <= 3199:
        aka.append(i)
        continue
    if 3200 <= i:
        mu.append(i)
ans = 0
if len(hai) != 0:
    ans += 1
if len(tya) != 0:
    ans += 1
if len(midori) != 0:
    ans += 1
if len(mizu) != 0:
    ans += 1
if len(ao) != 0:
    ans += 1
if len(ki) != 0:
    ans += 1
if len(dai) != 0:
    ans += 1
if len(aka) != 0:
    ans += 1
ans_min = ans
ans_max = ans + len(mu)
if ans_min == 9:
    print('9 9')
else:
    print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int,input().split()))
if N==1:
    print('1 1')
    exit()
hai = []
tya = []
midori = []
mizu = []
ao = []
ki = []
dai = []
aka = []
mu = []
for i in array:
    if i <= 399:
        hai.append(i)
        continue
    if i <= 799:
        tya.append(i)
        continue
    if i <= 1199:
        midori.append(i)
        continue
    if i <= 1599:
        mizu.append(i)
        continue
    if i <= 1999:
        ao.append(i)
        continue
    if i <= 2399:
        ki.append(i)
        continue
    if i <= 2799:
        dai.append(i)
        continue
    if i <= 3199:
        aka.append(i)
        continue
    if 3200 <= i:
        mu.append(i)
ans = 0
if len(hai) != 0:
    ans += 1
if len(tya) != 0:
    ans += 1
if len(midori) != 0:
    ans += 1
if len(mizu) != 0:
    ans += 1
if len(ao) != 0:
    ans += 1
if len(ki) != 0:
    ans += 1
if len(dai) != 0:
    ans += 1
if len(aka) != 0:
    ans += 1
ans_min = ans
ans_max = ans + len(mu)
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int,input().split()))
if N==1:
    print(1)
    exit()
hai = []
tya = []
midori = []
mizu = []
ao = []
ki = []
dai = []
aka = []
mu = []
for i in array:
    if i <= 399:
        hai.append(i)
        continue
    if i <= 799:
        tya.append(i)
        continue
    if i <= 1199:
        midori.append(i)
        continue
    if i <= 1599:
        mizu.append(i)
        continue
    if i <= 1999:
        ao.append(i)
        continue
    if i <= 2399:
        ki.append(i)
        continue
    if i <= 2799:
        dai.append(i)
        continue
    if i <= 3199:
        aka.append(i)
        continue
    if 3200 <= i:
        mu.append(i)
ans = 0
if len(hai) != 0:
    ans += 1
if len(tya) != 0:
    ans += 1
if len(midori) != 0:
    ans += 1
if len(mizu) != 0:
    ans += 1
if len(ao) != 0:
    ans += 1
if len(ki) != 0:
    ans += 1
if len(dai) != 0:
    ans += 1
if len(aka) != 0:
    ans += 1
ans_min = ans
ans_max = ans + len(mu)
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int,input().split()))
hai = []
tya = []
midori = []
mizu = []
ao = []
ki = []
dai = []
aka = []
mu = []
for i in array:
    if i <= 399:
        hai.append(i)
        continue
    if i <= 799:
        tya.append(i)
        continue
    if i <= 1199:
        midori.append(i)
        continue
    if i <= 1599:
        mizu.append(i)
        continue
    if i <= 1999:
        ao.append(i)
        continue
    if i <= 2399:
        ki.append(i)
        continue
    if i <= 2799:
        dai.append(i)
        continue
    if i <= 3199:
        aka.append(i)
        continue
    if 3200 <= i:
        mu.append(i)
ans = 0
if len(hai) != 0:
    ans += 1
if len(tya) != 0:
    ans += 1
if len(midori) != 0:
    ans += 1
if len(mizu) != 0:
    ans += 1
if len(ao) != 0:
    ans += 1
if len(ki) != 0:
    ans += 1
if len(dai) != 0:
    ans += 1
if len(aka) != 0:
    ans += 1
ans_min = ans
ans_max = ans + len(mu)
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
L = [["A", 1, 399],
	["B", 400, 799],
	["C", 800, 1199],
	["D", 1200, 1599],
	["E", 1600, 1999],
	["F", 2000, 2399],
	["G", 2400, 2799],
	["H", 2800, 3199],
    ["I", 3200, 4800]]

N = int(input())
P = [int(i) for i in input().split()]
C = []

cnt_I = 0
for i in P:
  if i >= 3200:
    cnt_I += 1
  for c, m, x in L:
      if m <= i and i <= x:
        C.append(c)
        break

if "I" in C:
  mx = len(set(C)) - 1 + cnt_I
  mn = len(set(C)) - 1
else:
  mx = len(set(C))
  mn = len(set(C))

print(mn, mx)

Submission status: Wrong Answer

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

d = [0, 0, 0, 0, 0, 0, 0, 0, 0]


for i in a:
  if i < 400:
    d[0] = 1
    continue
  elif i < 800:
    d[1] = 1
  elif i < 1200:
    d[2] = 1
  elif i < 1600:
    d[3] = 1
  elif i < 2000:
    d[4] = 1
  elif i < 2400:
    d[5] = 1
  elif i < 2800:
    d[6] = 1
  elif i < 3200:
    d[7] = 1
  else:
    d[8] += 1
    
min = sum(d[:-1])
max = sum(d)
print(min, max)

Submission status: Wrong Answer

Solution code:
from collections import OrderedDict
rate = (
  ('gray', 400),
  ('brown', 800),
  ('green', 1200),
  ('water', 1600),
  ('blue', 2000),
  ('yellow', 2400),
  ('orange', 2800),
  ('red', 3200),
  ('rainbow', 4800),
)

n = int(input())
a = []
for i in map(int, input().split()):
  for color, border in rate:
    if i < border:
      a.append(color)
      break

rainbow = 0
colors = list(set(a))
if 'rainbow' in colors:
  rainbow = a.count('rainbow')
  colors.remove('rainbow')
print(len(colors), len(colors)+rainbow)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[False]*9
for i in a:
    if i<3200:
        l[i//400]=True
    else:
        l[8]+=1
print(sum(l[:8]),sum(l))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    if i<3200:
        l[i//400]+=1
    else:
        l[8]+=1
if l[8]==0:
    print(sum(l[:8]),sum(l[:8]))
else:
    print(sum(l[:8]),sum(l))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a1=0
a2=0
a3=0
a4=0
a5=0
a6=0
a7=0
a8=0
wild=0
for i in range(n):
    if 0<=a[i]<=399:
        a1+=1
    elif 400<=a[i]<=799:
        a2+=1
    elif 800<=a[i]<=1199:
        a3+=1
    elif 1200<=a[i]<=1599:
        a4+=1
    elif 1600<=a[i]<=1999:
        a5+=1
    elif 2000<=a[i]<=2399:
        a6+=1
    elif 2400<=a[i]<=2799:
        a7+=1
    elif 2800<=a[i]<=3199:
        a8+=1
    else:
        wild+=1
ans=0
r=[]
r.append(a1)
r.append(a2)
r.append(a3)
r.append(a4)
r.append(a5)
r.append(a6)
r.append(a7)
r.append(a8)
for i in range(8):
    if r[i]!=0:
        ans+=1
print(min(ans,1),ans+wild)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a1=0
a2=0
a3=0
a4=0
a5=0
a6=0
a7=0
a8=0
wild=0
for i in range(n):
    if 0<=a[i]<=399:
        a1+=1
    elif 400<=a[i]<=799:
        a2+=1
    elif 800<=a[i]<=1199:
        a3+=1
    elif 1200<=a[i]<=1599:
        a4+=1
    elif 1600<=a[i]<=1999:
        a5+=1
    elif 2000<=a[i]<=2399:
        a6+=1
    elif 2400<=a[i]<=2799:
        a7+=1
    elif 2800<=a[i]<=3199:
        a8+=1
    else:
        wild+=1
ans=0
r=[]
r.append(a1)
r.append(a2)
r.append(a3)
r.append(a4)
r.append(a5)
r.append(a6)
r.append(a7)
r.append(a8)
for i in range(8):
    if r[i]!=0:
        ans+=1
print(ans,ans+wild)

Submission status: Wrong Answer

Solution code:
from collections import Counter as C
N = int(input())
A = C([min(int(a)//400, 8) for a in input().split()])

a = sum([A[i]>0 for i in range(8)])
print(a, a+A[8])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
C=set()
d=0
for a in A:
    c=a//400
    if c<8:C.add(c)
    else:d+=1
print(len(C),len(C)+d)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
C=set()
d=0
for a in A:
    c=a//400
    if c<8:C.add(c)
    else:d+=1
print(len(C),min(8,len(C)+d))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
C=set()
d=0
for a in A:
    c=a//400
    if c<8:C.add(c)
    else:d+=1
print(len(C),min(7,len(C)+d))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
c=[0]*8;free=0
for x in l:
  if x<400:
    c[0]+=1
  elif x<800:
    c[1]+=1
  elif x<1200:
    c[2]+=1
  elif x<1600:
    c[3]+=1
  elif x<2000:
    c[4]+=1
  elif x<2400:
    c[5]+=1
  elif x<2800:
    c[6]+=1
  elif x<3200:
    c[7]+=1
  else: free+=1
cnt=0
for x in c:
  if x>0:cnt+=1
print(cnt,cnt+free)

Submission status: Wrong Answer

Solution code:
gray, brown, green, sky_blue, blue, yellow, orange, red = [0] * 8
N = int(input())
alist = list(map(int, input().split()))
free = 0
for a in alist:
    if 1 <= a <= 399:
        gray += 1
    elif 400 <= a <= 799:
        brown += 1
    elif 800 <= a <= 1199:
        green += 1
    elif 1200 <= a <= 1599:
        sky_blue += 1
    elif 1600 <= a <= 1999:
        blue += 1
    elif 2000 <= a <= 2399:
        yellow += 1
    elif 2400 <= a <= 2799:
        orange += 1
    elif 2800 <= a <= 3199:
        red += 1
    else:
        free += 1
colors = [color for color in [gray, brown, green, sky_blue, blue, yellow, orange, red] if color > 0]
print(min(1, len(colors)), len(colors) + free)

Submission status: Wrong Answer

Solution code:
gray, brown, green, sky_blue, blue, yellow, orange, red = [0] * 8
N = int(input())
alist = list(map(int, input().split()))
free = 0
for a in alist:
    if 1 <= a <= 399:
        gray += 1
    elif 400 <= a <= 799:
        brown += 1
    elif 800 <= a <= 1199:
        green += 1
    elif 1200 <= a <= 1599:
        sky_blue += 1
    elif 1600 <= a <= 1999:
        blue += 1
    elif 2000 <= a <= 2399:
        yellow += 1
    elif 2400 <= a <= 2799:
        orange += 1
    elif 2800 <= a <= 3199:
        red += 1
    else:
        free += 1
colors = [color for color in [gray, brown, green, sky_blue, blue, yellow, orange, red] if color > 0]
print(len(colors), len(colors) + free)

Submission status: Wrong Answer

Solution code:
gray, brown, green, sky_blue, blue, yellow, orange, red = [0] * 8
N = int(input())
alist = list(map(int, input().split()))
free = 0
for a in alist:
    if 1 <= a <= 399:
        gray += 1
    elif 400 <= a <= 799:
        brown += 1
    elif 800 <= a <= 1199:
        green += 1
    elif 1200 <= a <= 1599:
        sky_blue += 1
    elif 1600 <= a <= 1999:
        blue += 1
    elif 2000 <= a <= 2399:
        yellow += 1
    elif 2400 <= a <= 2799:
        orange += 1
    elif 2800 <= a <= 3199:
        red += 1
    else:
        free += 1
colors = [color for color in [gray, brown, green, sky_blue, blue, yellow, orange, red] if color != 0]
print(len(colors), len(colors) + free)

Submission status: Wrong Answer

Solution code:
gray, brown, green, sky_blue, blue, yellow, orange, red = [0] * 8
N = int(input())
alist = list(map(int, input().split()))
free = 0
for a in alist:
    if a <= 399:
        gray += 1
    elif 400 <= a <= 799:
        brown += 1
    elif 800 <= a <= 1199:
        green += 1
    elif 1200 <= a <= 1599:
        sky_blue += 1
    elif 1600 <= a <= 1999:
        blue += 1
    elif 2000 <= a <= 2399:
        yellow += 1
    elif 2400 <= a <= 2799:
        orange += 1
    elif 2800 <= a <= 3199:
        red += 1
    else:
        free += 1
colors = [color for color in [gray, brown, green, sky_blue, blue, yellow, orange, red] if color != 0]
print(len(colors), min(len(colors) + free, 8))

Submission status: Wrong Answer

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

C=[0,0,0,0,0,0,0,0]
R=0

for i in range(N):
    if a[i]<3200:
        C[a[i]//400]+=1
    else:
        R+=1
#print(C,R)
m=0
for i in range(8):
    if C[i]>0:
        m+=1
print(m,m+R)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
mighty = 0
s = set()
for x in A:
    if x < 400:
        s.add('gray')
    elif x < 800:
        s.add('brown')
    elif x < 1200:
        s.add('green')
    elif x < 1600:
        s.add('water')
    elif x < 2000:
        s.add('blue')
    elif x < 2400:
        s.add('yellow')
    elif x < 2800:
        s.add('orange')
    elif x < 3200:
        s.add('red')
    else:
        mighty += 1
answer = max(1, len(s))
answer_max = answer + mighty
answer_max = min(8, answer_max, N)
print(answer, answer_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
mighty = 0
s = set()
for x in A:
    if x < 400:
        s.add('gray')
    elif x < 800:
        s.add('brown')
    elif x < 1200:
        s.add('green')
    elif x < 1600:
        s.add('water')
    elif x < 2000:
        s.add('blue')
    elif x < 2400:
        s.add('yellow')
    elif x < 2800:
        s.add('orange')
    elif x < 3200:
        s.add('red')
    else:
        mighty += 1
answer = max(1, len(s))
answer_max = answer + mighty
answer_max = min(8, answer_max)
print(answer, answer_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
mighty = 0
s = set()
for x in A:
    if x < 400:
        s.add('gray')
    elif x < 800:
        s.add('brown')
    elif x < 1200:
        s.add('green')
    elif x < 1600:
        s.add('water')
    elif x < 2000:
        s.add('blue')
    elif x < 2400:
        s.add('yellow')
    elif x < 2800:
        s.add('orange')
    elif x < 3200:
        s.add('red')
    else:
        mighty += 1
answer = len(s)
answer_max = answer + mighty
answer_max = min(8, answer_max)
print(answer, answer_max)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
aa=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
z=0
for a in A:
  if 3200<=a:
    z+=1
  elif 2800<=a:
    h=1
  elif 2400<=a:
    g=1
  elif 2000<=a:
    f=1
  elif 1600<=a:
    e=1
  elif 1200<=a:
    d=1
  elif 800<=a:
    c=1
  elif 400<=a:
    b=1
  else:
    aa=1
y=aa+b+c+d+e+f+g+h
print(max(y,1),min(y+z,8))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
aa=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
z=0
for a in A:
  if 3200<=a:
    z+=1
  elif 2800<=a:
    h=1
  elif 2400<=a:
    g=1
  elif 2000<=a:
    f=1
  elif 1600<=a:
    e=1
  elif 1200<=a:
    d=1
  elif 800<=a:
    c=1
  elif 400<=a:
    b=1
  else:
    aa=1
y=aa+b+c+d+e+f+g+h
print(y,min(y+z,8))

Submission status: Wrong Answer

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

agg = [0] * 9
free = 0

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

minimum = len([x for x in agg if x > 0])
maximum = minimum + max(agg[8]-1, 0)

print(minimum, maximum)

Submission status: Wrong Answer

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

agg = [0] * 8
free = 0

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

minimum = len([x for x in agg if x > 0])
maximum = minimum + free

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
#Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
L = [0 for i in range(8)]
s = 0
for i in range(N):
    if a[i] < 3200:
        L[a[i]//400] = L[a[i]//400] + 1
    else:
        s = s + 1
n = 0
for i in range(8):
    if L[i] > 0:
        n = n + 1
nmin = n
nmax = n + s
if nmin == 0:
    nmin = 1
if nmax > 8:
    nmax = 8
print(str(nmin)+" "+str(nmax))

Submission status: Wrong Answer

Solution code:
#Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
L = [0 for i in range(8)]
s = 0
for i in range(N):
    if a[i] < 3200:
        L[a[i]//400] = L[a[i]//400] + 1
    else:
        s = s + 1
n = 0
for i in range(8):
    if L[i] > 0:
        n = n + 1
nmin = n
nmax = n + s
if nmax > 8:
    nmax = 8
print(str(nmin)+" "+str(nmax))

Submission status: Wrong Answer

Solution code:
#Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
L = [0 for i in range(8)]
s = 0
for i in range(N):
    if a[i] < 3200:
        L[a[i]//400] = L[a[i]//400] + 1
    else:
        s = s + 1
n = 0
for i in range(8):
    if L[i] > 0:
        n = n + 1
nmin = n
nmax = n + s
if nmax > 9:
    nmax = 9
print(str(nmin)+" "+str(nmax))

Submission status: Wrong Answer

Solution code:
n = int(input())
colors = [0]*9

A = map(int, input().split())
for i in A:
    if 1 <= i <= 399:
        colors[1] = 1
    elif 400 <= i <= 799:
        colors[2] = 1
    elif 800 <= i <= 1199:
        colors[3] = 1
    elif 1200 <= i <= 1599:
        colors[4] = 1
    elif 1600 <= i <= 1999:
        colors[5] = 1
    elif 2000 <= i <= 2399:
        colors[6] = 1
    elif 2400 <= i <= 2799:
        colors[7] = 1
    elif 2800 <= i <= 3199:
        colors[8] = 1
    else:
        colors[0] += 1

s = sum(colors[1:9]) + colors[0]
if s <= 8:
    print(s-colors[0], s)
else:
    print(s-colors[0], 8)

Submission status: Wrong Answer

Solution code:
n = int(input())
colors = [0]*9

A = map(int, input().split())
for i in A:
    if 1 <= i <= 399:
        colors[1] = 1
    elif 400 <= i <= 799:
        colors[2] = 1
    elif 800 <= i <= 1199:
        colors[3] = 1
    elif 1200 <= i <= 1599:
        colors[4] = 1
    elif 1600 <= i <= 1999:
        colors[5] = 1
    elif 2000 <= i <= 2399:
        colors[6] = 1
    elif 2400 <= i <= 2799:
        colors[7] = 1
    elif 2800 <= i <= 3199:
        colors[8] = 1
    else:
        colors[0] += 1

s = sum(colors[1:9]) + colors[0]
if s <= 9:
    print(s-colors[0], s)
else:
    print(s-colors[0], 9)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0 for _ in range(9)]
for a in map(int,input().split()):
  A[min(a//400,8)]+=1
rate_num = 8-A[:-1].count(0)
print(max(1,rate_num), min(8,rate_num+A[-1]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0 for _ in range(9)]
for a in map(int,input().split()):
  A[min(a//400,8)]+=1
rate_num = 8-A[:-1].count(0)
print(rate_num, min(8,rate_num+A[-1]))

Submission status: Wrong Answer

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

cnt=[0]*8
count=0
for i in range(n):
    if a[i]>=1 and a[i]<=399:
        cnt[0]=1
    elif a[i]>=400 and a[i]<=799:
        cnt[1]=1
    elif a[i]>=800 and a[i]<=1199:
        cnt[2]=1
    elif a[i]>=1200 and a[i]<=1599:
        cnt[3]=1
    elif a[i]>=1600 and a[i]<=1999:
        cnt[4]=1
    elif a[i]>=2000 and a[i]<=2399:
        cnt[5]=1
    elif a[i]>=2400 and a[i]<=2799:
        cnt[6]=1
    elif a[i]>=2800 and a[i]<=3199:
        cnt[7]=1
    else:
        count+=1
min_ans=sum(cnt)
if min_ans==0:
    min_ans=1
    count-=1

print(max(1,min_ans),min(min_ans+count,8))

Submission status: Wrong Answer

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

cnt=[0]*8
count=0
for i in range(n):
    if a[i]>=1 and a[i]<=399:
        cnt[0]=1
    elif a[i]>=400 and a[i]<=799:
        cnt[1]=1
    elif a[i]>=800 and a[i]<=1199:
        cnt[2]=1
    elif a[i]>=1200 and a[i]<=1599:
        cnt[3]=1
    elif a[i]>=1600 and a[i]<=1999:
        cnt[4]=1
    elif a[i]>=2000 and a[i]<=2399:
        cnt[5]=1
    elif a[i]>=2400 and a[i]<=2799:
        cnt[6]=1
    elif a[i]>=2800 and a[i]<=3199:
        cnt[7]=1
    else:
        count+=1
min_ans=sum(cnt)
if min_ans==0:
    min_ans=1
    count-=1

print(str(min_ans)+' '+str(min(min_ans+count,8)))

Submission status: Wrong Answer

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

cnt=[0]*8
count=0
for i in range(n):
    if a[i]>=1 and a[i]<=399:
        cnt[0]=1
    elif a[i]>=400 and a[i]<=799:
        cnt[1]=1
    elif a[i]>=800 and a[i]<=1199:
        cnt[2]=1
    elif a[i]>=1200 and a[i]<=1599:
        cnt[3]=1
    elif a[i]>=1600 and a[i]<=1999:
        cnt[4]=1
    elif a[i]>=2000 and a[i]<=2399:
        cnt[5]=1
    elif a[i]>=2400 and a[i]<=2799:
        cnt[6]=1
    elif a[i]>=2800 and a[i]<=3199:
        cnt[7]=1
    else:
        count+=1
min_ans=sum(cnt)
if min_ans==0 and count>=1:
    min_ans=1
    count-=1

print(str(min_ans)+' '+str(min(min_ans+count,8)))

Submission status: Wrong Answer

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

cnt=[0]*8
count=0
for i in range(n):
    if a[i]>=1 and a[i]<=399:
        cnt[0]=1
    elif a[i]>=400 and a[i]<=799:
        cnt[1]=1
    elif a[i]>=800 and a[i]<=1199:
        cnt[2]=1
    elif a[i]>=1200 and a[i]<=1599:
        cnt[3]=1
    elif a[i]>=1600 and a[i]<=1999:
        cnt[4]=1
    elif a[i]>=2000 and a[i]<=2399:
        cnt[5]=1
    elif a[i]>=2400 and a[i]<=2799:
        cnt[6]=1
    elif a[i]>=2800 and a[i]<=3199:
        cnt[7]=1
    else:
        count+=1
min_ans=sum(cnt)
print(str(min_ans)+' '+str(min(min_ans+count,7)))

Submission status: Wrong Answer

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

cnt=[0]*8
count=0
for i in range(n):
    if a[i]>=1 and a[i]<=399:
        cnt[0]=1
    elif a[i]>=400 and a[i]<=799:
        cnt[1]=1
    elif a[i]>=800 and a[i]<=1199:
        cnt[2]=1
    elif a[i]>=1200 and a[i]<=1599:
        cnt[3]=1
    elif a[i]>=1600 and a[i]<=1999:
        cnt[4]=1
    elif a[i]>=2000 and a[i]<=2399:
        cnt[5]=1
    elif a[i]>=2400 and a[i]<=2799:
        cnt[6]=1
    elif a[i]>=2800 and a[i]<=3199:
        cnt[7]=1
    else:
        count+=1
min_ans=sum(cnt)
print(str(min_ans)+' '+str(min(min_ans+count,8)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
S = set()
count = 0
for rate in A:
    if rate < 400:
        S.add("gray")
    elif rate < 800:
        S.add("brown")
    elif rate < 1200:
        S.add("green")
    elif rate < 1600:
        S.add("light_blue")
    elif rate < 2000:
        S.add("blue")
    elif rate < 2400:
        S.add("yellow")
    elif rate < 2800:
        S.add("orange")
    elif rate < 3200:
        S.add("red")
    elif rate >= 3200:
        count += 1

if count == 0:
    color_min = len(S)
    color_max = len(S)
else:
    color_max = min(len(S) + count, 8)
    color_min = max(len(S), 1)

print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
S = set()
count = 0
for rate in A:
    if rate < 400:
        S.add("gray")
    elif rate < 800:
        S.add("brown")
    elif rate < 1200:
        S.add("green")
    elif rate < 1600:
        S.add("light_blue")
    elif rate < 2000:
        S.add("blue")
    elif rate < 2400:
        S.add("yellow")
    elif rate < 2800:
        S.add("orange")
    elif rate < 3200:
        S.add("red")
    else:
        count += 1

if count == 0:
    color_min = len(S)
    color_max = len(S)
else:
    color_max = min(len(S) + count, 8)
    color_min = max(len(S), 1)

print(color_min, color_max)