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:
s = input()
n = int(s)

t_count = 0
f_count = 0
over = 0

colors = []
for i in range(9):
    colors.append(False)

v = input().split()

for i in range(n):
    x = int(v[i])
    if 1 <= x <= 399:
        colors[0] = True
    elif 400 <= x <= 799:
        colors[1] = True
    elif 800 <= x <= 1199:
        colors[2] = True
    elif 1200 <= x <= 1599:
        colors[3] = True
    elif 1600 <= x <= 1999:
        colors[4] = True
    elif 2000 <= x <= 2399:
        colors[5] = True
    elif 2400 <= x <= 2799:
        colors[6] = True
    elif 2800 <= x <= 3199:
        colors[7] = True
    else:
        over += 1

for i in range(len(colors)):
    if colors[i]:
        t_count += 1
    else:
        f_count += 1

min_ans = t_count
if f_count >= over:
    max_ans = t_count + over
else:
    max_ans = t_count + f_count

print(min_ans, end=' ')
print(max_ans)

Submission status: Wrong Answer

Solution code:
# C - Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))

lst = [0,0,0,0,0,0,0,0,0]

for i in range(N):
	for j in range(1,9):
		if a[i] < 400*j:
			lst[j-1] = 1
			break
	else:
		lst[8] += 1

min = sum(lst[0:8])
max = sum(lst)
print(min,max)

Submission status: Wrong Answer

Solution code:
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()
    
    n = int(input())
    a = list(map(int, input().split()))
    rate = [0]*8
    cnt = 0
    for x in a:
        r = x//400
        if r > 7:
            cnt += 1
        elif not rate[r]:
            rate[r] = 1
    s = sum(rate)
    mins = s+max(0, cnt-s)
    maxs = s+cnt
    print(mins, maxs)        
        
            



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
c = [0] * 9
for i in a:
    c[min(8, i // 400)] += 1
s = sum(i > 0 for i in c[:8])
print(s, s + c[8])

Submission status: Wrong Answer

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

rate = [1,400,800,1200,1600,2000,2400,2800]


color=[0]*8
free=0

for i in range(n):
    r=a[i]
    if 1<=r and r<=399:
        color[0]=1
    elif 400<=r and r<=799:
        color[1]=1
    elif 800<=r and r<=1199:
        color[2]=1
    elif 1200<=r and r<=1599:
        color[3]=1
    elif 1600<=r and r<=1999:
        color[4]=1
    elif 2000<=r and r<=2399:
        color[5]=1
    elif 2400<=r and r<=2799:
        color[6]=1
    elif 2800<=r and r<=3199:
        color[7]=1
    else:
        free+=1

num = sum(color)

ans_1 = num
#全員レート3200
if ans_1==0:
    ans_1=1

ans_2 = num+free
if ans_2>=8:
    ans_2=8

print(ans_1,ans_2)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color=[0]*8
free=0

for i in range(n):
    r=a[i]
    if 0<=r and r<=399:
        color[0]=1
    elif 400<=r and r<=799:
        color[1]=1
    elif 800<=r and r<=1199:
        color[2]=1
    elif 1200<=r and r<=1599:
        color[3]=1
    elif 1600<=r and r<=1999:
        color[4]=1
    elif 2000<=r and r<=2399:
        color[5]=1
    elif 2400<=r and r<=2799:
        color[6]=1
    elif 2800<=r and r<=3199:
        color[7]=1
    else:
        free+=1

num = sum(color)

ans_1 = num
if ans_1==0:
    ans_1=1
    
ans_2 = num+free
if ans_2>=9:
    ans_2=8

print(ans_1,ans_2)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [a//400 for a in A]
l = len({0,1,2,3,4,5,6,7}&set(A))
S = sum(a>7 for a in A)
print(min(l, 1), l+S)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [a//400 for a in A]
l = len({0,1,2,3,4,5,6,7}&set(A))
S = sum(a>7 for a in A)
print(max(l, 0), l+S)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [a//400 for a in A]
l = len({0,1,2,3,4,5,6,7}&set(A))
S = sum(a>7 for a in A)
print(l, l+S)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [a//400 for a in A]
l = len({0,1,2,3,4,5,6,7}&set(A))
S = sum(a>7 for a in A)
print(max(l, S), l+S)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, = list(map(int,input().split()))
a  = list(map(int,input().split()))
s = set()
c6=0
for ai in a:
    if ai>=3200:
        c6 += 1
    else:
        s |= set({ai//400})
print(len(s),len(s)+c6)

Submission status: Wrong Answer

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

r_s=list(range(0,2801,400))
r_s.append(3200)

r_e=list(range(399,3200,400))
r_e.append(4800)

def check_color(check):
    N=9
    for i in range(N):
        if r_s[i] <= check and r_e[i] >= check:
            return i
        
checklist=[]
checklist_8=[]
for a in A:
    a=check_color(a)
    if a != 8:
        checklist.append(a)
    else:
        checklist_8.append(a)

max_= len(set(checklist))+len(checklist_8)
min_= len(set(checklist))
        
max_ = min(8,max_)
min_ = max(1,min_)

print(min_,max_)

Submission status: Wrong Answer

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

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if a >= 3200:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

print(MIN, (MIN+H))

Submission status: Wrong Answer

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

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if a >= 3200:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

if MIN >= H and (MIN+H) <= 8:
  print(MIN, (MIN+H))

elif MIN >= H and (MIN+H) > 8:
  print(MIN, 8)

elif MIN < H and (MIN+H) <= 8:
  print(MIN, (MIN+H))

elif MIN < H and (MIN+H) > 8:
  print(MIN, 8)

Submission status: Wrong Answer

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

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if a >= 3200:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

if MIN >= H and (MIN+H) <= 8:
  print(MIN, (MIN+H))

elif MIN >= H and (MIN+H) > 8:
  print(MIN, 8)

elif MIN < H and (MIN+H) <= 8:
  print(H, (MIN+H))

elif MIN < H and (MIN+H) > 8:
  print(H, 8)

Submission status: Wrong Answer

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

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if a >= 3200:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

if MIN > H and (MIN+H) <= 8:
  print(MIN, (MIN+H))
  
elif MIN > H and (MIN+H) > 8:
  print(MIN, 8)

elif MIN < H and (MIN+H) <= 8:
  print(H, (MIN+H))

elif MIN < H and (MIN+H) > 8:
  print(H, 8)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    As = list(map(int, input().split()))
    nums = []
    rainbow = 0
    for A in As:
        num = A // 400
        if num < 8:
            if num not in nums:
                nums.append(num)
        else:
            rainbow += 1
    ans_max = len(nums)+rainbow
    ans_min = len(nums)
    print(ans_min, ans_max)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = [int(x) for x in input().split()]
s = set()
o = 0
for a in a_list:
    r = a // 400
    if r >= 8:
        o += 1
    else:
        s.add(r)
c = len(s)
print(c if c > 0 else 1, min(c + o, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = [int(x) for x in input().split()]
s = set()
o = 0
for a in a_list:
    r = a // 400
    if r >= 8:
        o += 1
    else:
        s.add(r)
c = len(s)
print(c, min(c + o, 8))

Submission status: Wrong Answer

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



def rateToColor(rate):
  if 0 < rate < 400:
    return 0
  elif rate < 800:
    return 1
  elif rate < 1200:
    return 2
  elif rate < 1600:
    return 3
  elif rate < 2000:
    return 4
  elif rate < 2400:
    return 5
  elif rate < 2800:
    return 6
  elif rate < 3200:
    return 7
  else:
    return 8


def solve(n,a):
  flags = [False]*8
  numOfRainbow = 0
  for rate in a:
    color = rateToColor(rate)
    if color != 8:
      flags[color] = True
    else:
      numOfRainbow += 1
  if sum(flags):
    return sum(flags), min(sum(flags)+numOfRainbow,8)
  else:
    return 1,min(numOfRainbow,8)


def main():
  N = int(input())
  a = list(map(int,input().split()))
  print(*solve(N,a))
  return

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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



def rateToColor(rate):
  if 0 < rate < 400:
    return 0
  elif rate < 800:
    return 1
  elif rate < 1200:
    return 2
  elif rate < 1600:
    return 3
  elif rate < 2000:
    return 4
  elif rate < 2400:
    return 5
  elif rate < 2800:
    return 6
  elif rate < 3200:
    return 7
  else:
    return 8


def solve(n,a):
  flags = [False]*8
  numOfRainbow = 0
  for rate in a:
    color = rateToColor(rate)
    if color != 8:
      flags[color] = True
    else:
      numOfRainbow += 1

  return sum(flags), min(sum(flags)+numOfRainbow,8)



def main():
  N = int(input())
  a = list(map(int,input().split()))
  print(*solve(N,a))
  return

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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



def rateToColor(rate):
  if 0 < rate < 400:
    return 0
  elif rate < 800:
    return 1
  elif rate < 1200:
    return 2
  elif rate < 1600:
    return 3
  elif rate < 2000:
    return 4
  elif rate < 2400:
    return 5
  elif rate < 2800:
    return 6
  elif rate < 3200:
    return 7
  else:
    return 8


def solve(n,a):
  flags = [False]*8
  numOfRainbow = 0
  for rate in a:
    color = rateToColor(rate)
    if color != 8:
      flags[color] = True
    else:
      numOfRainbow += 1

  return sum(flags), sum(flags)+numOfRainbow



def main():
  N = int(input())
  a = list(map(int,input().split()))
  print(*solve(N,a))
  return

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
ans = 0
check = [0] * 9
maxx = 0
minn = 0

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

for i in range(9):
    if i <= 7 and check[i] >= 1:
        maxx += 1
        minn += 1
    if i == 8:
        maxx += check[8]
        if minn == 0 and check[8] >= 1:
            minn = 1

print(minn, maxx)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    As = list(map(int, input().split()))
    nums = []
    rainbow = 0
    for A in As:
        num = A // 400
        if num < 8:
            if num not in nums:
                nums.append(num)
        else:
            rainbow += 1
    ans_max = min(len(nums)+rainbow, 8)
    ans_min = len(nums)
    print(ans_min, ans_max)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
colors = [0]*8
gold = 0
for a in map(int, input().split()):
    color = a//400
    if 8 <= color:
        gold += 1
        continue
    colors[color] = 1
print(sum(colors), sum(colors)+gold)

Submission status: Wrong Answer

Solution code:
n = int(input())
colors = [0]*8
gold = 0
for a in map(int, input().split()):
    color = a//400
    if 8 <= color:
        gold += 1
        continue
    colors[color] = 1
print(sum(colors), min(sum(colors)+gold, 8))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

X=[0]*8
Y=0

for a in A:
    if a>=3200:
        Y+=1
    else:
        X[a//400]+=1

a=8-X.count(0)
b=min(8,a+Y)
print(a,b)

Submission status: Wrong Answer

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

X=[0]*8
Y=0

for a in A:
    if a>=3200:
        Y+=1
    else:
        X[a//400]+=1
        
if Y==N:
    print(0,min(8,N))
else:
    a=8-X.count(0)
    b=min(8,a+Y)
    print(a,b)

Submission status: Wrong Answer

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

X=[0]*8
Y=0

for a in A:
    if a>=3200:
        Y+=1
    else:
        X[a//400]+=1
        
if Y==N:
    print(1,min(8,N))
else:
    a=8-X.count(0)
    b=min(8,a+Y)
    print(a,b)

Submission status: Wrong Answer

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

for i in range(N):
  aa = int(A[i] / 400)
  if aa > 8:
    aa = 8
  ans[aa] += 1
  
min_a = 0
max_a = 0
for i in range(9):
  if i != 8:
    if ans[i] != 0:
      min_a += 1
      max_a += 1
  else:
    max_a += ans[i]
    
print(min_a, max_a)

Submission status: Wrong Answer

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

color = [False]*8
flex = 0
cnt = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif a[i] < 800:
        color[1] = True
    elif a[i] < 1200:
        color[2] = True
    elif a[i] < 1600:
        color[3] = True
    elif a[i] < 2000:
        color[4] = True
    elif a[i] < 2400:
        color[5] = True
    elif a[i] < 2800:
        color[6] = True
    elif a[i] < 3200:
        color[7] = True
    else:
        flex += 1

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

print(str(mi) + " " + str(cnt))

Submission status: Wrong Answer

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

col = [0] * 8
opt = 0

for i in range(n):
    if 1 <= a[i] < 400:
        col[0] = 1
    elif 400 <= a[i] < 800:
        col[1] = 1
    elif 800 <= a[i] < 1200:
        col[2] = 1
    elif 1200 <= a[i] < 1600:
        col[3] = 1
    elif 1600 <= a[i] < 2000:
        col[4] = 1
    elif 2000 <= a[i] < 2400:
        col[5] = 1
    elif 2400 <= a[i] < 2800:
        col[6] = 1
    elif 2800 <= a[i] < 3200:
        col[7] = 1
    elif 3200 <= a[i]:
        opt += 1
        
print(sum(col), sum(col)+opt)

Submission status: Wrong Answer

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

col = [0] * 8
opt = 0

for i in range(n):
    if 1 <= a[i] < 400:
        col[0] = 1
    elif 400 <= a[i] < 800:
        col[1] = 1
    elif 800 <= a[i] < 1200:
        col[2] = 1
    elif 1200 <= a[i] < 1600:
        col[3] = 1
    elif 1600 <= a[i] < 2000:
        col[4] = 1
    elif 2000 <= a[i] < 2400:
        col[5] = 1
    elif 2400 <= a[i] < 2800:
        col[6] = 1
    elif 2800 <= a[i] < 3200:
        col[7] = 1
    else:
        opt += 1
        
print(sum(col), sum(col)+opt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'choice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    if dic.get(color_judge(i)):
        dic[color_judge(i)] += 1
    else:
        dic[color_judge(i)] = 1
choice = 0
l = len(dic)
if dic.get('choice'):
    choice = dic['choice']
    l -= 1
print(max(1, l), min(8, l+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'choice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    if dic.get(color_judge(i)):
        dic[color_judge(i)] += 1
    else:
        dic[color_judge(i)] = 1
choice = 0
l = len(dic)
if dic.get('choice'):
    choice = dic['choice']
    l -= 1
print(max(l, l+(choice-l)), min(8, l+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'choice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    if dic.get(color_judge(i)):
        dic[color_judge(i)] += 1
    else:
        dic[color_judge(i)] = 1
choice = 0
l = len(dic)
if dic.get('choice'):
    choice = dic['choice']
    l -= 1
print(min(l, l+choice), min(8, l+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'choice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    if dic.get(color_judge(i)):
        dic[color_judge(i)] += 1
    else:
        dic[color_judge(i)] = 1
choice = 0
if dic.get('choice'):
    choice = dic['choice']
print(max(1, len(dic)-choice), min(8, len(dic)+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'choice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    dic[color_judge(i)] = 1
choice = 0
if dic.get('choice'):
    choice = dic['choice']
print(max(1, len(dic)-choice), min(8, len(dic)+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'choice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    dic[color_judge(i)] = 1
choice = 0
if dic.get('choice'):
    choice = dic['choice']
print(max(0, len(dic)-choice), min(8, len(dic)+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'cohice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    dic[color_judge(i)] = 1
choice = 0
if dic.get('choice'):
    choice = dic['choice']
print(max(0, len(dic)-choice), min(8, len(dic)+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'cohice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    dic[color_judge(i)] = 1
choice = 0
if dic.get('choice'):
    red = dic['choice']
print(max(0, len(dic)-choice), min(8, len(dic)+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'cohice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    dic[color_judge(i)] = 1
choice = 0
if dic.get('choice'):
    red = dic['choice']
print(max(0, len(dic)-choice), min(7, len(dic)+choice))

Submission status: Wrong Answer

Solution code:
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    dic[color_judge(i)] = 1
red = 0
if dic.get('red'):
    red = dic['red']
print(max(0, len(dic)-red), min(7, len(dic)+red))

Submission status: Wrong Answer

Solution code:
import sys,collections
input = sys.stdin.readline

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

Submission status: Wrong Answer

Solution code:
import sys,collections
input = sys.stdin.readline

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict, deque
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline()[:-1]


def solve():
    n = int(input())
    a = [int(x) for x in input().split()]
    w = set()
    c = 0
    for e in a:
        if 1 <= e <= 399:
            w.add(1)
        elif 400 <= e <= 799:
            w.add(2)
        elif 800 <= e <= 1199:
            w.add(3)
        elif 1200 <= e <= 1599:
            w.add(4)
        elif 1600 <= e <= 1999:
            w.add(5)
        elif 2000 <= e <= 2399:
            w.add(6)
        elif 2400 <= e <= 2799:
            w.add(7)
        elif 2800 <= e <= 3199:
            w.add(8)
        elif 3200 <= e:
            c += 1
    print(max(1, len(w)), min(8, len(w) + c))


t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()

"""

"""

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    N = ii()
    a = list(mi())
    d = [0]*9
    for i in range(N):
        if a[i] < 400:
            d[0] = 1
        elif a[i] < 800:
            d[1] = 1
        elif a[i] < 1200:
            d[2] = 1
        elif a[i] < 1600:
            d[3] = 1
        elif a[i] < 2000:
            d[4] = 1
        elif a[i] < 2400:
            d[5] = 1
        elif a[i] < 2800:
            d[6] = 1
        elif a[i] < 3200:
            d[7] = 1
        else:
            d[8] += 1

    print(max(d[8], sum(d[:-1])), sum(d))


if __name__ == '__main__':
    main()