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:
#ABC064C
N = int(input())
ai = list(map(int, input().split()))
hai = 0
tya = 0
mido = 0
mizu = 0
ao = 0
ki = 0
ore = 0
aka = 0
kinds = 0
for a in ai:
    if a < 400:
        hai = 1
    elif a < 800:
        tya = 1
    elif a < 1200:
        mido = 1
    elif a < 1600:
        mizu = 1
    elif a < 2400:
        ki = 1
    elif a < 2800:
        ore = 1
    else:
        aka +=1
colors = [hai,tya,mido,mizu,ao,ki,ore]
for color in colors:
    if color == 1:
        kinds += 1
min_n = kinds
if aka > kinds:
    min_n = kinds + 1
max_n = 0
no_color = 8-kinds
if no_color >= aka:
    max_n += kinds + aka
else:
    max_n = 8
print(str(min_n) + " " + str(max_n))

Submission status: Wrong Answer

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

l = {}
for a in A:
	k = a // 400
	k = min(k, 8)
	if k not in l:
		l[k] = 1
	else:
		l[k] += 1
#print(l)
print(max(1, len(l) - 1), max(1, len(l) - 1 + l[8] if 8 in l else 0))

Submission status: Wrong Answer

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

c = [0] * 8
over = 0

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

print(sum(c), sum(c) + over)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = list(set(x//400 for x in a))

normal = [x for x in a if x < 3200]
strong = [x for x in a if x >= 3200]

normal_s = set(x // 400 for x in normal)


print(len(normal_s),len(normal_s)+len(strong))

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7


N = int(input())
a = [int(i) for i in input().split()]


counts = [0 for i in range(8)]
any = 0
for i in range(N):
    if a[i] >= 3200:
        any += 1
    else:
        ind = a[i] // 400
        counts[ind] += 1

# print(counts)

ans_min = max(1,len(counts)-counts.count(0))
if counts.count(0) != 8:
    ans_max = min(8,ans_min+any)
else:
    ans_max = min(8,any)
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7


N = int(input())
a = [int(i) for i in input().split()]


counts = [0 for i in range(8)]
any = 0
for i in range(N):
    if a[i] >= 3200:
        any += 1
    else:
        ind = a[i] // 400
        counts[ind] += 1

# print(counts)
ans_min = len(counts)-counts.count(0)
ans_max = min(8,any+ans_min)
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from functools import reduce
# import statistics
import bisect
import copy
import fractions
import math
import pprint
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers):
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
def unite(x, y):
    # それぞれのノードの根を求める
    x = root(x)
    y = root(y)
    if x == y:
        return
    # node[x]の根をyに変更する
    node[x] = y
def same(x,y): return bool(root(x) == root(y))
def root(x):
    if node[x] == x:  # xが根の場合
        return x
    else:
        node[x] = root(node[x])  # 経路圧縮
        return node[x]
def dfs(v):
    # ノードに訪れた
    visited[v] = True
    for v2 in range(n):
        if graph[v][v2] == False:  # そもそもvとv2が辺でつながっていない
            continue
        if visited[v2] == True:  # もう見た
            continue
        dfs(v2)


n = II()
a = LI()
colors = [0] * 9
for rate in a:
    if 1 <= rate <= 399:
        colors[0] += 1
    elif 400 <= rate <= 799:
        colors[1] += 1
    elif 800 <= rate <= 1199:
        colors[2] += 1
    elif 1200 <= rate <= 1599:
        colors[3] += 1
    elif 1600 <= rate <= 1999:
        colors[4] += 1
    elif 2000 <= rate <= 2399:
        colors[5] += 1
    elif 2400 <= rate <= 2799:
        colors[6] += 1
    elif 2800 <= rate <= 3199:
        colors[7] += 1
    else:
        colors[8] += 1
ans = sum(colors[i] >= 1 for i in range(8))
if ans != 0:
    print(str(ans) + ' ' + str(min(ans + colors[8], 8)))
else:
    print(str('1') + ' ' + str(min(colors[8], 8)))

Submission status: Wrong Answer

Solution code:
from collections import Counter
from functools import reduce
# import statistics
import bisect
import copy
import fractions
import math
import pprint
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers):
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
def unite(x, y):
    # それぞれのノードの根を求める
    x = root(x)
    y = root(y)
    if x == y:
        return
    # node[x]の根をyに変更する
    node[x] = y
def same(x,y): return bool(root(x) == root(y))
def root(x):
    if node[x] == x:  # xが根の場合
        return x
    else:
        node[x] = root(node[x])  # 経路圧縮
        return node[x]
def dfs(v):
    # ノードに訪れた
    visited[v] = True
    for v2 in range(n):
        if graph[v][v2] == False:  # そもそもvとv2が辺でつながっていない
            continue
        if visited[v2] == True:  # もう見た
            continue
        dfs(v2)


n = II()
a = LI()
colors = [0] * 9
for rate in a:
    if 1 <= rate <= 399:
        colors[0] += 1
    elif 400 <= rate <= 799:
        colors[1] += 1
    elif 800 <= rate <= 1199:
        colors[2] += 1
    elif 1200 <= rate <= 1599:
        colors[3] += 1
    elif 1600 <= rate <= 1999:
        colors[4] += 1
    elif 2000 <= rate <= 2399:
        colors[5] += 1
    elif 2400 <= rate <= 2799:
        colors[6] += 1
    elif 2800 <= rate <= 3199:
        colors[7] += 1
    else:
        colors[8] += 1
ans = sum(colors[i] >= 1 for i in range(8))
print(str(ans) + ' ' + str(min(ans + colors[8], 8)))

Submission status: Wrong Answer

Solution code:

def read_input():
    n = int(input())
    alist = list(map(int, input().split()))

    return n, alist

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

def submit():
    n, alist = read_input()
    rates = [get_rate(a) for a in alist]

    colors = {}
    for r in rates:
        if r == 9:
            continue

        if r not in colors.keys():
            colors[r] = 1
        else:
            colors[r] += 1

    tops = [r for r in rates if r == 9]
    color_n = len(colors)

    if color_n == 0:
        # minではtopは1色に合わせる
        color_min = 1
        color_max = min(8, len(tops))
    else:
        # minではtopは既存に色を合わせる
        color_min = color_n
        color_max = min(8, color_n + len(tops))

    print('{} {}'.format(color_min, color_max))


if __name__ == '__main__':
    submit()

Submission status: Wrong Answer

Solution code:
def color(r):
  if r<3200:return r//400
  else:return 8
colors = [0]*9
N=int(input())
for a in map(int,input().split()):
  colors[color(a)]+=1
base=0
for i in range(8):
  if colors[i]>0:base+=1
print(base, base+colors[8])

Submission status: Wrong Answer

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

C = {}
C2 = 0
for a in A:
    for i in range(1, 9):
        if a < 400*i:
            if i in C.keys():
                C[i] +=  1
            else:
                C[i] = 1
            break
    if a >= 3200:
        C2 += 1
print(len(C), len(C)+C2)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[int(i) for i in input().split()]
CL=[0]*9
for a in A:
  cl=min(8,a//400)
  if cl==8:
    CL[cl]+=1
  elif CL[cl]==0:
    CL[cl]=1
print(CL)
if sum(CL[:-1])==0:
  print(1,CL[-1])  
else:
  print(sum(CL[:-1]),sum(CL))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[int(i) for i in input().split()]
CL=[0]*9
for a in A:
  cl=min(8,a//400)
  if cl==8:
    CL[cl]+=1
  elif CL[cl]==0:
    CL[cl]=1
if sum(CL[:-1])==0:
  print(1,1)  
else:
  print(sum(CL[:-1]),sum(CL))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[int(i) for i in input().split()]
CL=[0]*8
for a in A:
  cl=min(7,a//400)
  if cl==7:
    CL[cl]+=1
  elif CL[cl]==0:
    CL[cl]=1
print(sum(CL[:-1])+min(CL[-1],1),sum(CL))

Submission status: Wrong Answer

Solution code:
def get_color_num(c,L):
    if c <= L[0]:
        out=0
    elif  c > L[0] and c <= L[1] :
        out=1
    elif  c > L[1] and c <= L[2] :
        out=2
    elif  c > L[2] and c <= L[3] :
        out=3
    elif  c > L[3] and c <= L[4] :
        out=4
    elif  c > L[4] and c <= L[5] :
        out=5
    elif  c > L[5] and c <= L[6] :
        out=6
    elif  c > L[6] and c <= L[7] :
        out=7
    elif  c > L[7] and c <= L[8] :
        out=8
        
    return out

N=int(input())

A=[int(x) for x in input().split()]

L=list(range(399,3200,400))
L.extend([4800])

C_Num=[0]*9

for a in range(len(A)):
    a_temp=A[a]
    C_Num[get_color_num(a_temp,L)]+=1

#最小を求める
C_Num_min=0
for c_min in C_Num[:-1]:
    if c_min>0:
        C_Num_min+=1

#3200以上の人しかいない場合
if C_Num_min==0 and C_Num[-1]>0:
    C_Num_min+=1 

#最大を求める
C_Num_max=0

for c_max in C_Num[:-1]:
    if c_max>0:
        C_Num_max+=1
        
#全部の色にはいない場合
C_Num_max+=C_Num[-1]
if C_Num_max >7:
    C_Num_max=7
        
output=str( C_Num_min)+' '+str( C_Num_max)
print(output)

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    a = f()

    b = [0] * 9
    for i in range(n):
        if a[i]<=399:
            b[0] += 1
        elif a[i]<=799:
            b[1] += 1
        elif a[i]<=1199:
            b[2] += 1
        elif a[i]<=1599:
            b[3] += 1
        elif a[i]<=1999:
            b[4] += 1
        elif a[i]<=2399:
            b[5] += 1
        elif a[i]<=2799:
            b[6] += 1
        elif a[i]<=3199:
            b[7] += 1
        else:
            b[8] += 1
    
    cnt = 0
    for i in range(8):
        if b[i] >0:
            cnt+=1

    minc = cnt if cnt>0 else 1

    maxc = cnt + min(8-cnt, b[8])
    print(minc, maxc)

solve()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = map(int,input().split())
color = [0,0,0,0,0,0,0,0,0]
for _a in a:
    if _a < 400:
        color[0] += 1
    elif _a < 800:
        color[1] += 1
    elif _a < 1200:
        color[2] += 1
    elif _a < 1600:
        color[3] += 1
    elif _a < 2000:
        color[4] += 1
    elif _a < 2400:
        color[5] += 1
    elif _a < 2800:
        color[6] += 1
    elif _a < 3200:
        color[7] += 1
    else:
        color[8] += 1
category = 0
for i in range(8):
    if color[i] != 0:
        category += 1
if category == 0:
    category += 1
print(category,category + color[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = map(int,input().split())
color = [0,0,0,0,0,0,0,0,0]
for _a in a:
    if _a < 400:
        color[0] += 1
    elif _a < 800:
        color[1] += 1
    elif _a < 1200:
        color[2] += 1
    elif _a < 1600:
        color[3] += 1
    elif _a < 2000:
        color[4] += 1
    elif _a < 2400:
        color[5] += 1
    elif _a < 2800:
        color[6] += 1
    elif _a < 3200:
        color[7] += 1
    else:
        color[8] += 1
category = 0
for i in range(8):
    if color[i] != 0:
        category += 1
print(category,category + color[8])

Submission status: Wrong Answer

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

color = [0] * 8
free = 0
for i in a:
    if i < 3200:
        color[i//400] += 1
    else:
        free += 1

free = min(free, 8)

ans = 0
for i in color:
    if i > 0:
        ans += 1

if ans == 0:
    ans1 = 1
else:
    ans1 = ans
ans2 = ans + free

print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
topcoder = 0
colors = []
for i in a:
    if i > 3199:
        topcoder += 1
    else:
        colors.append(i//400)
print('{minimum} {maximum}'.format(minimum = len(list(set(colors))), maximum = len(list(set(colors)))+topcoder))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

counter = defaultdict(int)
for ai in a:
    counter[min(ai // 400, 8)] += 1
ans = 0
for i in range(8):
    if counter[i] > 0:
        ans += 1
ans = max(ans, 1)
print(ans, ans + counter[8])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

counter = defaultdict(int)
for ai in a:
    counter[min(ai // 400, 8)] += 1
ans = 0
for i in range(8):
    if counter[i] > 0:
        ans += 1
print(ans, ans + counter[8])

Submission status: Wrong Answer

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

rate = {}

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

for n in a:
    col = color_check(n)
    rate.setdefault(col, 0)
    rate[col] += 1

colors = len(rate)

if not 'top' in rate:
    maxl, minl = colors, colors
else:
    maxl = (colors - 1) + rate['top']
    minl = (colors - 1)

print(minl, maxl)

Submission status: Wrong Answer

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

rate = {}

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

for n in a:
    col = color_check(n)
    rate.setdefault(col, 0)
    rate[col] += 1

colors = len(rate)

if not 'top' in rate:
    maxl, minl = colors, colors
else:
    if (colors - 1) >= rate['top']:
        maxl = (colors - 1) + rate['top']
        minl = (colors - 1)
    else:
        maxl = (colors - 1) + rate['top']
        minl = (colors - 1) + (rate['top'] - (colors - 1))

print(minl, maxl)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
c = {n:0 for n in range(0, 9)}
for a_ in a:
    a__ = a_ // 400
    if a__ <= 7:
        c[a__] += 1
    else:
        c[8] += 1
count = 0
for k, v in c.items():
    if k <= 7:
        if v > 0:
            count += 1
    elif k == 8:
        cc = v + count
        if cc >= 8:
            cc = 8
if count == 0:
    count = 1
ans = str(count) + " " + str(cc)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
c = {n:0 for n in range(0, 9)}
for a_ in a:
    a__ = a_ // 400
    if a__ <= 7:
        c[a__] += 1
    else:
        c[8] += 1
count = 0
for k, v in c.items():
    if k <= 7:
        if v > 0:
            count += 1
    else:
        cc = v + count
        if cc >= 9:
            cc = 8
if count == 0:
    count = 1
ans = str(count) + " " + str(cc)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
c = {n:0 for n in range(0, 9)}
for a_ in a:
    a__ = a_ // 400
    if a__ <= 7:
        c[a__] += 1
    else:
        c[8] += 1
count = 0
for k, v in c.items():
    if k <= 7:
        if v > 0:
            count += 1
    else:
        cc = v + count
        if cc >= 9:
            cc = 9
if count == 0:
    count = 1
ans = str(count) + " " + str(cc)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
c = {n:0 for n in range(0, 9)}
for a_ in a:
    a__ = a_ // 400
    if a__ <= 7:
        c[a__] += 1
    else:
        c[8] += 1
count = 0
for k, v in c.items():
    if k <= 7:
        if v > 0:
            count += 1
    else:
        cc = v + count
        if cc >= 9:
            cc = 9
ans = str(count) + " " + str(cc)
print(ans)

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split());x=[i//400for i in a if i<3200];y=set(x);z=len(y);print(z,n-len(x)+z)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
colors = set()
cnt = 0
for i in range(N):
    for j in range(1, 9):
        if (j - 1) * 400 <= A[i] < j * 400:
            colors.add(j)
            break
    if 3200 <= A[i]:
        cnt += 1

col_lem = len(colors)
print(max(col_lem, cnt), col_lem + cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
colors = set()
cnt = 0
for i in range(N):
    for j in range(1, 9):
        if (j - 1) * 400 <= A[i] < j * 400:
            colors.add(j)
            break
    if 3200 <= A[i]:
        cnt += 1

print(len(colors), len(colors) + cnt)

Submission status: Wrong Answer

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

l = [0 for _ in range(8)]

b = 0

for i in range(N):
    if a[i] >= 3200:
        b += 1
    else:
        l[a[i] // 400] = 1

ans2 = sum(l) + b
if ans2 > 8:
    ans2 = 8

ans1 = sum(l)
if ans1 == 0:
    ans1 = 1

print(ans1, ans2)

Submission status: Wrong Answer

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

l = [0 for _ in range(8)]

b = 0

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

if sum(l) + b > 8:
    ans2 = 8
else:
    ans2 = sum(l) + b

ans1 = sum(l)
if ans1 == 0:
    ans1 = 1

print(ans1, ans2)

Submission status: Wrong Answer

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

l = [0 for _ in range(9)]

b = 0

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

if sum(l) + b > 8:
    ans2 = 8
else:
    ans2 = sum(l) + b

ans1 = sum(l)
if ans1 == 0:
    ans1 = 1

print(ans1, ans2)

Submission status: Wrong Answer

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

l = [0 for _ in range(9)]

b = 0

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

if sum(l) + b > 8:
    ans = 8
else:
    ans = sum(l) + b

print(sum(l), ans)

Submission status: Wrong Answer

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

def mapColor(rate):
    if rate<=399:
        return 'grey'
    if rate<=799:
        return 'tea'
    if rate<=1199:
        return 'green'
    if rate<=1599:
        return 'water'
    if rate<=1999:
        return 'blue'
    if rate<=2399:
        return 'yellow'
    if rate<=2799:
        return 'orange'
    if rate<=3199:
        return 'red'
    return 'any'

s = set()

x = 0

for d in data:
    c = mapColor(d)
    if c=='any':
        x+=1
    else:
        s.add(c)

print(len(s),end=" ")
print(x+len(s))

Submission status: Wrong Answer

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

def mapColor(rate):
    if rate<=399:
        return 'grey'
    if rate<=799:
        return 'tea'
    if rate<=1199:
        return 'green'
    if rate<=1599:
        return 'water'
    if rate<=1999:
        return 'blue'
    if rate<=2399:
        return 'yellow'
    if rate<=2799:
        return 'orange'
    if rate<=3199:
        return 'red'
    return 'any'

s = set()

x = 0

for d in data:
    c = mapColor(d)
    if c=='any':
        x+=1
    else:
        s.add(c)

print(len(s),end=" ")
print(min(8,x+len(s)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=[0]*8
c=[i for i in a if i>=3200]
M=0
for i in a:
    if i<=399:
        b[0]=1
    elif 400<=i<=799:
        b[1]=1
    elif 800<=i<=1199:
        b[2]=1
    elif 1200<=i<=1599:
        b[3]=1
    elif 1600<=i<=1999:
        b[4]=1
    elif 2000<=i<=2399:
        b[5]=1
    elif 2400<=i<=2799:
        b[6]=1
    elif 2800<=i<=3199:
        b[7]=1
    else:
        if len(c)>=b.count(0):
            M=8
        else:
            M=b.count(1)+len(c)
m=b.count(1)
if a[-1]<=3199:
    M=b.count(1)
if a[0]>=3200:
    m=1
print(m,M)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*8
c=[i for i in a if i>=3200]
M=0
for i in a:
    if i<=399:
        b[0]=1
    elif 400<=i<=799:
        b[1]=1
    elif 800<=i<=1199:
        b[2]=1
    elif 1200<=i<=1599:
        b[3]=1
    elif 1600<=i<=1999:
        b[4]=1
    elif 2000<=i<=2399:
        b[5]=1
    elif 2400<=i<=2799:
        b[6]=1
    elif 2800<=i<=3199:
        b[7]=1
    else:
        if len(c)>=b.count(0):
            M=8
        else:
            M=b.count(1)+len(c)
m=b.count(1)
if a[-1]<=3199:
    M=b.count(1)
if a[0]>=3200:
    m=1
print(m,M)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*8
c=[i for i in a if i>=3200]
M=0
for i in a:
    if i<=399:
        b[0]=1
    elif 400<=i<=799:
        b[1]=1
    elif 800<=i<=1199:
        b[2]=1
    elif 1200<=i<=1599:
        b[3]=1
    elif 1600<=i<=1999:
        b[4]=1
    elif 2000<=i<=2399:
        b[5]=1
    elif 2400<=i<=2799:
        b[6]=1
    elif 2800<=i<=3199:
        b[7]=1
    else:
        if len(c)>=b.count(0):
            M=8
        else:
            M=b.count(1)+len(c)
if a[-1]<=3199:
    M=b.count(1)
m=b.count(1)
print(m,M)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*8
c=[i for i in a if i>=3200]
M=0
for i in a:
    if i<=399:
        b[0]=1
    elif 400<=i<=799:
        b[1]=1
    elif 800<=i<=1199:
        b[2]=1
    elif 1200<=i<=1599:
        b[3]=1
    elif 1600<=i<=1999:
        b[4]=1
    elif 2000<=i<=2399:
        b[5]=1
    elif 2400<=i<=2799:
        b[6]=1
    elif 2800<=i<=3199:
        b[7]=1
    if i==a[-1]:
        M=b.count(1)
    else:
        if len(c)>=b.count(0):
            M=8
        else:
            M=b.count(1)+len(c) 
m=b.count(1)
print(m,M)

Submission status: Wrong Answer

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

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

for i in range(0,8):
  if ans[i] > 0:
    minv += 1
    
if minv == 0:
  minv = 1
maxv = str(minv + ans[8])
minv = str(minv)


#print(ans)
print("".join([minv, " ", maxv]))

Submission status: Wrong Answer

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

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

for i in range(0,8):
  if ans[i] > 0:
    minv += 1
    
maxv = str(minv + ans[8])
minv = str(minv)


#print(ans)
print("".join([minv, " ", maxv]))

Submission status: Wrong Answer

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

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

for i in ans[:-1]:
  if i > 0:
    minv += 1
    
maxv = str(minv + ans[8])
minv = str(minv)


#print(ans)
print("".join([minv, " ", maxv]))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
mo=10**9+7
n=int(input())
a=[0]*9
for s in map(int,input().split()):
    for i in range(8):
        if int(s)>=i*400 and (i+1)*400>int(s):
            a[i]=1
    if int(s)>=3200:
        #print(int(s),'rain')
        a[8]+=1
    
#print(a)
ans=sum(a[0:8])
#ans=[ans,min(8,a[8]+ans)]
ans=[ans,a[8]+ans]
print(*ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
mo=10**9+7
n=int(input())
a=[0]*9
for s in map(int,input().split()):
    for i in range(8):
        if int(s)>=i*400 and (i+1)*400>int(s):
            a[i]=1
    if int(s)>=3200:
        #print(int(s),'rain')
        a[8]+=1
    
#print(a)
ans=sum(a[0:8])
ans=[ans,min(8,a[8]+ans)]
print(*ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
mo=10**9+7
n=int(input())
a=[0]*9
for s in map(int,input().split()):
    for i in range(8):
        if int(s)>=i*400 and (i+1)*400>int(s):
            a[i]=1
    if int(s)>=3200:
        #print(int(s),'rain')
        a[8]+=1
    
#print(a)
ans=sum(a[0:8])
ans=[ans,min(9,a[8]+ans)]
print(*ans)