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())

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

colSum = sum(color)
if colSum == 0 and pro > 0:
    print(1,min(8,pro))
else:
    print(colSum, colSum + min(8 - colSum, pro))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

colSum = sum(color)
print(colSum, colSum+min(8-colSum, pro))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

colSum = sum(color)
print(colSum, colSum+min(8-colSum, pro))

Submission status: Wrong Answer

Solution code:
#coding; utf-8


def main():
    N = int(input())
    A = list(map(int, input().split()))
    min_color = 0
    max_color = 0
    rate_criteria = 400
    rate = [0]*9
    for i in range(N):
        diva = A[i]//rate_criteria
        if diva > 8:
            diva = 8
        rate[diva] += 1

    for i in range(8):
        if rate[i] > 0:
            min_color += 1

    max_color = min_color + rate[-1]
    # print(rate)
    print(min_color, max_color)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
s = input().split()
a = [0]*8
flex = 0
for i in range(N):
    if int(s[i]) >=3200 : 
        flex = flex+1
    elif int(s[i]) >= 2800:
        a[7] = a[7]+1
    elif int(s[i])>=2400:
        a[6] = a[6]+1
    elif int(s[i])>=2000:
        a[5] = a[5]+1
    elif int(s[i]) >= 1600:
        a[4] = a[4]+1
    elif int(s[i])>=1200:
        a[3] = a[3]+1
    elif int(s[i])>=800:
        a[2] = a[2]+1
    elif int(s[i])>=400:
        a[1] = a[1] + 1
    else:
        a[0] = a[0]+1

cnt = 0
for i in range(8):
    if a[i] > 0:
        cnt = cnt+1
#print(a)
if  cnt !=  0:
    print(str(cnt)+" "+str(cnt+flex))
else:
    print(str(0)+" "+str(flex))

Submission status: Wrong Answer

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

c=[0]*9
for i in range(N):
    c[min(8,a[i]//400)]+=1
cnt=0
for i in range(8):
    if c[i]>0:
        cnt+=1
if cnt==0:
    cnt=1
    c[8]-=1
minimum=cnt
maximum=min(8,cnt+c[8])
print(minimum,maximum)

Submission status: Wrong Answer

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

c=[0]*9
for i in range(N):
    c[min(8,a[i]//400)]+=1
cnt=0
for i in range(8):
    if c[i]>0:
        cnt+=1
if cnt==0:
    cnt=1
minimum=cnt
maximum=min(8,cnt+c[8])
print(minimum,maximum)

Submission status: Wrong Answer

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

c=[0]*9
for i in range(N):
    c[min(8,a[i]//400)]+=1
cnt=0
for i in range(8):
    if c[i]>0:
        cnt+=1
minimum=cnt
maximum=min(8,cnt+c[8])
print(minimum,maximum)

Submission status: Wrong Answer

Solution code:
N = int(input())
s = input().split()
a = [0]*8
flex = 0
for i in range(N):
    if int(s[i]) >=3200 : 
        flex = flex+1
    elif int(s[i]) >= 2800:
        a[7] = a[7]+1
    elif int(s[i])>=2400:
        a[6] = a[6]+1
    elif int(s[i])>=2000:
        a[5] = a[5]+1
    elif int(s[i]) >= 1600:
        a[4] = a[4]+1
    elif int(s[i])>=1200:
        a[3] = a[3]+1
    elif int(s[i])>=800:
        a[2] = a[2]+1
    elif int(s[i])>=400:
        a[1] = a[1] + 1
    else:
        a[0] = a[0]+1

cnt = 0
for i in range(8):
    if a[i] > 0:
        cnt = cnt+1
#print(a)
print(str(cnt)+" "+str(cnt+flex))

Submission status: Wrong Answer

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

N = int(input())
L = [int(v) // 400 for v in input().split()]

t = set()
c = 0
for v in L:
    if v >= 8:
        c += 1
    else:
        t.add(v)
        
cc = len(t)
if cc == 0:
    print(1, c)
elif c == 0:
    print(cc, cc)
else:
    tt = c + cc
    if tt >= 8:
        print(cc, 8)
    else:
        print(cc, tt)

Submission status: Wrong Answer

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

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

if sum(color_list) == 0:
    color_list[0] = 1
    magic -= 1
minimum = len(list(filter(lambda x:x > 0, color_list)))
diff = min(len(list(filter(lambda x:x == 0, color_list))), magic)

print(str(minimum) + " " + str(minimum+diff))

Submission status: Wrong Answer

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

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

minimum = len(list(filter(lambda x:x > 0, color_list)))
diff = min(len(list(filter(lambda x:x == 0, color_list))), magic)

print(str(minimum) + " " + str(minimum+diff))

Submission status: Wrong Answer

Solution code:
n=int(input())
rates=list(map(int,input().split()))
over3200=sum(1 for i in rates if i>=3200)
fixed=set()
for i in rates:
  if i//400<=7:
    fixed.add(i//400)
f=len(fixed)
print(fixed)
if f==0:
  print(1,over3200)
else:
  print(f,f+over3200)

Submission status: Wrong Answer

Solution code:
n=int(input())
rates=list(map(int,input().split()))
over3200=sum(1 for i in rates if i>=3200)
fixed=set()
for i in rates:
  if i//400<=7:
    fixed.add(i)
f=len(fixed)
if f==0:
  print(1,over3200)
else:
  print(f,f+over3200)

Submission status: Wrong Answer

Solution code:
N = int(input())
s = input().split()
a = [0]*8
flex = 0
for i in range(N):
    if int(s[i]) >=3200 : 
        flex = flex+1
    elif int(s[i]) >= 2800:
        a[7] = a[7]+1
    elif int(s[i])>=2400:
        a[6] = a[6]+1
    elif int(s[i])>=2000:
        a[5] = a[5]+1
    elif int(s[i]) >= 1600:
        a[4] = a[4]+1
    elif int(s[i])>=1200:
        a[3] = a[3]+1
    elif int(s[i])>=800:
        a[2] = a[2]+1
    elif int(s[i])>=400:
        a[1] = a[1] + 1
    else:
        a[0] = a[0]+1

cnt = 0
for i in range(8):
    if a[i] > 0:
        cnt = cnt+1
#print(a)
if cnt+flex < 8:
    print(str(cnt)+" "+str(cnt+flex))
else:
    print(str(cnt)+" "+str(8))

Submission status: Wrong Answer

Solution code:
n = int(input())
color = {}
wild = 0
a = [int(i) for i in input().split()]
for i in range(n):
  if a[i] < 400:
    color[0] = 1
  elif a[i] < 800:
    color[1] = 1
  elif a[i] < 1200:
    color[2] = 1
  elif a[i] < 1600:
    color[3] = 1
  elif a[i] < 2000:
    color[4] = 1
  elif a[i] < 2400:
    color[5] = 1
  elif a[i] < 2800:
    color[6] = 1
  elif a[i] < 3200:
    color[7] = 1
  else:
    wild += 1

print(len(color), len(color) + wild)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
aa=[0]*9
for i in range(n):
    x = a[i]//400
    if x<8:
        aa[x] = 1
    else:
        aa[8] += 1
suma = sum(aa[0:8])
if suma==0:
    mina = 1
else:
    mina = suma
maxa = min(suma+aa[8],8)
print(mina,maxa)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
aa=[0]*9
for i in range(n):
    x = a[i]//400
    print(x)
    if x<8:
        aa[x] = 1
    else:
        aa[8] += 1
suma = sum(aa[0:8])
if suma==0:
    mina = 1
else:
    mina = suma
maxa = min(suma+aa[8],8)
print(mina,maxa)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
aa=[0]*9
for i in range(n):
    x = a[i]//400 - 1
    if x<8:
        aa[x] = 1
    else:
        aa[8] += 1
suma = sum(aa[0:8])
if suma==0:
    mina = 1
else:
    mina = suma
maxa = min(suma+aa[8],8)
print(mina,maxa)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
aa=[0]*9
for i in range(n):
    x = a[i]//400 - 1
    if x<8:
        aa[x] = 1
    else:
        aa[8] += 1
print(aa)
suma = sum(aa[0:8])
if suma==0:
    mina = 1
else:
    mina = suma
maxa = min(suma+aa[8],8)
print(mina,maxa)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
aa=[0]*8
for i in range(n):
    x = a[i]//400 - 1
    if x<7:
        aa[x] = 1
    else:
        aa[7] += 1
suma = sum(aa[0:7])
if suma==0:
    mina = 1
else:
    mina = suma
maxa = min(suma+aa[7],8)
print(mina,maxa)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a7=[]
cnt8=0
for i in range(n):
    #0<=x<=7,8以上
    x = a[i]//400
    if x>=8:
        cnt8 += 1
    else:
        a7.append(x)
a7 = list(set(a7))
if len(a7)>=1:
    mina = len(a7)
else:
    mina = 1
maxa = min(8,len(a7)+cnt8)
print(mina,maxa)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a7=[]
cnt8=0
for i in range(n):
    #0<=x<=7,8以上
    x = a[i]//400
    if x>=8:
        cnt8 += 1
    else:
        a7.append(x)
a7 = list(set(a7))
mina = max(len(a7),min(cnt8,1))
maxa = min(len(a7)+cnt8,8)
print(mina,maxa)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
d = {}
for i in range(8):
    d[i] = []
for i in range(len(a)):
    if(a[i]<=399):
        d[0].append(a[i])
    elif(a[i]<=799):
        d[1].append(a[i])
    elif(a[i]<=1199):
        d[2].append(a[i])
    elif(a[i]<=1599):
        d[3].append(a[i])
    elif(a[i]<=1999):
        d[4].append(a[i])
    elif(a[i]<=2399):
        d[5].append(a[i])
    elif(a[i]<=2799):
        d[6].append(a[i])
    elif(a[i]<=3199):
        d[7].append(a[i])
mini = 0
maxi = 0
for key in d:
    if(d[key]!=[]):
        mini+=1
maxi = mini
if(mini==8):
    print(mini,maxi+1)
    exit()
for i in range(len(a)):
    if(a[i]>=3200):
        maxi+=1
print(mini,maxi)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
d = {}
for i in range(8):
    d[i] = []
for i in range(len(a)):
    if(a[i]<=399):
        d[0].append(a[i])
    elif(a[i]<=799):
        d[1].append(a[i])
    elif(a[i]<=1199):
        d[2].append(a[i])
    elif(a[i]<=1599):
        d[3].append(a[i])
    elif(a[i]<=1999):
        d[4].append(a[i])
    elif(a[i]<=2399):
        d[5].append(a[i])
    elif(a[i]<=2799):
        d[6].append(a[i])
    elif(a[i]<=3199):
        d[7].append(a[i])
mini = 0
maxi = 0
for key in d:
    if(d[key]!=[]):
        mini+=1
maxi = mini
if(mini==8):
    print(mini,maxi)
    exit()
for i in range(len(a)):
    if(a[i]>=3200):
        maxi+=1
print(mini,maxi)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
d = {}
for i in range(8):
    d[i] = []
for i in range(len(a)):
    if(a[i]<=399):
        d[0].append(a[i])
    elif(a[i]<=799):
        d[1].append(a[i])
    elif(a[i]<=1199):
        d[2].append(a[i])
    elif(a[i]<=1599):
        d[3].append(a[i])
    elif(a[i]<=1999):
        d[4].append(a[i])
    elif(a[i]<=2399):
        d[5].append(a[i])
    elif(a[i]<=2799):
        d[6].append(a[i])
    elif(a[i]<=3199):
        d[7].append(a[i])
mini = 0
maxi = 0
for key in d:
    if(d[key]!=[]):
        mini+=1
maxi = mini
for i in range(len(a)):
    if(a[i]>=3200):
        maxi+=1
print(mini,maxi)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

lst = [0] * 9

for i in range(N):
    lst[min(a[i]//400, 8)] += 1

count = lst[:8].count(0)

kind_max = min(8-count+lst[8], 8)
kind_min = max(8-count,1)

print (kind_min, kind_max)

Submission status: Wrong Answer

Solution code:
N = int(input())

c = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

i = 0
cnt = 0
ansOne = 0
ansAny = 0
for ai in sorted(map(int, input().split())):
  while i < len(c):
    if ai <= c[i]:
      cnt += 1
      break
    else:
      if cnt > 0:
        ansOne += 1
        cnt = 0
      i+=1
    
  else:
    ansAny += 1

if ansAny <= 0:
  ansOne += 1
print("{} {}".format(max(ansOne, 1), min(len(c), ansOne + ansAny)))

Submission status: Wrong Answer

Solution code:
N = int(input())


c = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

i = 0
cnt = 0
ansOne = 0
ansAny = 0
for ai in sorted(map(int, input().split())):
  while i < len(c):
    if ai <= c[i]:
      cnt += 1
      break
    if cnt > 0:
      ansOne += 1
      cnt = 0
    i+=1
    
  else:
    ansAny += 1

if ansAny <= 0:
  ansOne += 1
print("{} {}".format(max(ansOne, 1), min(len(c), ansOne + ansAny)))

Submission status: Wrong Answer

Solution code:
N = int(input())


c = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

i = 0
cnt = 0
ansOne = 0
ansAny = 0
for ai in sorted(map(int, input().split())):
  while i < len(c):
    if ai <= c[i]:
      cnt += 1
      break
    else:
      if cnt > 0:
        ansOne += 1
        cnt = 0
      i+=1
    
  else:
    ansAny += 1

if ansAny <= 0:
  ansOne += 1
print("{} {}".format(max(ansOne, 1), min(len(c), ansOne + ansAny)))

Submission status: Wrong Answer

Solution code:
N = int(input())


c = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

i = 0
cnt = 0
ansOne = 0
ansAny = 0
for ai in sorted(map(int, input().split())):
  while i < len(c):
    if ai <= c[i]:
      cnt += 1
      break
    elif cnt > 0:
      ansOne += 1
      cnt = 0
    i+=1
    
  else:
    ansAny += 1

if ansAny <= 0:
  ansOne += 1
print("{} {}".format(max(ansOne, 1), min(len(c), ansOne + ansAny)))

Submission status: Wrong Answer

Solution code:
N = int(input())

c = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

i = 0
cnt = 0
ansOne = 0
ansAny = 0
for ai in sorted(map(int, input().split())):
  while i < len(c):
    if ai <= c[i]:
      cnt += 1
      break
    elif cnt > 0:
      ansOne += 1
      cnt = 0
    i+=1
    
  else:
    ansAny += 1

print("{} {}".format(max(ansOne, 1), min(len(c), ansOne + ansAny)))

Submission status: Wrong Answer

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

rank = [0 for i in range(9)]

for a in A:
	res = min(a//400,8)
	rank[res] += 1

ans = 0
for r in rank[:-1]:
	if r == 0:
		continue
	ans+=1

min_ans = 0
max_ans = 0
if rank[-1] == 0:
	min_ans,max_ans = min(ans,8),min(ans,8)
else:
	if ans == 0:
		min_ans = 1
		max_ans = min(rank[-1],8)
	else:
		min_ans = min(ans,8)
		max_ans = min(ans+rank[-1],8)
print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
n = int( input() );
a = input().split(" ");
flag = [0]*8;
count_pro = 0;
for i in range(n) :
	if int(a[i]) < 3200 :
		flag[int(int(a[i])/400)] = 1;
	else :
		count_pro = count_pro + 1;
mi = 0;
mx = 0;
if sum(flag) == 0 :
	mi = 1;
else :
	mi = sum(flag);

if count_pro > 8 - sum(flag) :
	mx = 8;
else :
	mx = sum(flag)+count_pro;

print(mi,mx)

Submission status: Wrong Answer

Solution code:
n = int( input() );
a = input().split(" ");
flag = [0]*8;
count_pro = 0;
for i in range(n) :
	if int(a[i]) < 3200 :
		flag[int(int(a[i])/400)] = 1;
	else :
		count_pro = count_pro + 1;
if count_pro > 8 - sum(flag) :
	if sum(flag) == 0 :
		print(1,8);
	else :
		print(sum(flag),8);
elif count_pro <= 8 - sum(flag) and count_pro > 0 :
	if sum(flag) == 0 :
		print(1,sum(flag)+count_pro);
	else :
		print(sum(flag),sum(flag)+count_pro);
else :
	print(sum(flag),sum(flag));

Submission status: Wrong Answer

Solution code:
n = int( input() );
a = input().split(" ");
flag = [0]*8;
count_pro = 0;
for i in range(n) :
	if int(a[i]) < 3200 :
		flag[int(int(a[i])/400)] = 1;
	else :
		count_pro = count_pro + 1;
if count_pro > 8 - sum(flag) :
	print(sum(flag),8);
elif count_pro <= 8 - sum(flag) and count_pro > 0 :
	print(sum(flag),sum(flag)+count_pro);
else :
	print(sum(flag),sum(flag));

Submission status: Wrong Answer

Solution code:
n = int( input() );
a = input().split(" ");
flag = [0]*8;
count_pro = 0;
for i in range(n) :
	if int(a[i]) < 3200 :
		flag[int(int(a[i])/400)] = 1;
	else :
		count_pro = count_pro + 1;
if count_pro > 8 - sum(flag) :
	print(sum(flag),8);
elif count_pro < 8 - sum(flag) and count_pro > 0 :
	print(sum(flag),sum(flag)+count_pro);
else :
	print(sum(flag),sum(flag));

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
s=set()
pro=0
for x in l:
	div=x//400
	if div<8:s.add(div)
	else:pro+=1
print(len(s) if pro!=n else 1,len(s)+min(8-len(s),pro))

Submission status: Wrong Answer

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

color = [0] * 8
ext = 0
for i in range(N):
    for j in range(1,9):
        if a[i] < (j*400):
            color[j-1] += 1
            break
    else:
        ext += 1 
        
        
cnt = 0
for i in color:
    if i > 0:
        cnt += 1
        
minim = max(0,cnt+1 * int(ext>0 and cnt == 0))
maxim = min(8,cnt+ext)

print(minim,maxim)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
s=set()
pro=0
for x in l:
	div=x//400
	if div<8:s.add(div)
	else:pro+=1
print(len(s),len(s)+min(8-len(s),pro))

Submission status: Wrong Answer

Solution code:
N = int(input())
*A, = map(int, input().split())
colors = [False]*8
changeable = 0
for a in A:
    q, _ = divmod(a, 400)
    if q < 8:
        colors[q] = True
    else:
        changeable += 1
print(sum(colors), sum(colors) + changeable)

Submission status: Wrong Answer

Solution code:
N = int(input())
*A, = map(int, input().split())
colors = [False]*8
changeable = 0
for a in A:
    q, _ = divmod(a, 400)
    if q < 8:
        colors[q] = True
    else:
        changeable += 1
print(sum(colors), min(sum(colors) + changeable, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = [False for _ in range(8)]
flex = 0
for x in a:
    if x >= 3200:
        flex += 1
    else:
        flag[int(x/400)] = True
les = flag.count(True)
if les < flex:
    les = flex
print("{} {}".format(les, les+flex))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = [False for _ in range(8)]
flex = 0
for x in a:
    if x >= 3200:
        flex += 1
    else:
        flag[int(x/400)] = True
les = flag.count(True)
print("{} {}".format(les, les+flex))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = [False for _ in range(8)]
flex = 0
for x in a:
    if x >= 3200:
        flex += 1
    else:
        flag[int(x/400)] = True
les = flag.count(True)
print("{} {}".format(les, min([8,les+flex])))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

colors = [0] * 8
over = 0

for score in scores:
    if score < 3200:
        colors[score // 400] += 1
    else:
        over += 1

ans = sum(color > 0 for color in colors)

print(ans, ans + over)

Submission status: Wrong Answer

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

color = [i//400 for i in para]
ans = []
cnt = 0
cnt_g = 0
for i in range(N):
    if color[i] >= 8 :
        cnt_g += 1
    else : 
        if  color[i] in ans : pass
        else: ans.append(color[i])
        
max_val = 0
if cnt_g >= 8 - len(ans) : max_val = 8
else : max_val = len(ans) + cnt_g
min_val = 0
if len(ans) >= 1 : min_val = len(ans)
else : min_val = 1
print("{} {}".format(min_val,max_val))

Submission status: Wrong Answer

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

"""
min : 3200以上の人間が既出の色にする
max : 3200以上の人間が出来るだけ出ていない色にすru
"""
color = [i//400 for i in para]
ans = []
cnt = 0
cnt_g = 0
for i in range(N):
    if color[i] >= 8 :
        cnt_g += 1
    else : 
        if not color[i] in ans : ans.append(color[i])
        
max_val = 0
if cnt_g >= 8 - len(ans) : max_val = 8
else : max_val = len(ans) + cnt_g
min_val = 0
if len(ans) >= 1 : min_val = len(ans)
else : min_val = 1
print("{} {}".format(min_val,max_val))

Submission status: Wrong Answer

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

"""
min : 3200以上の人間が既出の色にする
max : 3200以上の人間が出来るだけ出ていない色にすru
"""
color = [i//400 for i in para]
ans = []
cnt = 0
cnt_g = 0
for i in range(N):
    if color[i] >= 8 :
        cnt_g += 1
    else : 
        if not color[i] in ans : ans.append(color[i])
        
        cnt += 1
max_val = 0
if cnt_g >= 8 - len(ans) : max_val = 8
else : max_val = len(ans) + cnt_g

print("{} {}".format(len(ans),max_val))

Submission status: Wrong Answer

Solution code:
import bisect

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

A.sort()

rank = [0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3200, 3200, 3200, 3200, 3200]
n_rank = []
for i in range(1,len(rank)):
  var = bisect.bisect_left(A, rank[i]) - bisect.bisect_left(A, rank[i-1])
  n_rank.append(var)
else:
  n_rank.append(len(A) - bisect.bisect_left(A, rank[-1]))
  
n_color = sum(n_rank[i] != 0 for i in range(len(n_rank)-1))

min_color = max(n_color, 1)
max_color = min(n_color + n_rank[-1], 8)

print(str(min_color) +' '+ str(max_color))

Submission status: Wrong Answer

Solution code:
import bisect

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

A.sort()

rank = [0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
n_rank = []
for i in range(1,len(rank)):
  var = bisect.bisect_left(A, rank[i]) - bisect.bisect_left(A, rank[i-1])
  n_rank.append(var)
else:
  n_rank.append(len(A) - bisect.bisect_left(A, rank[-1]))
  
n_color = sum(n_rank[i] != 0 for i in range(len(n_rank)-1))

min_color = max(n_color, 1)
max_color = min(n_color + n_rank[-1], 8)

print(str(min_color) +' '+ str(max_color))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
rate=[400,800,1200,1600,2000,2400,2800,3200]
a.sort()
answer=0
counter=0
i=0
j=0
while i<N:
    if a[i]>=rate[j]:
        j+=1
    else:
        answer+=1
        while i<N and a[i]<rate[j]:
            i+=1
        j+=1
    if i<N and j==8:
        counter+=N-i
        break
print(answer,answer+counter)

Submission status: Wrong Answer

Solution code:
def smaller(x, y):
	if x < y: return x
	return y
N = int(input())
A = list(map(int, input().split()))
colorlist = [[1, 399]]
for i in range(1, 8):
	colorlist.append([400*i, 400*(i+1)-1])
ratelist = [False, False, False, False, False, False, False, False]
overcount = 0
for i in range(0, N):
	for j in range(0, 8):
		if colorlist[j][0] <= A[i] and A[i] <= colorlist[j][1]:
			ratelist[j] = True
			break
		if j == 7: overcount += 1
min = 0
for i in range(0, 8):
	if ratelist[i]: min += 1
if min == 0:
	min = 1
	overcount -= 1
max = smaller(min+overcount, 8)
print(str(min)+' '+str(max))

Submission status: Wrong Answer

Solution code:
def smaller(x, y):
	if x < y: return x
	return y
N = int(input())
A = list(map(int, input().split()))
colorlist = [[1, 399]]
for i in range(1, 8):
	colorlist.append([400*i, 400*(i+1)-1])
print(colorlist) #test
ratelist = [False, False, False, False, False, False, False, False]
overcount = 0
for i in range(0, N):
	for j in range(0, 8):
		if colorlist[j][0] <= A[i] and A[i] <= colorlist[j][1]:
			ratelist[j] = True
			break
		if j == 7: overcount += 1
min = 0
for i in range(0, 8):
	if ratelist[i]: min += 1
if min == 0:
	min = 1
	overcount -= 1
max = smaller(min+overcount, 8)
print(str(min)+' '+str(max))

Submission status: Wrong Answer

Solution code:
def smaller(x, y):
	if x < y: return x
	return y
N = int(input())
A = list(map(int, input().split()))
colorlist = [[1, 399]]
for i in range(1, 8):
	colorlist.append([400*i, 400*(i+1)-1])
ratelist = [False, False, False, False, False, False, False, False]
overcount = 0
for i in range(0, N):
	for j in range(0, 8):
		if colorlist[j][0] <= A[i] and A[i] <= colorlist[j][1]:
			ratelist[j] = True
			break
		if j == 7: overcount += 1
min = 0
for i in range(0, 8):
	if ratelist[i]: min += 1
max = smaller(min+overcount, 8)
print(str(min)+' '+str(max))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
D = {
    'gray': 0,
    'brown': 0,
    'green': 0,
    'lightblue': 0,
    'blue': 0,
    'yellow': 0,
    'orange': 0,
    'red': 0,
}
ultimate = 0

for a in A:
    if a < 400:
        D['gray'] += 1
    elif a < 800:
        D['brown'] += 1
    elif a < 1200:
        D['green'] += 1
    elif a < 1600:
        D['lightblue'] += 1
    elif a < 2000:
        D['blue'] += 1
    elif a < 2400:
        D['yellow'] += 1
    elif a < 2800:
        D['orange'] += 1
    elif a < 3200:
        D['red'] += 1
    else:
        ultimate += 1

smallest = sum(map(bool, D.values()))
biggest = smallest + ultimate
print(smallest, biggest)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
D = {
    'gray': 0,
    'brown': 0,
    'green': 0,
    'lightblue': 0,
    'blue': 0,
    'yellow': 0,
    'orange': 0,
    'red': 0
}

for a in A:
    if a < 400:
        D['gray'] += 1
    elif a < 800:
        D['brown'] += 1
    elif a < 1200:
        D['green'] += 1
    elif a < 1600:
        D['lightblue'] += 1
    elif a < 2000:
        D['blue'] += 1
    elif a < 2400:
        D['yellow'] += 1
    elif a < 2800:
        D['orange'] += 1
    else:
        D['red'] += 1

smallest = sum([v > 0 for v in D.values()])
biggest = 0
if D['red'] > 0:
    biggest = smallest - 1
    biggest += D['red']
else:
    biggest = smallest
print(smallest, biggest)

Submission status: Wrong Answer

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

n = int(input())
a = list(map(int, input().split()))
cnt = 0
rate_cnt = [0]*8
for i in range(n):
    if a[i] >= 3200:
        cnt += 1
    elif a[i] >= 2800:
        rate_cnt[7] += 1
    elif a[i] >= 2400:
        rate_cnt[6] += 1
    elif a[i] >= 2000:
        rate_cnt[5] += 1
    elif a[i] >= 1600:
        rate_cnt[4] += 1
    elif a[i] >= 1200:
        rate_cnt[3] += 1
    elif a[i] >= 800:
        rate_cnt[2] += 1
    elif a[i] >= 400:
        rate_cnt[1] += 1
    else:
        rate_cnt[0] += 1
for j in range(8):
    if 0 in rate_cnt:
        rate_cnt.remove(0)
    else:
        break
if len(rate_cnt)+cnt >= 8:
    max_ans = 8
else:
    max_ans = len(rate_cnt)+cnt
if len(rate_cnt) == 0:
    min_ans = 1
else:
    min_ans = len(rate_cnt)
print(min_ans, max_ans)

Submission status: Wrong Answer

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

n = int(input())
a = list(map(int, input().split()))
cnt = 0
rate_cnt = [0]*8
for i in range(n):
    if a[i] >= 3200:
        cnt += 1
    elif a[i] >= 2800:
        rate_cnt[7] += 1
    elif a[i] >= 2400:
        rate_cnt[6] += 1
    elif a[i] >= 2000:
        rate_cnt[5] += 1
    elif a[i] >= 1600:
        rate_cnt[4] += 1
    elif a[i] >= 1200:
        rate_cnt[3] += 1
    elif a[i] >= 800:
        rate_cnt[2] += 1
    elif a[i] >= 400:
        rate_cnt[1] += 1
    else:
        rate_cnt[0] += 1
for j in range(8):
    if 0 in rate_cnt:
        rate_cnt.remove(0)
    else:
        break
if len(rate_cnt)+cnt > 8:
    max_ans = 8
else:
    max_ans = len(rate_cnt)+cnt
print(len(rate_cnt), max_ans)

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

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

def main():
  n=I()
  l=LI()

  l2=[]
  c=0
  for x in l:
    if x>=3200:
      c+=1
      l2.append(8)
    else:
      l2.append(x//400)

  l2=list(set(l2))

  if len(l2)!=1 and l2.count(8):
    l2.remove(8)

  if len(l2)==1:
    c=max(0,c-1)

  print(len(l2),len(l2)+c)

main()

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

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

def main():
  n=I()
  l=LI()

  l2=[]
  c=0
  for x in l:
    if x>=3200:
      c+=1
      l2.append(8)
    else:
      l2.append(x//400)

  l2=list(set(l2))

  if len(l2)!=1 and l2.count(8):
    l2.remove(8)

  if len(l2)==1:
    c-=1

  print(len(l2),len(l2)+c)

main()