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

fix_color = set()
n_any_color = 0
for color in a:

  if color < 400:
    fix_color.add(400)
  elif color < 800:
    fix_color.add(800)
  elif color < 1200:
    fix_color.add(1200)
  elif color < 1600:
    fix_color.add(1600)
  elif color < 2000:
    fix_color.add(2000)
  elif color < 2400:
    fix_color.add(2400)
  elif color < 2800:
    fix_color.add(2800)
  elif color < 3200:
    fix_color.add(3200)
  else:
    n_any_color += 1

n_min = len(fix_color)
n_max = n_min + n_any_color
print(n_min, n_max)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=set()
b=0
for a in A:
    if a>=3200:
        b+=1
    else:
        B.add(a//400)
print(len(B),len(B)+b)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=set()
b=0
for a in A:
    if a>=3200:
        b+=1
    else:
        B.add(a//400)
print(len(B),min(8,len(B)+b))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict


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

    color = defaultdict(int)

    for aa in a:
        if aa < 3200:
            color[aa//400] += 1
        else:
            color[8] += 1

    min_ans = len(color)
    max_ans = len(color)

    if 8 in color:
        min_ans -= 1
        max_ans += color[8] - 1

    print(min_ans, max_ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
li = [0]*9

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

for i in a:
    if i//400 > 7:
        li[8] += 1
    else:
        li[i//400] = 1

print(min(1,sum(li[:-1])),sum(li))

Submission status: Wrong Answer

Solution code:
li = [0]*9

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

for i in a:
    if i//400 > 7:
        li[8] += 1
    else:
        li[i//400] = 1

print(sum(li[:-1]),sum(li))

Submission status: Wrong Answer

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

ans = [0]*8
leng = 0

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

maxi = sum(ans)+leng
mini = sum(ans)

if sum(ans)+leng >= 8:
    maxi = 8
if sum(ans) < 1:
    mini = 1

print(mini, maxi)

Submission status: Wrong Answer

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

ans = [0]*8
leng = 0

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


if sum(ans)+leng >= 8:
    print(sum(ans), 8)
elif sum(ans) < 1:
    ans[0] = 1
    print(sum(ans), sum(ans)+leng)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
bo = [False] * 8
free = 0
for x in a:
    now = x//400
    if now < 8:
        bo[now] = True
    else:
        free += 1
print(sum(bo), sum(bo) + free)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0 for i in range(8)]
a = 0
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:
    a += 1

m = sum(B)
M = m+a
if M>8:
  M = 8
if m == 0:
  m = 1
print(m,M,sep=' ')

Submission status: Wrong Answer

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

ans = [0]*8
leng = 0

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

if sum(ans)+leng >= 8:
    print(sum(ans), 8)
else:
    print(sum(ans), sum(ans)+leng)

Submission status: Wrong Answer

Solution code:
#import collections
n=int(input())
#a,b,c,d=map(int,input().split())
a=list(map(int,input().split()))
#n=int(input())
#s=input()
#mod=10**9+7
color_rate=[0]*8
sani=0
for i in a:
  if 1<=i<=399:
    color_rate[0]+=1
  elif 400<=i<=799:
    color_rate[1]+=1
  elif 800<=i<=1199:
    color_rate[2]+=1
  elif 1200<=i<=1599:
    color_rate[3]+=1
  elif 1600<=i<=1999:
    color_rate[4]+=1
  elif 2000<=i<=2399:
    color_rate[5]+=1
  elif 2400<=i<=2799:
    color_rate[6]+=1
  elif 2800<=i<=3199:
    color_rate[7]+=1
  else:
    sani+=1
saidai=0
saisyou=0
for i in color_rate:
  if i!=0:
    saidai+=1
    saisyou+=1

if color_rate.count(0)==8:
  saidai=min(sani,8)
  saisyou=1
elif color_rate.count(0)>=1:
  saidai=min(color_rate.count(0),sani)+8-color_rate.count(0)
  saisyou=8-color_rate.count(0)
print(saisyou,saidai)

Submission status: Wrong Answer

Solution code:
#import collections
n=int(input())
#a,b,c,d=map(int,input().split())
a=list(map(int,input().split()))
#n=int(input())
#s=input()
#mod=10**9+7
color_rate=[0]*8
sani=0
for i in a:
  if 1<=i<=399:
    color_rate[0]+=1
  elif 400<=i<=799:
    color_rate[1]+=1
  elif 800<=i<=1199:
    color_rate[2]+=1
  elif 1200<=i<=1599:
    color_rate[3]+=1
  elif 1600<=i<=1999:
    color_rate[4]+=1
  elif 2000<=i<=2399:
    color_rate[5]+=1
  elif 2400<=i<=2799:
    color_rate[6]+=1
  elif 2800<=i<=3199:
    color_rate[7]+=1
  else:
    sani+=1
saidai=0
saisyou=0
if color_rate.count(0)==8:
  saidai=min(sani,8)
  saisyou=1
elif color_rate.count(0)>=1:
  saidai=min(color_rate.count(0),sani)+8-color_rate.count(0)
  saisyou=8-color_rate.count(0)
else:
  saidai=8
  saisyou=8
print(saisyou,saidai)

Submission status: Wrong Answer

Solution code:
#import collections
n=int(input())
#a,b,c,d=map(int,input().split())
a=list(map(int,input().split()))
#n=int(input())
#s=input()
#mod=10**9+7
color_rate=[0]*8
sani=0
for i in a:
  if 1<=i<=399:
    color_rate[0]+=1
  elif 400<=i<=799:
    color_rate[1]+=1
  elif 800<=i<=1199:
    color_rate[2]+=1
  elif 1200<=i<=1599:
    color_rate[3]+=1
  elif 1600<=i<=1999:
    color_rate[4]+=1
  elif 2000<=i<=2399:
    color_rate[5]+=1
  elif 2400<=i<=2799:
    color_rate[6]+=1
  elif 2800<=i<=3199:
    color_rate[7]+=1
  else:
    sani+=1
saidai=0
saisyou=0
if color_rate.count(0)==8:
  saidai=min(sani,8)
  saisyou=1
elif color_rate.count(0)>=1:
  saidai=min(color_rate.count(0),sani)+8-color_rate.count(0)
  saisyou=8-color_rate.count(0)
print(saisyou,saidai)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0 for i in range(8)]
a = 0
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:
    a += 1
C = []
for i in range(8):
  if B[i] >0:
    C.append(1)

m = len(C)
M = m+a
if M>8:
  M = 8
if m == 0:
  m = 1
print(m,M,sep=' ')

Submission status: Wrong Answer

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

ans = [0]*8
leng = 0

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

if sum(ans) >= 6:
    leng = 8-sum(ans)
    
print(sum(ans), sum(ans)+leng)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0 for i in range(8)]
a = 0
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:
    a += 1
C = []
for i in range(8):
  if B[i] >0:
    C.append(1)

m = len(C)
M = m+a
if M>8:
  M = 8
if a == N:
  m = 1
print(m,M,sep=' ')

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()
ans = []
for i in range(n):
    if 1 <= a[i] and a[i] <= 399:
        ans.append('hai')
    if 400 <= a[i] and a[i] <= 799:
        ans.append('tya')
    if 800 <= a[i] and a[i] <= 1199:
        ans.append('midori')
    if 1200 <= a[i] and a[i] <= 1599:
        ans.append('mizu')
    if 1600 <= a[i] and a[i] <= 1999:
        ans.append('ao')
    if 2000 <= a[i] and a[i] <= 2399:
        ans.append('ki')
    if 2400 <= a[i] and a[i] <= 2799:
        ans.append('daidai')
    if 2800 <= a[i] and a[i] <= 3199:
        ans.append('aka')
    if a[i] >= 3200:
        ans.append('nanndemoii')
# print(ans)
set_ans = list(set(ans))
# print(set_ans)
min_cnt = 0
for i in range(len(set_ans)):
    if set_ans[i] != 'nanndemoii':
        min_cnt += 1
# print(min_cnt)
max_cnt = 0
for i in range(n):
    if ans[i] == 'nanndemoii':
        max_cnt += 1
max_cnt += min_cnt
print(min_cnt, max_cnt)

Submission status: Wrong Answer

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

ans = [0]*9
leng = 0

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

print(sum(ans), sum(ans)+leng)

Submission status: Wrong Answer

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

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

mx = sum(count[:8]) + count[8]
mn = 0
if sum(count[:8]) == 0 and count[7] != 0:
    mn = 1
else:
    mn = sum(count[:8])

print(mn, mx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
  n = int(input())
  aa = list(map(int, input().split()))
  s = set()
  num = 0
  for a in aa:
    if a >= 3200:
      num += 1
    else:
      s.add(a // 400)
  print(len(s), len(s) + num)
  return

if __name__ == "__main__":
  resolve()

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0 for i in range(8)]
a = 0
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:
    a += 1
C = []
for i in range(8):
  if B[i] >0:
    C.append(1)

m = len(C)
M = m+a
if M>8:
  M = 8
print(m,M,sep=' ')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
ls = [0]*8
now = 0
for i in range(N):
  if 3200 <= A[i]:
    now += 1
  else:
    ls[A[i]//400] += 1
print(8-ls.count(0),8-ls.count(0)+now)

Submission status: Wrong Answer

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

cnt = [0] * 8
free = 0

for _a in a:
    if 1 <= _a <= 399:
        cnt[0] = 1
    elif 400 <= _a <= 799:
        cnt[1] = 1
    elif 800 <= _a <= 1199:
        cnt[2] = 1
    elif 1200 <= _a <= 1599:
        cnt[3] = 1
    elif 1600 <= _a <= 1999:
        cnt[4] = 1
    elif 2000 <= _a <= 2399:
        cnt[5] = 1
    elif 2400 <= _a <= 2799:
        cnt[6] = 1
    elif 2800 <= _a <= 3199:
        cnt[7] = 1
    else:
        free += 1

print(sum(cnt), sum(cnt)+free)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1


checkA = np.array(check[:8])
print(checkA)
num = np.count_nonzero(checkA != 0)

less = max(num, 1)
more = min(8, num + check[8])
#print(check[8])

print(less, more)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1

checkA = np.array(check[:8])
num = np.count_nonzero(checkA != 0)
if (num == 0):
    num = 1
rest = 8 - num

more = min(8, num + check[8])

print(num, more)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1

checkA = np.array(check[:8])
num = np.count_nonzero(checkA != 0)
rest = 8 - num

if (rest > check[8]):
    more = num + check[8]
    more = min(8, more)
else:

    more = 8


print(num, more)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1

checkA = np.array(check[:8])
num = np.count_nonzero(checkA != 0)
rest = 8 - num

if (rest > check[8]):
    more = num + check[8]
else:

    more = 8


print(num, more)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left

N = int(input())
a = sorted(list(map(int, input().split())))
ans = set()
max_ans = 0
c = 0
for aa in a:
  if aa < 400:
    ans.add(0)
  elif aa < 800:
    ans.add(1)
  elif aa < 1200:
    ans.add(2)
  elif aa < 1600:
    ans.add(3)
  elif aa < 2000:
    ans.add(4)
  elif aa < 2400:
    ans.add(5)
  elif aa < 2800:
    ans.add(6)
  elif aa < 3200:
    ans.add(7)
  else:
    max_ans += 1

print(len(ans), len(ans) + max_ans if max_ans else len(ans))

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left

N = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
max_ans = 0
c = 0
if bisect_left(a, 400):
  ans += 1
  c = bisect_left(a, 400)
if c != bisect_left(a, 800):
  ans += 1
  c = bisect_left(a, 800)
if c != bisect_left(a, 1200):
  ans += 1
  c = bisect_left(a, 1200)
if c != bisect_left(a, 1600):
  ans += 1
  c = bisect_left(a, 1600)
if c != bisect_left(a, 2000):
  ans += 1
  c = bisect_left(a, 2000)
if c != bisect_left(a, 2400):
  ans += 1
  c = bisect_left(a, 2400)
if c != bisect_left(a, 2800):
  ans += 1
  c = bisect_left(a, 2800)
if c != N:
  ans += 1
  max_ans += ans + N - c - 1

print(ans, max_ans if max_ans else ans)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left

N = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
max_ans = 0
c = 0
if bisect_left(a, 400):
  ans += 1
  c = bisect_left(a, 400)
if c != bisect_left(a, 800):
  ans += 1
  c = bisect_left(a, 800)
if c != bisect_left(a, 1200):
  ans += 1
  c = bisect_left(a, 1200)
if c != bisect_left(a, 1600):
  ans += 1
  c = bisect_left(a, 1600)
if c != bisect_left(a, 2000):
  ans += 1
  c = bisect_left(a, 2000)
if c != bisect_left(a, 2400):
  ans += 1
  c = bisect_left(a, 2400)
if c != bisect_left(a, 2800):
  ans += 1
  c = bisect_left(a, 2800)
if c != bisect_left(a, 3200):
  ans += 1
  c = bisect_left(a, 3200)
  max_ans += ans + N - c

print(ans, max_ans if max_ans else ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ls = list(map(int,input().split()))
a = [0]*8
p = 0
q = 0
co = 0
comax = 0
for i in range(n):
    p = ls[i]//400
    if p < 8:
        if a[p] == 0:
            a[p] += 1
            co += 1
        else:
            pass
    else:
        q += 1
comax = co + q
print(co,comax)

Submission status: Wrong Answer

Solution code:
n = int(input())
ls = list(map(int,input().split()))
a = [0]*8
p = 0
q = 0
co = 0
comax = 0
for i in range(n):
    p = ls[i]//400
    if p < 8:
        if a[p] == 0:
            a[p] += 1
            co += 1
        else:
            pass
    else:
        q += 1
comax = co + q
if comax > 8:
    comax = 8
print(co,comax)

Submission status: Wrong Answer

Solution code:
n = int(input())
ls = list(map(int,input().split()))
a = [0]*8
p = 0
q = 0
co = 0
comax = 0
for i in range(n):
    p = ls[i]//400
    if p < 8:
        if a[p] == 0:
            a[p] += 1
            co += 1
        else:
            pass
    else:
        pass
        q += 1
comax = co + q
if comax > 8:
    comax = 8
print(co,comax)

Submission status: Wrong Answer

Solution code:
N=int(input())
aN=list(map(int,input().split()))
colors=set()
sp_col=0
for a in aN:
  if      1<=a and a<= 399:colors.add('gray')
  elif  400<=a and a<= 799:colors.add('brown')
  elif  800<=a and a<=1199:colors.add('green')
  elif 1200<=a and a<=1599:colors.add('splash')
  elif 1600<=a and a<=1999:colors.add('blue')
  elif 2000<=a and a<=2399:colors.add('yellow')
  elif 2400<=a and a<=2799:colors.add('orange')
  elif 2800<=a and a<=3199:colors.add('red')
  else:sp_col+=1
  pass


print("{} {}".format(len(colors),len(colors)+sp_col))

Submission status: Wrong Answer

Solution code:
N=int(input())
aN=list(map(int,input().split()))
colors=set()
sp_col=0
for a in aN:
  if      1<=a and a<= 399:colors.add('gray')
  elif  400<=a and a<= 799:colors.add('brown')
  elif  800<=a and a<=1199:colors.add('green')
  elif 1200<=a and a<=1599:colors.add('splash')
  elif 1600<=a and a<=1999:colors.add('blue')
  elif 2000<=a and a<=2399:colors.add('yellow')
  elif 2400<=a and a<=2799:colors.add('orange')
  elif 2800<=a and a<=3199:colors.add('red')
  else:sp_col+=1
  pass
min_col = 0
if len(colors)==0:
  if sp_col>=1:
    min_col=1
    max_col=min(8,sp_col)
  else:
    min_col=0
    max_col=min(8,sp_col)
else:
  min_col=len(colors)
  max_col=min(8,min_col+sp_col)

print("{} {}".format(min_col,max_col))

Submission status: Wrong Answer

Solution code:
N=int(input())
aN=list(map(int,input().split()))
colors=set()
sp_col=0
for a in aN:
  if      1<=a and a<= 399:colors.add('gray')
  elif  400<=a and a<= 799:colors.add('brown')
  elif  800<=a and a<=1199:colors.add('green')
  elif 1200<=a and a<=1599:colors.add('splash')
  elif 1600<=a and a<=1999:colors.add('blue')
  elif 2000<=a and a<=2399:colors.add('yellow')
  elif 2400<=a and a<=2799:colors.add('orange')
  elif 2800<=a and a<=3199:colors.add('red')
  else:sp_col+=1
  pass
min_col = 0
if len(colors)==0:
  if sp_col>=1:
    min_col=1
  else:
    min_col=0
else:
  min_col=len(colors)
max_col=min(8,min_col+sp_col)

print("{} {}".format(min_col,max_col))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
C = [0] * 8
free = 0
for a in A:
	if a >= 3200:
		free += 1
	else:
		C[a // 400] = 1
print(sum(C), sum(C) + free)

Submission status: Wrong Answer

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

d = {}
cnt = 0
for i in range(N):
    if 1<=a[i]<=399:
        if 'gray' in d.keys():
            d['gray'] += 1
        else:
            d['gray'] = 1
    elif 400<=a[i]<=799:
        if 'brown' in d.keys():
            d['brown'] += 1
        else:
            d['brown'] = 1
    elif 800<=a[i]<=1199:
        if 'green' in d.keys():
            d['green'] += 1
        else:
            d['green'] = 1
    elif 1200<=a[i]<=1599:
        if 'light_blue' in d.keys():
            d['light_blue'] += 1
        else:
            d['light_blue'] = 1
    elif 1600<=a[i]<=1999:
        if 'blue' in d.keys():
            d['blue'] += 1
        else:
            d['blue'] = 1
    elif 2000<=a[i]<=2399:
        if 'yellow' in d.keys():
            d['yellow'] += 1
        else:
            d['yellow'] = 1
    elif 2400<=a[i]<=2799:
        if 'orange' in d.keys():
            d['orange'] += 1
        else:
            d['orange'] = 1
    elif 2800<=a[i]<=3199:
        if 'red' in d.keys():
            d['red'] += 1
        else:
            d['red'] = 1
    elif a[i]>=3200:
        cnt += 1
print(len(d),len(d)+cnt)

Submission status: Wrong Answer

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

d = {}
cnt = 0
for i in range(N):
    if a[i]<=399:
        if 'gray' in d.keys():
            d['gray'] += 1
        else:
            d['gray'] = 1
    elif 400<=a[i]<=799:
        if 'brown' in d.keys():
            d['brown'] += 1
        else:
            d['brown'] = 1
    elif 800<=a[i]<=1199:
        if 'green' in d.keys():
            d['green'] += 1
        else:
            d['green'] = 1
    elif 1200<=a[i]<=1599:
        if 'light_blue' in d.keys():
            d['light_blue'] += 1
        else:
            d['light_blue'] = 1
    elif 1600<=a[i]<=1999:
        if 'blue' in d.keys():
            d['blue'] += 1
        else:
            d['blue'] = 1
    elif 2000<=a[i]<=2399:
        if 'yellow' in d.keys():
            d['yellow'] += 1
        else:
            d['yellow'] = 1
    elif 2400<=a[i]<=2799:
        if 'orange' in d.keys():
            d['orange'] += 1
        else:
            d['orange'] = 1
    elif 2800<=a[i]<=3199:
        if 'red' in d.keys():
            d['red'] += 1
        else:
            d['red'] = 1
    else:
        cnt += 1
print(len(d),len(d)+cnt)

Submission status: Wrong Answer

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

d = {}
cnt = 0
for i in range(N):
    if 1<=a[i]<=399:
        if 'gray' in d.keys():
            d['gray'] += 1
        else:
            d['gray'] = 1
    elif 400<=a[i]<=799:
        if 'brown' in d.keys():
            d['brown'] += 1
        else:
            d['brown'] = 1
    elif 800<=a[i]<=1199:
        if 'green' in d.keys():
            d['green'] += 1
        else:
            d['green'] = 1
    elif 1200<=a[i]<=1599:
        if 'light_blue' in d.keys():
            d['light_blue'] += 1
        else:
            d['light_blue'] = 1
    elif 1600<=a[i]<=1999:
        if 'blue' in d.keys():
            d['blue'] += 1
        else:
            d['blue'] = 1
    elif 2000<=a[i]<=2399:
        if 'yellow' in d.keys():
            d['yellow'] += 1
        else:
            d['yellow'] = 1
    elif 2400<=a[i]<=2799:
        if 'orange' in d.keys():
            d['orange'] += 1
        else:
            d['orange'] = 1
    elif 2800<=a[i]<=3199:
        if 'red' in d.keys():
            d['red'] += 1
        else:
            d['red'] = 1
    else:
        cnt += 1
print(len(d),len(d)+cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int, input().split()))
col=[0]*8
def transcol(x):
  if 1<=x and x<=399:
    return 0
  elif 400<=x and x<=799:
    return 1
  elif 800<=x and x<=1199:
    return 2
  elif 1200<=x and x<=1599:
    return 3
  elif 1600<=x and x<=1999:
    return 4
  elif 2000<=x and x<=2399:
    return 5
  elif 2400<=x and x<=2799:
    return 6
  elif 2800<=x and x<=3199:
    return 7
free=0
for a in A:
  if a>=3200:
    free+=1
  else:
    tmp=transcol(a)
    if col[tmp]==0:
      col[tmp]=1

minans=sum(col)
maxans=minans+free
print(minans, maxans)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int, input().split()))
col=[0]*8
def transcol(x):
  if 1<=x and x<=399:
    return 0
  elif 400<=x and x<=799:
    return 1
  elif 800<=x and x<=1199:
    return 2
  elif 1200<=x and x<=1599:
    return 3
  elif 1600<=x and x<=1999:
    return 4
  elif 2000<=x and x<=2399:
    return 5
  elif 2400<=x and x<=2799:
    return 6
  elif 2800<=x and x<=3199:
    return 7
free=0
for a in A:
  if a>=3200:
    free+=1
  else:
    tmp=transcol(a)
    if col[tmp]==0:
      col[tmp]=1

minans=sum(col)
maxans=minans+min(free, (8-minans))
print(minans, maxans)

Submission status: Wrong Answer

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

tmp = [0]*8
r = 0
for i in s:
    if i <= 399:
        tmp[0] = 1
    elif i <= 799:
        tmp[1] = 1
    elif i <= 1199:
        tmp[2] = 1    
    elif i <= 1599:
        tmp[3] = 1        
    elif i <= 1999:
        tmp[4] = 1
    elif i <= 2399:
        tmp[5] = 1
    elif i <= 2799:
        tmp[6] = 1
    elif i <= 3199:
        tmp[7] = 1
    else:
        r += 1

ans_min = sum(tmp)
ans_max = sum(tmp) + r

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    cnt = [0 for _ in range(9)]
    for a in A:
        c = min([8, a // 400])
        cnt[c] += 1
    cnt_top = cnt[-1]
    n_color = 0
    for c in range(8):
        if cnt[c] > 0:
            n_color += 1
    min_n_color = max([1, n_color])
    max_n_color = n_color + min([cnt_top, 8 - n_color])
    print('{} {}'.format(min_n_color, max_n_color))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d = [0]*8
tourist = 0

for i in range(N):
  if(1<= list_a[i]< 400):
    d[0]+= 1
  elif(400<= list_a[i]< 800):
    d[1]+= 1
  elif(800<= list_a[i]< 1200):
    d[2]+= 1
  elif(1200<= list_a[i]< 1600):
    d[3]+= 1
  elif(1600<= list_a[i]< 2000):
    d[4]+= 1
  elif(2000<= list_a[i]< 2400):
    d[5]+= 1
  elif(2400<= list_a[i]< 2800):
    d[6]+= 1
  elif(2800<= list_a[i]< 3200):
    d[7]+= 1
  else:
    tourist+= 1
    
color = 8- d.count(0)
min_color = max(color, tourist)
max_color = min(color+ tourist, 8)

print(min_color, max_color)

Submission status: Wrong Answer

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

d = [0]*7
tourist = 0

for i in range(N):
  if(1<= list_a[i]< 400):
    d[0]+= 1
  elif(400<= list_a[i]< 800):
    d[1]+= 1
  elif(800<= list_a[i]< 1200):
    d[2]+= 1
  elif(1200<= list_a[i]< 1600):
    d[3]+= 1
  elif(1600<= list_a[i]< 2000):
    d[4]+= 1
  elif(2000<= list_a[i]< 2400):
    d[5]+= 1
  elif(2400<= list_a[i]< 2800):
    d[6]+= 1
  else:
    tourist+= 1
    
color = 7- d.count(0)
min_color = max(color, tourist)
max_color = min(color+ tourist, 7)

print(min_color, max_color)

Submission status: Wrong Answer

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

rating = []
s = 0

for i in range(N):
  if a[i] >= 3200:
    s += 1

  if a[i] < 400:
    rating.append('0')
  elif a[i] < 800:
    rating.append('1')
  elif a[i] < 1200:
    rating.append('2')
  elif a[i] < 1600:
    rating.append('3')
  elif a[i] < 2000:
    rating.append('4')
  elif a[i] < 2400:
    rating.append('5')
  elif a[i] < 2800:
    rating.append('6')
  elif a[i] < 3200:
    rating.append('7')

print(len(list(set(rating))), len(list(set(rating))) + s)