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()))
cnt = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        cnt[a[i]//400] += 1
    else:
        free += 1
print(cnt)
print(8-cnt.count(0),min(8,8-cnt.count(0)+free))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

colors = [0] * 8
over = 0

for i in arr:
    if i >= 3200:
        over += 1
    else:
        colors[i // 400] += 1

res = 8 - colors.count(0)
if res:
    print(res, min(res+over, 8))
else:
    print(1, over)

Submission status: Wrong Answer

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

colors = [0] * 8
over = 0

for i in arr:
    if i >= 3200:
        over += 1
    else:
        colors[i // 400] += 1

res = 8 - colors.count(0)
print(res, min(res+over, 8))

Submission status: Wrong Answer

Solution code:
import collections as c
input();a=c.Counter(i//400 for i in list(map(int,input().split())))
b,c=len(set([i for i,j in a.items() if i<8])),sum([j for i,j in a.items()if i>=8])
print(b,b+c)

Submission status: Wrong Answer

Solution code:
import collections as c
input();a=c.Counter(i//400 for i in list(map(int,input().split())))
b,c=len(set([i for i,j in a.items() if i<8])),sum([j for i,j in a.items()if i>=8])
print([b,8][b==8 or b+c>=8],[b+c,8][b==8 or b+c>=8])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
count=0
ans=1
color_lis=[0,0,0,0,0,0,0,0]
for i in range(n):
  if a[i]//400>=8:
    count+=1
  else:
    color_lis[a[i]//400]=1
ans=sum(color_lis)
if count>0:
  flag=1
else:
  flag=0
ans1 = max(flag,ans)
ans2 = min(9,ans+count)
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
count=0
ans=1
color_lis=[0,0,0,0,0,0,0,0]
for i in range(n):
  if a[i]//400>=8:
    count+=1
  else:
    color_lis[a[i]//400]=1
ans=sum(color_lis)
if count>0:
  flag=1
else:
  flag=0
ans1 = max(flag,ans)
ans2 = min(8,ans+count)
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    a = LI()
    lst = [False]*8
    god = 0
    for i in a:
        rank = i//400
        if rank<=7:
            lst[rank] = True
        else:
            god += 1
    
    ans = lst.count(True)
    print(ans,ans + god)

main()

Submission status: Wrong Answer

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

c = [0] * 9
for num in a:
    if num < 400:
        c[0] += 1
    elif num < 800:
        c[1] += 1
    elif num < 1200:
        c[2] += 1
    elif num < 1600:
        c[3] += 1
    elif num < 2000:
        c[4] += 1
    elif num < 2400:
        c[5] += 1
    elif num < 2800:
        c[6] += 1
    elif num < 3200:
        c[7] += 1
    else:
        c[8] += 1
mi = 0
ma = 0
for i in range(8):
    if c[i] >= 1:
        mi += 1
        ma += 1
ma += c[8]
print(str(mi) + " " + str(ma))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


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


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


N = z()
A = zz()
lis = list(range(-1, 3200, 400))
ok = 0
set_ = []
for i in range(N):
    if (A[i] >= 3200):
        ok += 1
    else:
        idx = bisect.bisect_left(lis, A[i])
        set_.append(idx)
set_ = set(set_)
min_ = len(set_)
max_ = len(set_) + ok

print(min_, max_)

Submission status: Wrong Answer

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

border = 3200 // 400
arr = [0] * 8
over = 0
for a in aa:
    x = a // 400

    if x >= border:
        over += 1
        continue

    arr[x] = 1

s = sum(arr)
print(s, s + over)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
c = [0] * 9
for i in A:
    if i < 3200:
        c[i//400]+=1
    else:
        c[8]+=1
cnt = 0
for i in range(8):
    if c[i] != 0:
        cnt += 1
mini = max(1,cnt)
maxi = min(8,cnt+c[8])
print(mini,maxi)

Submission status: Wrong Answer

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

color = [0]*8
freer=0

for i in a:
    if i<3200:
        color[i//400]+=1
    else:
        freer+=1
        
ans_base = 8-color.count(0)

if ans_base==0:
    ans_min = 1
else:
    ans_min = ans_base
    
ans_max = min(8,ans_base+freer)
        
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
ans=[0 for i in range(9)]

for i in range(N):
    temp=a[i]//400
    if temp>8:
        ans[8]+=1
    else:
        ans[temp]+=1
nin=0
for i in range(8):
    if ans[i]!=0:
        nin+=1
if nin==0 and ans[8]!=0:
    nin+=1

nax=nin+ans[8]

print(nin,nax)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
ans=[0 for i in range(9)]

for i in range(N):
    temp=a[i]//400
    if temp>8:
        ans[8]+=1
    else:
        ans[temp]+=1
nin=0
for i in range(8):
    if ans[i]!=0:
        nin+=1
if nin==0 and ans[8]!=0:
    nin+=1

nax=nin+ans[8]
nax=min(8,nax)
print(nin,nax)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

b=[0 for _ in range(8)]
for r in a:
  t=r//400
  if t>=8:
    ch+=1
  else:
    b[t]+=1
    
c=8-b.count(0)
print(str(max(1,c))+' '+str(min(8,c+ch)))

Submission status: Wrong Answer

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

b=[0 for _ in range(8)]
for r in a:
  t=r//400
  if t>=8:
    ch+=1
  else:
    b[t]+=1
    
c=8-b.count(0)
print(str(c)+' '+str(min(8,c+ch)))

Submission status: Wrong Answer

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

color=[]
free=0
count=0
Sans,Mans=0,0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        
#Mans=Sans
if free+Sans>=8:
    Mans=8
else:
    Mans=Sans+free
    
if Sans==0:
    Sans=1
print(Sans,Mans)

Submission status: Wrong Answer

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

color=[]
free=0
count=0
Sans,Mans=0,0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        
#Mans=Sans
if free+Sans>8:
    Mans=8
else:
    Mans=Sans+free
    
if Sans==0:
    Sans=1
print(Sans,Mans)

Submission status: Wrong Answer

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

color=[]
free=0
count=0
Sans,Mans=0,0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        
#Mans=Sans
if free+Sans>8:
    Mans=8
else:
    Mans=Sans+free
    
print(Sans,Mans)

Submission status: Wrong Answer

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

color=[]
free=0
count=0
Sans,Mans=0,0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        
#Mans=Sans
if free+count>8:
    Mans=8
else:
    Mans=Sans+free
    
print(Sans,Mans)

Submission status: Wrong Answer

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

color=[-1]*n
free=0
count=0
for i in range(len(a)):
    if a[i]<3200:
        #print(a[i])
        for j in range(8):
            if 400*j<=a[i] and 400*(j+1)>a[i] and j not in color:
                color[i]=j
                break
            else:
                color[i]=0
                
    
    else:
        free+=1
        
for i in color:
    if i>0 :
        count+=1

#print(count,free)
#print(color)
Sans,Mans=0,0
if count+free>8:
    Mans=8
else:
    Mans=count+free
    
if count==0:
    Sans=1
else:
    Sans=count
    
print(Sans,Mans)

Submission status: Wrong Answer

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

color=[-1]*n
free=0
count=0
for i in range(len(a)):
    if a[i]<3200:
        #print(a[i])
        for j in range(8):
            if 400*j<=a[i] and 400*(j+1)>a[i] and j not in color:
                color[i]=j
                break
            else:
                color[i]=0
                
    
    else:
        free+=1
        
for i in color:
    if i>0 :
        count+=1

#print(count,free)
#print(color)
Sans,Mans=0,0
if count+free>8:
    Mans=8
else:
    Mans=count+free
    
if count==8:
    Sans=8
elif count==0:
    Sans=1
else:
    Sans=count
    
print(Sans,Mans)

Submission status: Wrong Answer

Solution code:

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

color=[-1]*n
free=0
count=0
for i in range(len(a)):
    if a[i]<3200:
        #print(a[i])
        for j in range(8):
            if 400*j<=a[i] and 400*(j+1)>a[i] and j not in color:
                color[i]=j
                break
            else:
                color[i]=0
                
    
    else:
        free+=1
        
for i in color:
    if i>0 :
        count+=1

#print(count,free)
#print(color)
Sans,Mans=0,0
if count+free>8:
    Mans=7
else:
    Mans=count+free
    
if count==8:
    Sans=8
elif free!=0:
    Sans=count
else:
    Sans=count
    
print(Sans,Mans)

Submission status: Wrong Answer

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

mini = 0
color_list = []
for i in a:
    if (i//400)<8 and ((i//400 in color_list) == False):
        mini += 1
        color_list.append(i//400)

maxi = mini
for j in a:
    if maxi == 8:
        break
    if j >= 3200:
        maxi += 1
if mini == 0:#忘れてた
    mini = 1
print(mini,maxi)

Submission status: Wrong Answer

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

mini = 0
color_list = []
for i in a:
    if (i//400)<8 and ((i//400 in color_list) == False):
        mini += 1
        color_list.append(i//400)
print(color_list)
print(mini)
maxi = mini
for j in a:
    if maxi == 8:
        break
    if j >= 3200:
        maxi += 1
if mini == 0:#忘れてた
    mini = 1
print(mini,maxi)

Submission status: Wrong Answer

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

mini = 0
rate_list = []
for i in a:
    if i//400<8 and ((i//400 in rate_list) == False) :
        mini += 1
        rate_list.append(i//400)
        
maxi = mini
for j in a:
    if maxi == 8:
        break
    if j >= 3200:
        maxi += 1
if mini == 0:#忘れてた
    mini += 1
print(mini,maxi)

Submission status: Wrong Answer

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

mini = 0
rate_list = []
for i in a:
    if i//400<8 and ((i//400 in rate_list) == False) :
        mini += 1
        rate_list.append(i//400)
        
maxi = mini
for j in a:
    if maxi == 8:
        break
    if j >= 3200:
        maxi += 1
if rate_list == []:#忘れてた
    mini += 1
print(mini,maxi)

Submission status: Wrong Answer

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

mini = 0
rate_list = []
for i in a:
    if i//400<8 and ((i//400 in rate_list) == False) :
        mini += 1
        rate_list.append(i//400)
if len(rate_list) == 0:#忘れてた
    mini = 1
maxi = mini
for j in a:
    if maxi == 8:
        break
    if j >= 3200:
        maxi += 1
print(mini,maxi)

Submission status: Wrong Answer

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


mini = 0
rate_list = []
for i in a:
    if i//400<8 and ((i//400 in rate_list) == False) :
        mini += 1
        rate_list.append(i//400)
maxi = mini
for j in a:
    if maxi == 8:
        break
    if j >= 3200:
        maxi += 1
print(mini,maxi)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
L=[i//400 for i in L]
a=[i for i in L if i<8]
b=[i for i in L if i>7]
a=len(set(a))
b=len(b)
if a==0:
  mi=1
  ma=b
else:
  mi=a
  ma=min(8,mi+b)
print(mi,ma)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
L=[i//400 for i in L]
s=0
k=0
for i in L:
  if i>7:
    k+=1
L=list(set(L))
for i in L:
  if i<8:
    s+=1
print(max(1,s),min(k+s,8))

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
L=[i//400 for i in L]
s=0
k=0
for i in L:
  if i>7:
    k+=1
L=list(set(L))
for i in L:
  if i<8:
    s+=1
print(s,min(k+s,8))

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(9)]
for a in A:
    if a > 8:
        a = 8
    C[a] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0

if C[-1] == 0:
    ans_min = cnt_n0
    ans_max = cnt_n0
else:
    ans_min = cnt_n0 - 1
    ans_max = cnt_n0 - 1 + C[-1]


print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0

if C[-1] == 0:
    ans_min = cnt_n0
    ans_max = cnt_n0
else:
    ans_min = cnt_n0 - 1
    ans_max = cnt_n0 - 1 + C[-1]


print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0

if C[-1] == 0:
    ans_max = cnt_n0
else:
    ans_max = cnt_n0 - 1 + C[-1]


print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C[:-1]:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0 if cnt_0 != 0 else 1
ans_max = cnt_n0 + C[-1]
print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C[:-1]:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0 if cnt_0 != 0 else 1
ans_max = cnt_n0 + min(cnt_0, C[-1])
print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C[:-1]:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0 if cnt_0 == 0 else 1
ans_max = cnt_n0 + min(cnt_0, C[-1])
print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
print(C)
for c in C[:-1]:
    print(c)
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0 if cnt_0 == 0 else 1
ans_max = cnt_n0 + min(cnt_0, C[-1])
print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
print(C)
for c in C[:-1]:
    print(c)
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0 if cnt_n0 != 0 else 1
ans_max = cnt_n0 + min(cnt_0, C[-1])
print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
print(C)
for c in C[:-1]:
    print(c)
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = max(cnt_n0, 1)
ans_max = cnt_n0 + min(cnt_0, C[-1])
print(ans_min, ans_max)

Submission status: Wrong Answer

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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C[:-1]:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = cnt_n0
ans_max = cnt_n0 + min(cnt_0, C[-1])
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: min(x // 400, 8), a))
#print(a)
m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1
#M = min(M, 8)
print(m, M)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: min(x // 400, 8), a))
#print(a)
m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1
M = min(M, 8)
print(m, M)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: max(x // 400, 8), a))
#print(a)
m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1
M = min(M, 8)
print(m, M)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a =  list(map(lambda x: x // 400, a))
#print(a)
m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1
M = min(M, 8)
print(m, M)

Submission status: Wrong Answer

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

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

M = 8-R[:-1].count(0)+R[-1]
m = 8-R[:-1].count(0)

print(m,M)

Submission status: Wrong Answer

Solution code:
is_alive = [0]*8#各ランク

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

count_over=0

for i in range(0,N,1):
    if a[i]>=3200:
        count_over +=1
    else:
        is_alive[a[i]//400]=1

print(max(1,sum(is_alive)),min(sum(is_alive)+count_over,8))

Submission status: Wrong Answer

Solution code:
is_alive = [0]*8#各ランク

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

count_over=0

for i in range(0,N,1):
    if a[i]>=3200:
        count_over +=1
    else:
        is_alive[a[i]//400]=1

print(max(0,sum(is_alive)),min(sum(is_alive)+count_over,8))

Submission status: Wrong Answer

Solution code:
is_alive = [0]*8#各ランク

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

count_over=0

for i in range(0,N,1):
    if a[i]>=3200:
        count_over +=1
    else:
        is_alive[a[i]//400]=1

print(sum(is_alive),min(sum(is_alive)+count_over,8))

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
p = [0] * 9

A = [int(a) for a in input().split(" ")]
A.sort()

j = 0
for i in range(len(A)):
  while j < 8:
    if rate[j] <= A[i] < rate[j + 1]:
      p[j] = 1
      break
    else:
      j += 1
  if j == 8:
    p[8] = len(A[i:])
    break

print(str(sum(p[:8])) + " " + str(sum(p)))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = [False] * 8
o = 0
for i in range(N):
    for j in range(8):
        if a[i] >= 400*j and a[i] < 400*(j+1):
            c[j] = True
    if a[i] >= 3200:
        o += 1
if c.count(True) > 0:
    print(c.count(True), min(c.count(True)+o,8))
else:
    print(1, min(c.count(True)+o,8))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc) + (1 if extra else 0), min(10000, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc) + (1 if extra else 0), min(9, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc), min(64, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc), min(16, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc), min(256, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc), len(cc) + extra
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc), min(8, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):

	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1


	print len(cc), min(8, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):

	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
	else:
		extra +=1

	print len(cc), min(8, len(cc) + extra)
	#print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
import collections
def f(n,ais):

	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
	else:
		extra +=1
	print min(cc.values() or [0]), max(cc.values() or [0]) + extra
f(int(raw_input()), map(int, raw_input().split()))

Submission status: Wrong Answer

Solution code:
n = int(input())
rates = list(map(int,input().split()))
coler = []
for i in range(n):
    if  0<= rates[i] <=399 :
        coler.append("1")
    elif 400 <= rates[i] <= 799:
        coler.append("2")
    elif  800<= rates[i] <=1199 :
        coler.append("3")
    elif  1200<= rates[i] <=1599 :
        coler.append("4")
    elif  1600<= rates[i] <=1999 :
        coler.append("5")
    elif  2000<= rates[i] <=2399 :
        coler.append("6")
    elif  2400<= rates[i] <=2799 :
        coler.append("7")
    elif  2800<= rates[i] <=3199 :
        coler.append("8")    
    else:
        coler.append("all")
jud = set(coler)
if "all" not in jud:
    print(len(jud),len(jud))
else:
    if len(jud) == 9:
        print(8,8)
    else:
        print(max(1,len(jud)-1),min(8,(coler.count("all")) + len(jud) -1))

Submission status: Wrong Answer

Solution code:
n = int(input())
rates = list(map(int,input().split()))
coler = []
for i in range(n):
    if  0<= rates[i] <=399 :
        coler.append("1")
    elif 400 <= rates[i] <= 799:
        coler.append("2")
    elif  800<= rates[i] <=1199 :
        coler.append("3")
    elif  1200<= rates[i] <=1599 :
        coler.append("4")
    elif  1600<= rates[i] <=1999 :
        coler.append("5")
    elif  2000<= rates[i] <=2399 :
        coler.append("6")
    elif  2400<= rates[i] <=2799 :
        coler.append("7")
    elif  2800<= rates[i] <=3199 :
        coler.append("8")    
    else:
        coler.append("all")
jud = set(coler)
if "all" not in jud:
    print(len(jud),len(jud))
else:
    if len(jud) == 9:
        print(8,8)
    else:
        if coler.count("all") + len(jud) -1 >= 8:
            print(max(1,len(jud)-1),8)
        else:
            print(max(1,len(jud)-1),max(8,(coler.count("all")) + len(jud) -1))

Submission status: Wrong Answer

Solution code:
n = int(input())
rates = list(map(int,input().split()))
coler = []
for i in range(n):
    if  0<= rates[i] <=399 :
        coler.append("1")
    elif 400 <= rates[i] <= 799:
        coler.append("2")
    elif  800<= rates[i] <=1199 :
        coler.append("3")
    elif  1200<= rates[i] <=1599 :
        coler.append("4")
    elif  1600<= rates[i] <=1999 :
        coler.append("5")
    elif  2000<= rates[i] <=2399 :
        coler.append("6")
    elif  2400<= rates[i] <=2799 :
        coler.append("7")
    elif  2800<= rates[i] <=3199 :
        coler.append("8")    
    else:
        coler.append("all")
jud = set(coler)
if "all" not in jud:
    print(len(jud),len(jud))
else:
    if len(jud) == 9:
        print(8,8)
    else:
        print(max(1,len(jud)-1),min(8,(coler.count("all")) + len(jud) -1 ))

Submission status: Wrong Answer

Solution code:
n = int(input())
rates = list(map(int,input().split()))
coler = []
for i in range(n):
    if  0<= rates[i] <=399 :
        coler.append("1")
    elif 400 <= rates[i] <= 799:
        coler.append("2")
    elif  800<= rates[i] <=1199 :
        coler.append("3")
    elif  1200<= rates[i] <=1599 :
        coler.append("4")
    elif  1600<= rates[i] <=1999 :
        coler.append("5")
    elif  2000<= rates[i] <=2399 :
        coler.append("6")
    elif  2400<= rates[i] <=2799 :
        coler.append("7")
    elif  2800<= rates[i] <=3199 :
        coler.append("8")    
    else:
        coler.append("all")
jud = set(coler)
if "all" not in jud:
    print(len(jud),len(jud))
else:
    if len(jud) == 9:
        print(8,8)
    else:
        if coler.count("all") + len(jud) -1 >= 8:
            print(len(jud)-1,8)
        else:
            print(len(jud)-1,(coler.count("all")) + len(jud) -1 )

Submission status: Wrong Answer

Solution code:
n = int(input())
rates = list(map(int,input().split()))
coler = []
for i in range(n):
    if  0<= rates[i] <=399 :
        coler.append("1")
    elif 400 <= rates[i] <= 799:
        coler.append("2")
    elif  800<= rates[i] <=1199 :
        coler.append("3")
    elif  1200<= rates[i] <=1599 :
        coler.append("4")
    elif  1600<= rates[i] <=1999 :
        coler.append("5")
    elif  2000<= rates[i] <=2399 :
        coler.append("6")
    elif  2400<= rates[i] <=2799 :
        coler.append("7")
    elif  2800<= rates[i] <=3199 :
        coler.append("8")    
    else:
        coler.append("all")
jud = set(coler)
if len(jud) == 8:
    print(8)
else:
    print(len(jud))

Submission status: Wrong Answer

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

c=[0]*8
maxc=0
for a in A:
    if a>=3200:
        maxc+=1
    else:
        c[a//400]=1
minc = c.count(1)
ans = min(minc+maxc,8)
print(max(minc,1),ans)

Submission status: Wrong Answer

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

c=[0]*8
maxc=0
for a in A:
    if a>=3200:
        maxc+=1
    else:
        c[a//400]=1
minc = max(c.count(1),1)
ans = min(minc+maxc,8)
print(minc,ans)