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()))
dct = {}

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

color1 = 0
color2 = 0
for i in dct.items():  
  if (i[0] == 8):
    color2 += i[1]
  else:
    if (i[1] > 0):
      color1 += 1
ans1 = 0
ans2 = min(8,color1+color2)
if (color1 == 0):
  ans1 = 1
else:
  ans1 = color1
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = [False] * 8
a = list(map(int,input().split()))
a.sort()
CntOver3200 = 0

for i in range(N):
    if a[i] >= 3200:
        CntOver3200 = N - i
        break
    rate[a[i] // 400] = True
min_val = max(sum(rate) , 1)
max_val = min_val + CntOver3200
print(min_val , max_val)

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = [False] * 8
a = list(map(int,input().split()))
a.sort()
CntOver3200 = 0

for i in range(N):
    if a[i] >= 3200:
        CntOver3200 = N - i
        break
    rate[a[i] // 400] = True
min_val = sum(rate)
max_val = min_val + CntOver3200
print(min_val , max_val)

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = [False] * 8
a = list(map(int,input().split()))
a.sort()
CntOver3200 = 0

for i in range(N):
    if a[i] >= 3200:
        CntOver3200 = N - i
        break
    rate[a[i] // 400] = True
min_val = sum(rate)
max_val = min(min_val + CntOver3200 , 8)
print(min_val , max_val)

Submission status: Wrong Answer

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

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if n==1 or d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if n==1:
    w
    print(1)
elif k==-1:
    print(d)
else:
    print(min(8,d+(n-k)))

Submission status: Wrong Answer

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

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if n==1 or d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if n==1:
    print(1)
elif k==-1:
    print(d)
else:
    print(min(8,d+(n-k)))

Submission status: Wrong Answer

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

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if k==-1:
    print(d)
else:
    print(min(8,d+(n-k)))

Submission status: Wrong Answer

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

def check(n):
    if(n<400):
        color='ash'
    elif(n<800):
        color='brown'
    elif(n<1200):
        color='green'
    elif(n<1600):
        color='water'
    elif(n<2000):
        color='blue'
    elif(n<2400):
        color='yellow'
    elif(n<2800):
        color='orange'
    elif(n<3200):
        color='red'
    else:
        color='free'
    return color
ans=[]
use=[]
ans_num=0
for i in range(n):
    color=check(a[i])
    if(color not in ans or color=='free'):
        ans.append(color)
color_variation=['ash','brown','green','water','blue','yellow','orange','red']
for i in ans:
    if(i in color_variation):
        use.append(color_variation.pop(color_variation.index(i)))
if(ans.count('free')>=len(color_variation)):
    ans_num=len(color_variation)
else:
    ans_num=ans.count('free')
print(len(use),len(use)+ans_num)

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    cnt = 0
    col = set()
    for a in A:
        if a>=3200:
            cnt += 1
        else:
            col.add(a//400)
    print(max(1,len(col)), min(8, len(col)+cnt))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    cnt = 0
    col = set()
    for a in A:
        if a>=3200:
            cnt += 1
        else:
            col.add(a//400)
    print(len(col), min(8, len(col)+cnt))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

l = [0] * 9

for i in range(n):
    s = min(a[i] // 400, 8)
    l[s] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

print(max(m, 1), min(8, l[-1] + m))

Submission status: Wrong Answer

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

l = [0] * 9

for i in range(n):
    s = min(a[i] // 400, 8)
    l[s] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

M = min(9, l[-1] + m)
print(max(m, 1), M)

Submission status: Wrong Answer

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

l = [0] * 9

for i in range(n):
    s = min(a[i] // 400, 8)
    l[s] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

M = min(9, l[-1] + m)
print(m, M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

def CheckColor(a):
    global free_count
    if 1 <= a and a <= 399:
        return 'gray'
    elif 400 <= a and a <= 799:
        return 'blown'
    elif 800 <= a and a <= 1199:
        return 'green'
    elif 1200 <= a and a <= 1599:
        return 'water'
    elif 1600 <= a and a <= 1999:
        return 'blue'
    elif 2000 <= a and a <= 2399:
        return 'yellow'
    elif 2400 <= a and a <= 2799:
        return 'orange'
    elif 2800 <= a and a <= 3199:
        return 'red'
    else:
        free_count += 1
        return 'free'

def Max(L):
    global free_count
    max_num = min_num + free_count
    if max_num > 8:
        return 8        
    else:
        return max_num

def Min(L):
    global min_num
    if 'free' in ans_set:
        min_num = len(L) - 1
    else:
        min_num = len(L)
    return min_num


ans_list = []
count = 0
min_num = 0
free_count = 0

for a in A:
    ans_list.append(CheckColor(a))

ans_set = set(ans_list)

print(Min(ans_set), Max(ans_set))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

def CheckColor(a):
    global free_count
    if 1 <= a and a <= 399:
        return 'gray'
    elif 400 <= a and a <= 799:
        return 'blown'
    elif 800 <= a and a <= 1199:
        return 'green'
    elif 1200 <= a and a <= 1599:
        return 'water'
    elif 1600 <= a and a <= 1999:
        return 'blue'
    elif 2000 <= a and a <= 2399:
        return 'yellow'
    elif 2400 <= a and a <= 2799:
        return 'orange'
    elif 2800 <= a and a <= 3199:
        return 'red'
    else:
        free_count += 1
        return 'free'

def Max(L):
    global gree_count
    max_num = min_num + free_count
    if max_num > 8:
        return 8        
    else:
        return max_num

def Min(L):
    global min_num
    if 'free' in ans_set:
        min_num = len(L) - 1
    else:
        min_num = len(L)
    return min_num


ans_list = []
count = 0
min_num = 0
free_count = 0

for a in A:
    ans_list.append(CheckColor(a))

ans_set = set(ans_list)

print(Min(ans_set), Max(ans_set))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

def CheckColor(a):
    global free_count
    if 1 <= a and a <= 399:
        return 'gray'
    elif 400 <= a and a <= 799:
        return 'blown'
    elif 800 <= a and a <= 1199:
        return 'green'
    elif 1200 <= a and a <= 1599:
        return 'water'
    elif 1600 <= a and a <= 1999:
        return 'blue'
    elif 2000 <= a and a <= 2399:
        return 'yellow'
    elif 2400 <= a and a <= 2799:
        return 'orange'
    elif 2800 <= a and a <= 3199:
        return 'red'
    else:
        free_count += 1
        return 'free'

def Max(L):
    global gree_count
    max_num = min_num + free_count
    if max_num > 7:
        return 7        
    else:
        return max_num

def Min(L):
    global min_num
    if 'free' in ans_set:
        min_num = len(L) - 1
    else:
        min_num = len(L)
    return min_num


ans_list = []
count = 0
min_num = 0
free_count = 0

for a in A:
    ans_list.append(CheckColor(a))

ans_set = set(ans_list)

print(Min(ans_set), Max(ans_set))

Submission status: Wrong Answer

Solution code:
N = int(input())
color = [0]*8
free = 0
A = list(map(int,input().split()))
for a in A:
    if 1<=a<=399:
        color[0] = 1
    elif 400<=a<=799:
        color[1] = 1
    elif 800<=a<=1199:
        color[2] = 1
    elif 1200<=a<=1599:
        color[3] = 1
    elif 1600<=a<=1999:
        color[4] = 1
    elif 2000<=a<=2399:
        color[5] = 1
    elif 2400<=a<=2799:
        color[6] = 1
    elif 2800<=a<=3199:
        color[7] = 1
    else:
        free += 1
maxcolor = sum(color)+free
mincolor = sum(color)
print(mincolor,maxcolor)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt1 = cnt2 = cnt3 = cnt4 = cnt5 = cnt6 = cnt7 = cnt8 = cnt9 =0
for num in a:
  if 1<=num<400:
    cnt1 += 1
  elif 400<=num<800:
    cnt2 += 1
  elif 800<=num<1200:
    cnt3 += 1 
  elif 1200<=num<1600:
    cnt4 += 1   
  elif 1600<=num<2000:
    cnt5 += 1 
  elif 2000<=num<2400:
    cnt6 += 1
  elif 2400<=num<2800:
    cnt7 += 1
  elif 2800<=num<3200:
    cnt8 += 1
  else:
    cnt9 += 1
cnt = [cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,cnt7,cnt8]

ans = 0
for c in cnt:
  if c != 0:
    ans += 1

if ans+cnt9 > 8:
  print(ans,8)
else:
  print(ans,ans+cnt9)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt1 = cnt2 = cnt3 = cnt4 = cnt5 = cnt6 = cnt7 = cnt8 = cnt9 =0
for num in a:
  if 1<=num<400:
    cnt1 += 1
  elif 400<=num<800:
    cnt2 += 1
  elif 800<=num<1200:
    cnt3 += 1 
  elif 1200<=num<1600:
    cnt4 += 1   
  elif 1600<=num<2000:
    cnt5 += 1 
  elif 2000<=num<2400:
    cnt6 += 1
  elif 2400<=num<2800:
    cnt7 += 1
  elif 2800<=num<3200:
    cnt8 += 1
  else:
    cnt9 += 1
cnt = [cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,cnt7,cnt8]

ans = 0
for c in cnt:
  if c != 0:
    ans += 1
print(ans,ans+cnt9)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
wild_cnt = 0
colors = []
for i in a:
  if 1 <= i <= 399:
    colors.append("g")
  elif 400 <= i <= 799:
    colors.append("br")
  elif 800 <= i <= 1199:
    colors.append("gr")
  elif 1200 <= i <= 1599:
    colors.append("wa")
  elif 1600 <= i <= 1999:
    colors.append("bl")
  elif 2000 <= i <= 2399:
    colors.append("y")
  elif 2400 <= i <= 2799:
    colors.append("o")
  elif 2800 <= i <= 3199:
    colors.append("r")
  elif 3200 <= i:
    wild_cnt += 1
print(str(len(set(colors)))+ " " +str(min(n,len(set(colors)) + wild_cnt)))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = [0] * 8
free = 0

a = 400 
    
for i in range(0,N):
    if rate[i] < a:
        color[0] = 1
    elif a <= rate[i] < 2*a:
        color[1] = 1
    elif 2*a <= rate[i] < 3*a:
        color[2] = 1
    elif 3*a <= rate[i] < 4*a:
        color[3] = 1
    elif 4*a <= rate[i] < 5*a:
        color[4] = 1
    elif 5*a <= rate[i] < 6*a:
        color[5] = 1
    elif 6*a <= rate[i] < 7*a:
        color[6] = 1
    elif 7*a <= rate[i] < 8*a:
        color[7] = 1
    elif 8*a <= rate[i]:
        free += 1
        

min_color = 0
max_color = 0

print( max(color.count(1),1), min_color + free)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = [0] * 9

a = 400 
    
for i in range(0,N):
    if rate[i] < a:
        color[0] = 1
    elif a <= rate[i] < 2*a:
        color[1] = 1
    elif 2*a <= rate[i] < 3*a:
        color[2] = 1
    elif 3*a <= rate[i] < 4*a:
        color[3] = 1
    elif 4*a <= rate[i] < 5*a:
        color[4] = 1
    elif 5*a <= rate[i] < 6*a:
        color[5] = 1
    elif 6*a <= rate[i] < 7*a:
        color[6] = 1
    elif 7*a <= rate[i] < 8*a:
        color[7] = 1
    elif 8*a <= rate[i]:
        color[8] += 1
        

min_color = 0
max_color = 0



print( max(color[:8].count(1),1), min_color + color[8])

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if rate[i] < a:
        color[0] = 1
    elif a <= rate[i] < 2*a:
        color[1] = 1
    elif 2*a <= rate[i] < 3*a:
        color[2] = 1
    elif 3*a <= rate[i] < 4*a:
        color[3] = 1
    elif 4*a <= rate[i] < 5*a:
        color[4] = 1
    elif 5*a <= rate[i] < 6*a:
        color[5] = 1
    elif 6*a <= rate[i] < 7*a:
        color[6] = 1
    elif 7*a <= rate[i] < 8*a:
        color[7] = 1
    elif 8*a <= rate[i]:
        color[8] += 1
        

min_color = 0
max_color = 0

min_color = color.count(1)
max_color = min_color + color[8]

print( max(min_color,1), max_color)

Submission status: Wrong Answer

Solution code:

N = int(input())

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

color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] = 1
        elif a <= rate[i] < 2*a:
            color[1] = 1
        elif 2*a <= rate[i] < 3*a:
            color[2] = 1
        elif 3*a <= rate[i] < 4*a:
            color[3] = 1
        elif 4*a <= rate[i] < 5*a:
            color[4] = 1
        elif 5*a <= rate[i] < 6*a:
            color[5] = 1
        elif 6*a <= rate[i] < 7*a:
            color[6] = 1
        elif 7*a <= rate[i] < 8*a:
            color[7] = 1

min_color = 0
max_color = 0

min_color = color.count(1)
max_color = min_color + color[8]

print( max(1,min_color) , max_color )

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] = 1
        elif a <= rate[i] < 2*a:
            color[1] = 1
        elif 2*a <= rate[i] < 3*a:
            color[2] = 1
        elif 3*a <= rate[i] < 4*a:
            color[3] = 1
        elif 4*a <= rate[i] < 5*a:
            color[4] = 1
        elif 5*a <= rate[i] < 6*a:
            color[5] = 1
        elif 6*a <= rate[i] < 7*a:
            color[6] = 1
        elif 7*a <= rate[i] < 8*a:
            color[7] = 1

min_color = 0
max_color = 0

min_color = color.count(1)
max_color = min_color + color[8]

print( max(1,min_color) , min(max_color,8) )

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] = 1
        elif a <= rate[i] < 2*a:
            color[1] = 1
        elif 2*a <= rate[i] < 3*a:
            color[2] = 1
        elif 3*a <= rate[i] < 4*a:
            color[3] = 1
        elif 4*a <= rate[i] < 5*a:
            color[4] = 1
        elif 5*a <= rate[i] < 6*a:
            color[5] = 1
        elif 6*a <= rate[i] < 7*a:
            color[6] = 1
        elif 7*a <= rate[i] < 8*a:
            color[7] = 1

min_color = 0
max_color = 0

if flag == 1:
    min_color = 1
else:
    min_color = color.count(1)

max_color = min_color + color[8]

if min_color >= 8:
    min_color = 8
else:
    pass

if max_color >= 8:
    max_color = 8
else:
    pass    

print(min_color,max_color)

Submission status: Wrong Answer

Solution code:


N = int(input())

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

color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] = 1
        elif a <= rate[i] < 2*a:
            color[1] = 1
        elif 2*a <= rate[i] < 3*a:
            color[2] = 1
        elif 3*a <= rate[i] < 4*a:
            color[3] = 1
        elif 4*a <= rate[i] < 5*a:
            color[4] = 1
        elif 5*a <= rate[i] < 6*a:
            color[5] = 1
        elif 6*a <= rate[i] < 7*a:
            color[6] = 1
        elif 7*a <= rate[i] < 8*a:
            color[7] = 1

min_color = 0
max_color = 0

if flag == 1:
    min_color = color[8]
else:
    min_color = color.count(1)

max_color = min_color + color[8]

if min_color >= 8:
    min_color = 8
else:
    pass

if max_color >= 8:
    max_color = 8
else:
    pass    

print(min_color,max_color)

Submission status: Wrong Answer

Solution code:

N = int(input())

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

color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] = 1
        elif a <= rate[i] < 2*a:
            color[1] = 1
        elif 2*a <= rate[i] < 3*a:
            color[2] = 1
        elif 3*a <= rate[i] < 4*a:
            color[3] = 1
        elif 4*a <= rate[i] < 5*a:
            color[4] = 1
        elif 5*a <= rate[i] < 6*a:
            color[5] = 1
        elif 6*a <= rate[i] < 7*a:
            color[6] = 1
        elif 7*a <= rate[i] < 8*a:
            color[7] = 1

min_color = 0
max_color = 0

if flag == 1:
    min_color = color[8]
else:
    min_color = color.count(1)

max_color = min_color + color[8]

if max_color >= 8:
    max_color = 8
else:
    pass    

print(min_color,max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = []
color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] += 1
        elif a <= rate[i] < 2*a:
            color[1] += 1
        elif 2*a <= rate[i] < 3*a:
            color[2] += 1
        elif 3*a <= rate[i] < 4*a:
            color[3] += 1
        elif 4*a <= rate[i] < 5*a:
            color[4] += 1
        elif 5*a <= rate[i] < 6*a:
            color[5] += 1
        elif 6*a <= rate[i] < 7*a:
            color[6] += 1
        elif 7*a <= rate[i] < 8*a:
            color[7] += 1

min_color = 0
max_color = 0

if color[8] == 0:
    min_color = 9 - color.count(0)
    max_color = min_color
else:
    if flag == 1:
        min_color = 1
        if color[8] >= 8:
            max_color = 8
        else:
            max_color = color[8]
    else:
        min_color = 8 - color.count(0)
        if min_color + color[8] >= 8:
            max_color = 8
        else:
            max_color = min_color + color[8]
            
            
print(min_color,max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = []
color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] += 1
        elif a <= rate[i] < 2*a:
            color[1] += 1
        elif 2*a <= rate[i] < 3*a:
            color[2] += 1
        elif 3*a <= rate[i] < 4*a:
            color[3] += 1
        elif 4*a <= rate[i] < 5*a:
            color[4] += 1
        elif 5*a <= rate[i] < 6*a:
            color[5] += 1
        elif 6*a <= rate[i] < 7*a:
            color[6] += 1
        elif 7*a <= rate[i] < 8*a:
            color[7] += 1

min_color = 0
max_color = 0

if color[8] == 0:
    min_color = 9 - color.count(0)
    max_color = min_color
else:
    if flag == 1:
        min_color = 1
        max_color = color[8]
    else:
        min_color = 8 - color.count(0)
        if min_color + color[8] >= 8:
            max_color = 8
        else:
            max_color = min_color + color[8]
            
            
print(min_color,max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

color = []
color = [0] * 9

a = 400 
flag = 1
    
for i in range(0,N):
    if 8*a <= rate[i]:
        color[8] += 1
    else:
        flag = 0
        if rate[i] < a:
            color[0] += 1
        elif a <= rate[i] < 2*a:
            color[1] += 1
        elif 2*a <= rate[i] < 3*a:
            color[2] += 1
        elif 3*a <= rate[i] < 4*a:
            color[3] += 1
        elif 4*a <= rate[i] < 5*a:
            color[4] += 1
        elif 5*a <= rate[i] < 6*a:
            color[5] += 1
        elif 6*a <= rate[i] < 7*a:
            color[6] += 1
        elif 7*a <= rate[i] < 8*a:
            color[7] += 1

min_color = 0
max_color = 0


if color[8] == 0:
    min_color = 9 - color.count(0)
    max_color = min_color
else:
    if flag == 1:
        min_color = 1
    else:
        min_color = 8 - color.count(0)
        if min_color + color[8] >= 8:
            max_color = 8
        else:
            max_color = min_color + color[8]
            
            
print(min_color,max_color)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
L = [False]*8
cnt = 0
for a in A:
  if 1 <= a <= 399:
    L[0] = True
  elif 400<=a<=799:
    L[1] = True
  elif 800<=a<=1199:
    L[2] = True
  elif 1200<=a<=1599:
    L[3] = True
  elif 1600<=a<=1999:
    L[4] = True
  elif 2000<=a<=2399:
    L[5] = True
  elif 2400<=a<=2799:
    L[6] = True
  elif 2800<=a<=3199:
    L[7] = True
  else:
    cnt += 1
print(sum(L),sum(L)+cnt)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = [0]*9

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

mi = lin[:-2].count(1)
if mi == 0:
    mi = 1
ma = mi+lin[-1]
print(mi,ma)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = [0]*9

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

mi = lin[:-1].count(1)
if mi == 0:
    mi = 1
ma = mi+lin[-1]

print(mi,ma)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = [0]*9

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

mi = lin[:-1].count(1)
ma = mi+lin[-1]

print(mi,ma)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = [0]*9

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

mi = lin[:-1].count(1)
if mi + lin[-1] > 8:
    ma = 8
else:
    ma = mi+lin[-1]

print(mi,ma)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = [0]*9

for i in li:
    if 1<= i < 400:
        lin[0] = 1
    elif 400<= i < 800:
        lin[1] = 1
    elif 800<= i < 1200:
        lin[2] = 1
    elif 1200<= i < 1600:
        lin[3] = 1
    elif 1600<= i < 2000:
        lin[4] = 1
    elif 2000<= i < 2400:
        lin[5] = 1
    elif 2400<= i < 2800:
        lin[6] = 1
    elif 2800<= i < 3200:
        lin[7] = 1
    else:
        lin[8] += 1
mi = lin[:-1].count(1)
if lin[8] > 8-mi:
    ma = 8
else:
    ma = mi+lin[-1]

print(mi,ma)

Submission status: Wrong Answer

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

b=[ai//400 for ai in a]

ans=0
for i in range(8):
    if i in b:
        ans+=1

m=sum([b.count(i) for i in range(8,13)])

print(ans,ans+m)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
C = [400, 800, 1200, 1600, 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 == 8:
    free_color += 1
  else:
    A_class.append(cls)
print(A_class, free_color)
max_class = len(set(A_class)) + free_color
min_class = max(len(set(A_class)), 1)
print(min_class, max_class)

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 = len(set(A_class)) + free_color
min_class = max(len(set(A_class)), 1)
print(min_class, max_class)

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 = max(len(set(A_class)), 1)
print(min_class, max_class)