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:
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(sum(d[:-1]), sum(d))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(min(1,ans)) + ' ' + str(ans+count_list[-1]))

Submission status: Wrong Answer

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

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(ans) + ' ' + str(ans+count_list[-1]))

Submission status: Wrong Answer

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

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(max(ans,1)) + ' ' + str(min(ans+count_list[-1],8)))

Submission status: Wrong Answer

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

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(max(ans,count_list[-1])) + ' ' + str(min(ans+count_list[-1],8)))

Submission status: Wrong Answer

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

flag = [0]*9
t = 0
x = 0
y = 400
while y <= 3200:
  for i in a:
    if x <= i < y: flag[t] = 1
  t += 1
  x += 400
  y += 400
else:
  for i in a:
    if 3200 <= i: flag[8] += 1

total = sum(flag)
print(total - flag[8], total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int, input().split()))
col=[0]*9
for i in range(n):
    j=min(8, a[i]//400)
    col[j]+=1
zero=0
cnt=0
for c in range(len(col)-1):
    if col[c]==0:
        zero+=1
    else:
        cnt+=1
m=max(cnt,1)
M=cnt+min(zero,col[-1])
print(m,M)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
color = [False]*8
over_human = 0
for i in a:
    if(i<=399):
        color[0]=True
    elif(i<=799):
        color[1]=True
    elif(i<=1199):
        color[2]=True
    elif(i<=1599):
        color[3]=True
    elif(i<=1999):
        color[4]=True
    elif(i<=2399):
        color[5]=True
    elif(i<=2799):
        color[6]=True
    elif(i<=3199):
        color[7]=True
    else:
        over_human += 1
if(color.count(True)==0):
    print(1,min(8,color.count(True)+over_human))
else:
    print(color.count(True),min(8,color.count(True)+over_human))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
color = [False]*8
over_human = 0
for i in a:
    if(i<=399):
        color[0]=True
    elif(i<=799):
        color[1]=True
    elif(i<=1199):
        color[2]=True
    elif(i<=1599):
        color[3]=True
    elif(i<=1999):
        color[4]=True
    elif(i<=2399):
        color[5]=True
    elif(i<=2799):
        color[6]=True
    elif(i<=3199):
        color[7]=True
    else:
        over_human += 1

print(color.count(True),min(8,color.count(True)+over_human))

Submission status: Wrong Answer

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

#%%
hai = 0
cha = 0
midori = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
above = 0
for a in A:
    if 1 <= a <= 399:
        hai = 1
    elif 400 <= a <= 799:
        cha = 1
    elif 800 <= a <= 1199:
        midori = 1
    elif 1200 <= a <= 1599:
        mizu = 1
    elif 1600 <= a <= 1999:
        ao = 1
    elif 2000 <= a <= 2399:
        ki = 1
    elif 2400 <= a <= 2799:
        dai = 1
    elif 2800 <= a <= 3199:
        aka = 1
    else:
        above += 1

n_rate = 8
total = hai + cha + midori + mizu + ao + ki + dai + aka

if total != 0:
    ans_min = total
else:
    ans_min = 1
    
ans_max = min(n_rate, total+above)

print(ans_min, ans_max)

Submission status: Wrong Answer

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

#%%
hai = 0
cha = 0
midori = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
above = 0
for a in A:
    if 1 <= a <= 399:
        hai = 1
    elif 400 <= a <= 799:
        cha = 1
    elif 800 <= a <= 1199:
        midori = 1
    elif 1200 <= a <= 1599:
        mizu = 1
    elif 1600 <= a <= 1999:
        ao = 1
    elif 2000 <= a <= 2399:
        ki = 1
    elif 2400 <= a <= 2799:
        dai = 1
    elif 2800 <= a <= 3199:
        aka = 1
    else:
        above += 1

n_rate = 8
total = hai + cha + midori + mizu + ao + ki + dai + aka

ans_min = min(n_rate, total + max(0, above - total))
ans_max = min(n_rate, total+above)

print(ans_min, ans_max)

Submission status: Wrong Answer

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

#%%
hai = 0
cha = 0
midori = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
above = 0
for a in A:
    if 1 <= a <= 399:
        hai = 1
    elif 400 <= a <= 799:
        cha = 1
    elif 800 <= a <= 1199:
        midori = 1
    elif 1200 <= a <= 1599:
        mizu = 1
    elif 1600 <= a <= 1999:
        ao = 1
    elif 2000 <= a <= 2399:
        ki = 1
    elif 2400 <= a <= 2799:
        dai = 1
    elif 2800 <= a <= 3199:
        aka = 1
    else:
        above += 1

n_rate = 8
total = hai + cha + midori + mizu + ao + ki + dai + aka

ans_min = max(n_rate, total + max(0, above - total))
ans_max = min(n_rate, total+above)

print(ans_min, ans_max)

Submission status: Wrong Answer

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

#%%
hai = 0
cha = 0
midori = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
above = 0
for a in A:
    if 1 <= a <= 399:
        hai = 1
    elif 400 <= a <= 799:
        cha = 1
    elif 800 <= a <= 1199:
        midori = 1
    elif 1200 <= a <= 1599:
        mizu = 1
    elif 1600 <= a <= 1999:
        ao = 1
    elif 2000 <= a <= 2399:
        ki = 1
    elif 2400 <= a <= 2799:
        dai = 1
    elif 2800 <= a <= 3199:
        aka = 1
    else:
        above += 1

n_rate = 8
total = hai + cha + midori + mizu + ao + ki + dai + aka

ans_max = min(n_rate, total+above)
ans_min = total + max(0, above - total)

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = list(map(int, input().split()))
rate = [400 * i for i in range(9)]
st = set()
rainbow = 0
for i in range(n):
  for j in range(8):
    if rate[j] <= lst[i] < rate[j + 1]:
      st.add(rate[j])
  if lst[i] >= 3200:
    rainbow += 1
if rainbow == n:
  print(1, n)
  exit()
print(len(st), min(8, len(st) + rainbow))

Submission status: Wrong Answer

Solution code:
n, *aa = map(int, open(0).read().split())

ranks = [a//400 for a in aa]

optional = [a for a in ranks if a>7]

ordinal = {a for a in ranks if a<=7}

print(len(ordinal), len(ordinal)+len(optional))

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = list(map(int, input().split()))
rate = [400 * i for i in range(9)] #+ [5000]
st = set()
rainbow = 0
for i in range(n):
  for j in range(8):
    if rate[j] <= lst[i] < rate[j + 1]:
      st.add(rate[j])
  if lst[i] >= 3200:
    rainbow += 1
print(len(st), len(st) + rainbow)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[0,0,0,0,0,0,0,0,0]
for i in range(n):
    if a[i]<400:
        ans[0]+=1
    if 400<=a[i]<800:
        ans[1]+=1
    if 800<=a[i]<1200:
        ans[2]+=1
    if 1200<=a[i]<1600:
        ans[3]+=1
    if 1600<=a[i]<2000:
        ans[4]+=1
    if 2000<=a[i]<2400:
        ans[5]+=1
    if 2400<=a[i]<2800:
        ans[6]+=1
    if 2800<=a[i]<3200:
        ans[7]+=1
    if 3200<=a[i]:
        ans[8]+=1
cnt=0
for i in range(8):
    if ans[i]!=0:
        cnt+=1
cnt2=cnt
if ans[8]!=0:
    cnt2=cnt+ans[8]
print(cnt,min(8,cnt2))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[0,0,0,0,0,0,0,0,0]
for i in range(n):
    if a[i]<400:
        ans[0]+=1
    if 400<=a[i]<800:
        ans[1]+=1
    if 800<=a[i]<1200:
        ans[2]+=1
    if 1200<=a[i]<1600:
        ans[3]+=1
    if 1600<=a[i]<2000:
        ans[4]+=1
    if 2000<=a[i]<2400:
        ans[5]+=1
    if 2400<=a[i]<2800:
        ans[6]+=1
    if 2800<=a[i]<3200:
        ans[7]+=1
    if 3200<=a[i]:
        ans[8]+=1
cnt=0
for i in range(8):
    if ans[i]!=0:
        cnt+=1
cnt2=cnt
if ans[8]!=0:
    cnt2=cnt+ans[8]
print(cnt,min(7,cnt2))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[0,0,0,0,0,0,0,0,0]
for i in range(n):
    if a[i]<400:
        ans[0]+=1
    if 400<=a[i]<800:
        ans[1]+=1
    if 800<=a[i]<1200:
        ans[2]+=1
    if 1200<=a[i]<1600:
        ans[3]+=1
    if 1600<=a[i]<2000:
        ans[4]+=1
    if 2000<=a[i]<2400:
        ans[5]+=1
    if 2400<=a[i]<2800:
        ans[6]+=1
    if 2800<=a[i]<3200:
        ans[7]+=1
    if 3200<=a[i]:
        ans[8]+=1
cnt=0
for i in range(8):
    if ans[i]!=0:
        cnt+=1
cnt2=cnt
if ans[8]!=0:
    cnt2=cnt+2
print(cnt,min(7,cnt2))

Submission status: Wrong Answer

Solution code:
n,*l=map(int,open(0).read().split())
c,*l=[0]*9
for i in l:
  if i<3200: l[i//400]=1
  else: c+=1
print(max(1,sum(l)),sum(l)+c)

Submission status: Wrong Answer

Solution code:
N = int(input())
lank = [0, 0, 0, 0, 0, 0, 0, 0]
a = list(map(int, input().split()))

for i in range(N):
    if 1 <= a[i] <= 399:
        lank[0] = 1
    elif 400 <= a[i] <= 799:
        lank[1] = 1
    elif 800 <= a[i] <= 1199:
        lank[2] = 1
    elif 1200 <= a[i] <= 1599:
        lank[3] = 1
    elif 1600 <= a[i] <= 1999:
        lank[4] = 1
    elif 2000 <= a[i] <= 2399:
        lank[5] = 1
    elif 2400 <= a[i] <= 2799:
        lank[6] = 1
    elif 2800 <= a[i] <= 3199:
        lank[7] = 1
    else:
        if 0 in lank:
            idx = lank.index(0)
            lank[idx] = 2

number_min = max(1, lank.count(1))
number_max = lank.count(1) + lank.count(2)

print(number_min, number_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
lank = [0, 0, 0, 0, 0, 0, 0, 0]
a = list(map(int, input().split()))

for i in range(N):
    if 1 <= a[i] <= 399:
        lank[0] = 1
    elif 400 <= a[i] <= 799:
        lank[1] = 1
    elif 800 <= a[i] <= 1199:
        lank[2] = 1
    elif 1200 <= a[i] <= 1599:
        lank[3] = 1
    elif 1600 <= a[i] <= 1999:
        lank[4] = 1
    elif 2000 <= a[i] <= 2399:
        lank[5] = 1
    elif 2400 <= a[i] <= 2799:
        lank[6] = 1
    elif 2800 <= a[i] <= 3199:
        lank[7] = 1
    else:
        if 0 in lank:
            idx = lank.index(0)
            lank[idx] = 2

number_min = lank.count(1)
number_max = lank.count(1) + lank.count(2)

if all([i == 2 for i in lank]):
    print(1, lank.count(2))
else:
    print(number_min, number_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
lank = [0, 0, 0, 0, 0, 0, 0, 0]
a = list(map(int, input().split()))

for i in range(N):
    if 1 <= a[i] <= 399:
        lank[0] = 1
    elif 400 <= a[i] <= 799:
        lank[1] = 1
    elif 800 <= a[i] <= 1199:
        lank[2] = 1
    elif 1200 <= a[i] <= 1599:
        lank[3] = 1
    elif 1600 <= a[i] <= 1999:
        lank[4] = 1
    elif 2000 <= a[i] <= 2399:
        lank[5] = 1
    elif 2400 <= a[i] <= 2799:
        lank[6] = 1
    elif 2800 <= a[i] <= 3199:
        lank[7] = 1
    else:
        if 0 in lank:
            idx = lank.index(0)
            lank[idx] = 2

number_min = lank.count(1)
number_max = lank.count(1) + lank.count(2)

print(number_min, number_max)

Submission status: Wrong Answer

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    a = LI()

    color = [0] * 9
    for i in a:
        if 0 <= i < 400:
            color[0] += 1
        elif 400 <= i < 800:
            color[1] += 1
        elif 800 <= i < 1200:
            color[2] += 1
        elif 1200 <= i < 1600:
            color[3] += 1
        elif 1600 <= i < 2000:
            color[4] += 1
        elif 2000 <= i < 2400:
            color[5] += 1
        elif 2400 <= i < 2800:
            color[6] += 1
        elif 2800 <= i < 3200:
            color[7] += 1
        else:
            color[8] += 1
    
    ans_min = len([i for i in color[:8] if i > 0]) 

    print(ans_min, ans_min + color[8])

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

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

color_set = set()
color_free_num = 0
for a_i in a:
    if a_i >= 3200:
        color_free_num += 1
    else:
        color_set.add(a_i // 400)

ans_min = max(len(color_set), 1)
ans_max = ans_min + color_free_num
ans = "{} {}".format(ans_min, ans_max)
print(ans)

Submission status: Wrong Answer

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

color_set = set()
color_free_num = 0
for a_i in a:
    if a_i >= 3200:
        color_free_num += 1
    else:
        color_set.add(a_i // 400)

ans_min = len(color_set)
ans_max = ans_min + color_free_num
ans = "{} {}".format(ans_min, ans_max)
print(ans)

Submission status: Wrong Answer

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

color_set = set()
color_free_num = 0
for a_i in a:
    if a_i >= 3200:
        color_free_num += 1
    else:
        color_set.add(a_i // 400)

ans_min = len(color_set)
ans_max = min(ans_min + color_free_num, 8)
ans = "{} {}".format(ans_min, ans_max)
print(ans)

Submission status: Wrong Answer

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

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

def rank(n):
    if 1 <= n <= 399:
        return 'gray'
    elif 400 <= n <= 799:
        return 'brown'
    elif 800 <= n <= 1199:
        return 'green'
    elif 1200 <= n <= 1599:
        return 'skyblue'
    elif 1600 <= n <= 1999:
        return 'blue'
    elif 2000 <= n <= 2399:
        return 'yellow'
    elif 2400 <= n <= 2799:
        return 'orange'
    elif 2800 <= n <= 3199:
        return 'red'
    else:
        return 'others'

colors = [rank(a[i]) for i in range(n)]
numother = colors.count('others')
colors = set(colors)

if 'others' in colors:
    colors.remove('others')
    minimum = len(colors)
    tmp = minimum
    if minimum == 0:
        minimum = 1 
    maximum = len(colors) + tmp 
else:
    minimum = len(colors)
    maximum = minimum

print(minimum, maximum)

Submission status: Wrong Answer

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

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

def rank(n):
    if 1 <= n <= 399:
        return 'gray'
    elif 400 <= n <= 799:
        return 'brown'
    elif 800 <= n <= 1199:
        return 'green'
    elif 1200 <= n <= 1599:
        return 'skyblue'
    elif 1600 <= n <= 1999:
        return 'blue'
    elif 2000 <= n <= 2399:
        return 'yellow'
    elif 2400 <= n <= 2799:
        return 'orange'
    elif 2800 <= n <= 3199:
        return 'red'
    else:
        return 'others'

colors = [rank(a[i]) for i in range(n)]
numother = colors.count('others')
colors = set(colors)

if 'others' in colors:
    colors.remove('others')
    minimum = len(colors)
    tmp = minimum
    if minimum == 0:
        minimum = 1 
    minimum = tmp 
    maximum = len(colors) + numother 
else:
    minimum = len(colors)
    maximum = minimum

print(minimum, maximum)

Submission status: Wrong Answer

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

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

def rank(n):
    if 1 <= n <= 399:
        return 'gray'
    elif 400 <= n <= 799:
        return 'brown'
    elif 800 <= n <= 1199:
        return 'green'
    elif 1200 <= n <= 1599:
        return 'skyblue'
    elif 1600 <= n <= 1999:
        return 'blue'
    elif 2000 <= n <= 2399:
        return 'yellow'
    elif 2400 <= n <= 2799:
        return 'orange'
    elif 2800 <= n <= 3199:
        return 'red'
    else:
        return 'others'

colors = [rank(a[i]) for i in range(n)]
numother = colors.count('others')
colors = set(colors)

if 'others' in colors:
    colors.remove('others')
    minimum = len(colors)
    maximum = len(colors) + numother 
else:
    minimum = len(colors)
    maximum = minimum

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

def f(rate):
    global zero
    color = [400,800,1200,1600,2000,2400,2800,3200]
    for i in range(8):
        if rate < color[i]:
            return i
if __name__ == "__main__":
    cnt = [0,0,0,0,0,0,0,0]
    n = I()
    a = Intl()
    zero = 0
    ans = 0
    for i in a:
        if i < 3200:cnt[f(i)] = 1
        else:zero += 1
    #print(cnt)
    print(max(1,sum(cnt)),min(8,sum(cnt)+zero))

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

def f(rate):
    color = [399,799,1199,1599,1999,2399,2799,3199]
    for i in range(8):
        if rate <= color[i]:
            return i
    return 8
if __name__ == "__main__":
    cnt = [0,0,0,0,0,0,0,0,0]
    n = I()
    a = Intl()
    zero = 0
    ans = 0
    for i in a:
        cnt[f(i)] += 1
    for i in cnt[:-1]:
        if i == 0:
            zero += 1
        else:
            ans += 1
    #print(cnt)
    print(max(1,ans),ans+min(zero,cnt[-1]))

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

def f(rate):
    color = [399,799,1199,1599,1999,2399,2799,3199]
    for i in range(8):
        if rate <= color[i]:
            return i
    return 8
if __name__ == "__main__":
    cnt = [0,0,0,0,0,0,0,0,0]
    n = I()
    a = Intl()
    zero = 0
    ans = 0
    for i in a:
        cnt[f(i)] += 1
    for i in cnt[:-1]:
        if i == 0:
            zero += 1
        else:
            ans += 1
    print(cnt)
    print(max(1,ans),ans+min(zero,cnt[-1]))

Submission status: Wrong Answer

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

rate = set()
free = 0
for a in A:
    if a < 3200:
        rate.add(a // 400)
    else:
        free += 1

if len(rate) == 0:
    color_min, color_max = 1, min(n, 8)
else:
    color_min, color_max = len(rate), min(len(rate) + free, 8)

print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = map(int, input().split())
rate = [0] * 9
for a in A:
    tmp = a if a < 3200 else 3200
    rate[tmp // 400] += 1
color_min = 8 - rate[:-1].count(0)
color_max = min(color_min + rate[-1], 8)
color_min = max(1, color_min)
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = map(int, input().split())
rate = [0] * 9
for a in A:
    tmp = a if a < 3600 else 3599
    rate[tmp // 400] += 1
color_min = 8 - rate[:-1].count(0)
color_max = color_min + (min(rate[-1], rate[:-1].count(0)) if rate[-1] > 0 else 0)
color_min = max(1, color_min)
print(color_min, color_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = map(int, input().split())
rate = [0] * 9
for a in A:
    tmp = a if a < 3600 else 3599
    rate[tmp // 400] += 1
color_min = 8 - rate[:-1].count(0)
color_max = color_min + (min(rate[-1], rate[:-1].count(0)) if rate[-1] > 0 else 0)
print(color_min, color_max)

Submission status: Wrong Answer

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

CO = [0] * 8
o32 = 0
for a in A:
    if a >= 3200:
        o32 += 1
        continue
    for i in range(8):
        if 4*i*100 <= a < 4*(i+1)*100: 
            CO[i] += 1
ans = 0
for count in CO:
    if count > 0:
        ans += 1
print(1 if ans==0 else ans, min(8, ans+o32))

Submission status: Wrong Answer

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

CO = [0] * 8
o32 = 0
for a in A:
    for i in range(8):
        if 4*i*100 <= a < 4*(i+1)*100: 
            CO[i] += 1
    else:
        if a >= 3200:
            o32 += 1
ans = 0
for count in CO:
    if count > 0:
        ans += 1
print(1 if ans==0 and o32>0 else ans, ans+o32 if ans+o32 <= 8 else 8)

Submission status: Wrong Answer

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

CO = [0] * 8
o32 = 0
for a in A:
    for i in range(8):
        if 4*i*100 <= a < 4*(i+1)*100: 
            CO[i] += 1
    else:
        if a >= 3200:
            o32 += 1
ans = 0
for count in CO:
    if count > 0:
        ans += 1
print(ans, ans+o32 if ans+o32 <= 8 else 8)

Submission status: Wrong Answer

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

if c != 0 and not 1 in R:
    mi = R.count(1) + 1
else:
    mi = R.count(1)
ma = min(8, R.count(1) + c)

print(mi, ma)

Submission status: Wrong Answer

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

color = [0]*8
cnt = 0
free = 0

for x in a:
    tmp = x // 400
    if tmp >= 8:
        free += 1
        continue
    if color[tmp] == 0:
        color[tmp] = 1
        cnt += 1

print(max(cnt, 1), min(cnt + free, 8))

Submission status: Wrong Answer

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

color = [0]*13
cnt = 0
free = 0

for x in a:
    tmp = x // 400
    if tmp >= 8:
        free += 1
        continue
    if color[tmp] == 0:
        color[tmp] = 1
        cnt += 1

print(max(cnt, 1), min(cnt + free, 8))

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

def f(rate):
    color = [399,799,1199,1599,1999,2399,2799,3199]
    for i in range(8):
        if rate <= color[i]:
            return i
    return 8
if __name__ == "__main__":
    cnt = [0,0,0,0,0,0,0,0,0]
    n = I()
    a = Intl()
    zero = 0
    ans = 0
    for i in a:
        cnt[f(i)] += 1
    for i in cnt[:-1]:
        if i == 0:
            zero += 1
        else:
            ans += 1
    print(ans,ans+min(zero,cnt[-1]))

Submission status: Wrong Answer

Solution code:
import bisect

n = int(input())
a = list(map(int,input().split()))
a.sort()
sect = 0
col = 0
for i in range(400,3201,400):
    nsect = bisect.bisect_left(a,i)
    if nsect>sect:
        sect = nsect
        col += 1
print(col,col+n-nsect)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
a = [int(x) // 400 for x in input().split()]
cnt = Counter(a)

min_col = 0     # レート3200未満の人の色の数
for i in range(8):
    if cnt[i]:
        min_col += 1

if min_col == 0:  # 全員3200以上
    min_col = 1
    max_col = N
else:
    max_col = min_col + cnt[8]

print(min_col, max_col)

Submission status: Wrong Answer

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

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = 0
p = flag.count(True)
if p > 0: minNum = p
elif p == 0 and t > 0:
  minNum = 1
  
maxNum = minNum + t

print(minNum,maxNum)

Submission status: Wrong Answer

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

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = 0
p = flag.count(True)
if p > 0: minNum = p
elif p == 0 and t > 0:
  minNum = 1
  minNum -= 1
  
maxNum = minNum + t

print(minNum,maxNum)

Submission status: Wrong Answer

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

rate = [0 for _ in range(9)]
#print(rate)
for i in a:
  if 1<=i<=399:
    rate[0]+=1
  elif 400<=i<=799:
    rate[1]+=1
  elif 800<=i<=1199:
    rate[2]+=1
  elif 1200<=i<=1599:
    rate[3]+=1
  elif 1600<=i<=1999:
    rate[4]+=1
  elif 2000<=i<=2399:
    rate[5]+=1
  elif 2400<=i<=2799:
    rate[6]+=1
  elif 2800<=i<=3199:
    rate[7]+=1
  else:
    rate[8]+=1
    
#print(rate)

ans = 0

for j in range(8):
  if rate[j] != 0:
    ans += 1

print(ans, ans+rate[8])