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:
from itertools import groupby

RANGE_TO_COLORS = {
    range(1, 400): "gray",
    range(400, 800): "brown",
    range(800, 1200): "green",
    range(1200, 1600): "lightblue",
    range(1600, 2000): "blue",
    range(2000, 2400): "yellow",
    range(2400, 2800): "orange",
    range(2800, 3200): "red",
    range(3200, 4800): "all"
}


def rate_to_color(r: int) -> str:
    for _range, color in RANGE_TO_COLORS.items():
        if r in _range:
            return color
    else:
        return "Unknown"


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

groups = []
unique_keys = []
data = sorted(A, key=rate_to_color)
for k, g in groupby(data, rate_to_color):
    groups.append(len(list(g)))
    unique_keys.append(k)

if "all" in unique_keys:
    idx = unique_keys.index("all")
    all_value = groups[idx]
    colors_exclude_all = len(unique_keys) - 1
    if (all_value - colors_exclude_all) >= 0:
        print(all_value, colors_exclude_all + all_value)
    else:
        print(colors_exclude_all, colors_exclude_all + all_value)

else:
    print(len(unique_keys), len(unique_keys))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

l = [0]*9

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

b = [i for i in l[:8] if i > 0]

mx = len(b)+l[8]
mn = len(b)
print(mn,mx)

Submission status: Wrong Answer

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

color = [False for _ in range(8)]
x = 0
for a in A:
    if a >= 3200:
        x += 1
    else:
        tmp = a // 400
        color[tmp] = True

print(color.count(True), color.count(True) + x)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

n = int(input().rstrip())
scores = list(map(int,input().rstrip().split()))
band = [399,799,1199,1599,1999,2399,2799,3199]
distr = [0 for _ in range(len(band)+1)]
for s in scores:
    found = False
    for bi in range(len(band)-1,-1,-1):
        if s > band[bi]:
            distr[bi+1] += 1
            found = True
            break
    if found != True:
        distr[0] += 1

n = len([1 for x in distr[:-1] if x > 0])
col_min = n
col_max = n
if n == 0 and distr[-1]>0:
    col_min = 1
col_max = min(8,n + distr[-1])
print(col_min,col_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
over = 0
M = [0 for _ in range(8)]
for a in A:
    if 1 <= a <= 399:
        M[0] = 1
    elif 400 <= a <= 799:
        M[1] = 1
    elif 800 <= a <= 1199:
        M[2] = 1
    elif 1200 <= a <= 1599:
        M[3] = 1
    elif 1600 <= a <= 1999:
        M[4] = 1
    elif 2000 <= a <= 2399:
        M[5] = 1
    elif 2400 <= a <= 2799:
        M[6] = 1
    elif 2800 <= a <= 3199:
        M[7] = 1
    elif 3200 <= a:
        over += 1
count = sum(M)
if count == 0:
    print(str(1)+' '+str(min(over,8)))
else:
    print(str(count)+' '+str(count+min(over,8-count)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
over = 0
M = [0 for _ in range(8)]
for a in A:
    if 1 <= a <= 399:
        M[0] = 1
    elif 400 <= a <= 799:
        M[1] = 1
    elif 800 <= a <= 1199:
        M[2] = 1
    elif 1200 <= a <= 1599:
        M[3] = 1
    elif 1600 <= a <= 1999:
        M[4] = 1
    elif 2000 <= a <= 2399:
        M[5] = 1
    elif 2400 <= a <= 2799:
        M[6] = 1
    elif 2800 <= a <= 3199:
        M[7] = 1
    elif 3200 <= a:
        over += 1
count = sum(M)
if over == 0:
    print(str(max(count,0))+' '+str(count))
else:
    print(str(max(count,1))+' '+str(count+min(over,8-count)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
over = 0
count = 0
M = {'1-399':0,'400-799':0,'800-1199':0,'1200-1599':0,'1600-1999':0,'2000-2399':0,'2400-2799':0,'2800-3199':0}
for a in A:
    if 1 <= a <= 399 and M['1-399'] == 0:
        M['1-399'] = 1
        count += 1
    elif 400 <= a <= 799 and M['400-799'] == 0:
        M['400-799'] = 1
        count += 1
    elif 800 <= a <= 1199 and M['800-1199'] == 0:
        M['800-1199'] = 1
        count += 1
    elif 1200 <= a <= 1599 and M['1200-1599'] == 0:
        M['1200-1599'] = 1
        count += 1
    elif 1600 <= a <= 1999 and M['1600-1999'] == 0:
        M['1600-1999'] = 1
        count += 1
    elif 2000 <= a <= 2399 and M['2000-2399'] == 0:
        M['2000-2399'] = 1
        count += 1
    elif 2400 <= a <= 2799 and M['2400-2799'] == 0:
        M['2400-2799'] = 1
        count += 1
    elif 2800 <= a <= 3199 and M['2800-3199'] == 0:
        M['2800-3199'] = 1
        count += 1
    elif 3200 <= a:
        over += 1
print(str(min(count,1))+' '+str(count+min(over,8-count)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
over = 0
count = 0
M = {'1-399':0,'400-799':0,'800-1199':0,'1200-1599':0,'1600-1999':0,'2000-2399':0,'2400-2799':0,'2800-3199':0}
for a in A:
    if 1 <= a <= 399 and M['1-399'] == 0:
        M['1-399'] = 1
        count += 1
    elif 400 <= a <= 799 and M['400-799'] == 0:
        M['400-799'] = 1
        count += 1
    elif 800 <= a <= 1199 and M['800-1199'] == 0:
        M['800-1199'] = 1
        count += 1
    elif 1200 <= a <= 1599 and M['1200-1599'] == 0:
        M['1200-1599'] = 1
        count += 1
    elif 1600 <= a <= 1999 and M['1600-1999'] == 0:
        M['1600-1999'] = 1
        count += 1
    elif 2000 <= a <= 2399 and M['2000-2399'] == 0:
        M['2000-2399'] = 1
        count += 1
    elif 2400 <= a <= 2799 and M['2400-2799'] == 0:
        M['2400-2799'] = 1
        count += 1
    elif 2800 <= a <= 3199 and M['2800-3199'] == 0:
        M['2800-3199'] = 1
        count += 1
    elif 3200 <= a:
        over += 1
print(str(max(count,1))+' '+str(count+min(over,8-count)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
n  = int(input())
#  = map(int, input().split())
a  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#

colors = [a_ // 400 for a_ in a if a_ < 3200]
colors_3200 = [a_ // 400 for a_ in a if a_ >= 3200]
c = collections.Counter(colors)

min_ = len(c)
max_ = min(8, len(c) + len(colors_3200))
print(min_, max_)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

D = {400:0, 800:0, 1200:0, 1600:0, 2000:0, 2400:0, 2800:0, 3200:0}

cnt = 0
for a in A:
    if a < 400:
        D[400]+=1
    elif a < 800:
        D[800]+=1
    elif a < 1200:
        D[1200]+=1
    elif a < 1600:
        D[1600]+=1
    elif a < 2000:
        D[2000]+=1
    elif a < 2400:
        D[2400]+=1
    elif a < 2800:
        D[2800]+=1
    elif a < 3200:
        D[3200]+=1
    elif a >= 3200:
        cnt += 1

mi = 0
ma = 0

for k, v in D.items():
    if v !=0:
        mi += 1

ma = mi + cnt
if mi == 0: mi = 1
if ma > 8: ma = 8

print(str(mi) + ' ' + str(ma))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

D = {400:0, 800:0, 1200:0, 1600:0, 2000:0, 2400:0, 2800:0, 3200:0}

cnt = 0
for a in A:
    if a < 400:
        D[400]+=1
    elif a < 800:
        D[800]+=1
    elif a < 1200:
        D[1200]+=1
    elif a < 1600:
        D[1600]+=1
    elif a < 2000:
        D[2000]+=1
    elif a < 2400:
        D[2400]+=1
    elif a < 2800:
        D[2800]+=1
    elif a < 3200:
        D[3200]+=1
    elif a >= 3200:
        cnt += 1

mi = 0
ma = 0

for k, v in D.items():
    if v !=0:
        mi += 1

ma = mi + cnt
if cnt == 0: ma = mi
if ma > 8: ma = 8

print(str(mi) + ' ' + str(ma))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

D = {400:0, 800:0, 1200:0, 1600:0, 2000:0, 2400:0, 2800:0, 3200:0}

cnt = 0
for a in A:
    if a < 400:
        D[400]+=1
    elif a < 800:
        D[800]+=1
    elif a < 1200:
        D[1200]+=1
    elif a < 1600:
        D[1600]+=1
    elif a < 2000:
        D[2000]+=1
    elif a < 2400:
        D[2400]+=1
    elif a < 2800:
        D[2800]+=1
    elif a < 3200:
        D[3200]+=1
    elif a >= 3200:
        cnt += 1

mi = 0
ma = 0

for k, v in D.items():
    if v !=0:
        mi += 1

ma = mi + cnt
if ma > 8: ma = 8

print(str(mi) + ' ' + str(ma))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
n  = int(input())
#  = map(int, input().split())
a  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#

colors = [a_ // 400 for a_ in a if a_ < 3200]
colors_3200 = [a_ // 400 for a_ in a if a_ >= 3200]
c = collections.Counter(colors)

min_ = len(c) if c else 1
max_ = min(8, len(c) + len(colors_3200))
print(min_, max_)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

D = {400:0, 800:0, 1200:0, 1600:0, 2000:0, 2400:0, 2800:0, 3200:0}

cnt = 0
for a in A:
    if a < 400:
        D[400]+=1
    elif a < 800:
        D[800]+=1
    elif a < 1200:
        D[1200]+=1
    elif a < 1600:
        D[1600]+=1
    elif a < 2000:
        D[2000]+=1
    elif a < 2400:
        D[2400]+=1
    elif a < 2800:
        D[2800]+=1
    elif a < 3200:
        D[3200]+=1
    else:
        cnt += 1

mi = 0
ma = 0

for k, v in D.items():
    if v !=0:
        mi += 1

ma = mi + cnt
if ma > 8: ma = 8

print(str(mi) + ' ' + str(ma))

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:
        c = i // 400
        color[c] = 1
    else:
        free += 1

ans = sum(color)
print(ans, ans + free)

Submission status: Wrong Answer

Solution code:
n = int(input())
person = list(map(int,input().split())) 
color = [False] * 8
over = []

for i in range(n) :
    if (person[i] < 400) :
        color[0] = True
    elif (person[i] < 800) :
        color[1] = True
    elif (person[i] < 1200) :
        color[2] = True
    elif (person[i] < 1600) :
        color[3] = True
    elif (person[i] < 2000) :
        color[4] = True
    elif (person[i] < 2400) :
        color[5] = True
    elif (person[i] < 2800) :
        color[6] = True
    elif (person[i] < 3200) :
        color[7] = True
    else :
        over.append(True)

p = color.count(True)
if ((color.count(True) == 0) and (over.count(True) > 0)) :
    p = 1

q = color.count(True) + over.count(True)
if (q > 8) :
    q = 8

print(p,q)

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int, input().split()))
color = [0 for _ in range(9)]
for i in range(N):
    if rate[i] <= 399:
        color[0] += 1
    if rate[i] >= 400 and rate[i] <= 799:
        color[1] += 1
    if rate[i] >= 800 and rate[i] <= 1199:
        color[2] += 1
    if rate[i] >= 1200 and rate[i] <= 1599:
        color[3] += 1
    if rate[i] >= 1600 and rate[i] <= 1999:
        color[4] += 1
    if rate[i] >= 2000 and rate[i] <= 2399:
        color[5] += 1
    if rate[i] >= 2400 and rate[i] <= 2799:
        color[6] += 1
    if rate[i] >= 2800 and rate[i] <= 3199:
        color[7] += 1
    if rate[i] >= 3200:
        color[8] += 1
CV = 8- color[0:8].count(0)
print(CV)
if CV == 0:
    mi = 1
else:
    mi = CV
ma = CV + color[8]
print(mi, ma)

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = list(map(int, input().split()))
color = [0 for _ in range(9)]
for i in range(N):
    if rate[i] <= 399:
        color[0] += 1
    if rate[i] >= 400 and rate[i] <= 799:
        color[1] += 1
    if rate[i] >= 800 and rate[i] <= 1199:
        color[2] += 1
    if rate[i] >= 1200 and rate[i] <= 1599:
        color[3] += 1
    if rate[i] >= 1600 and rate[i] <= 1999:
        color[4] += 1
    if rate[i] >= 2000 and rate[i] <= 2399:
        color[5] += 1
    if rate[i] >= 2400 and rate[i] <= 2799:
        color[6] += 1
    if rate[i] >= 2800 and rate[i] <= 3199:
        color[7] += 1
    if rate[i] >= 3200:
        color[8] += 1
CV = 8- color[0:8].count(0)
if color[8] <= CV:
    mi = CV
if color[8] >= CV:
    mi = color[8]
ma = CV + color[8]
print(mi, ma)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N = I()
A = IL()

d = DD(int)
c = 0
for a in A:
  if a<400:
    d["grey"] |= 1
  elif a<800:
    d["gresadfy"] |= 1
  elif a<1200:
    d["greasdfasy"] |= 1
  elif a<1600:
    d["gasdgasegarey"] |= 1
  elif a<2400:
    d["grasgawefawegaey"] |= 1
  elif a<2800:
    d["grawefasdfasdghaey"] |= 1
  elif a<3200:
    d["greawefawdgawefasdfy"] |= 1
  else:
    c += 1
keys = [k for k in d]
s  = sum(d[k] for k in keys)
print(max(1,s),s+c)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N = I()
A = IL()

d = DD(int)
c = 0
for a in A:
  if a<400:
    d["grey"] |= 1
  elif a<800:
    d["gresadfy"] |= 1
  elif a<1200:
    d["greasdfasy"] |= 1
  elif a<1600:
    d["gasdgasegarey"] |= 1
  elif a<2400:
    d["grasgawefawegaey"] |= 1
  elif a<2800:
    d["grawefasdfasdghaey"] |= 1
  elif a<3200:
    d["greawefawdgawefasdfy"] |= 1
  else:
    c += 1
keys = [k for k in d]
s  = sum(d[k] for k in keys)
print(s,s+c)

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

from collections import defaultdict
d = defaultdict(int)

s = set()
extra = 0
for a in A:
    if a >= 3200:
        extra += 1
    else:
        div = a // 400
        s.add(div)

min_ans = max(1, len(s))
max_ans = min(8, len(s) + extra)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

from collections import defaultdict
d = defaultdict(int)

s = set()
extra = 0
for a in A:
    if a >= 3200:
        extra += 1
    else:
        div = a // 400
        s.add(div)

min_ans = len(s) 
max_ans = min(8, len(s) + extra)
print(min_ans, max_ans)

Submission status: Wrong Answer

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

color = [0] * 8
ans = 0

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

print(min(sum(color), 1), sum(color) + ans)

Submission status: Wrong Answer

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

color = [0] * 8
ans = 0

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

print(sum(color), sum(color) + ans)

Submission status: Wrong Answer

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

print(result)
for i in result:
    if i != 0:
        count += 1

Max = count + overColor
#全部3200以上だった場合Minは1色にまとまり，MaxはoverColor
if count == 0:
    count = 1
    Max = overColor

print(count, Max)

Submission status: Wrong Answer

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

for i in result:
    if i != 0:
        Min += 1
        Max += 1

Max += overColor

print(Min, Max)

Submission status: Wrong Answer

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

for i in result:
    if i != 0:
        Min += 1
        Max += 1

Max += overColor

print(Min, Max)

Submission status: Wrong Answer

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

ald = list(map(lambda x : x // 400,al))

allow = list(filter(lambda x: x<8, ald))
reslow = len(set(allow))

alhigh= list(filter(lambda x: x>=8,ald))
reshigh = len(alhigh)

resl = max(reslow,1)
resh = min((reslow+reshigh),8)
print(resl,resh)

Submission status: Wrong Answer

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

ald = list(map(lambda x : x // 400,al))

allow = list(filter(lambda x: x<8, ald))
reslow = len(set(allow))

alhigh= list(filter(lambda x: x>=8,ald))
reshigh = len(alhigh)

res = min((reslow+reshigh),8)
print(reslow,res)

Submission status: Wrong Answer

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

ald = list(map(lambda x : x // 400,al))

allow = list(filter(lambda x: x<8, ald))
reslow = len(set(allow))

alhigh= list(filter(lambda x: x>=8,ald))
reshigh = len(alhigh)

res = min((reslow+reshigh),8)
print(res)

Submission status: Wrong Answer

Solution code:
l = int(input())
m = input().split()

x = []
z = 0
c = 0

for i in range(l):
    if int(m[i]) < 3200:
        y = int(int(m[i]) / 400)
        if y not in x:
            x.append(y)
            z += 1
    elif int(m[i]) >= 3200:
        c += 1
        
if c == 0:
    print(str(z) + " " + str(z))
elif c > 0 and z > 0:
    z2 = c + z
    if z2 > 8:
        z2 = 8
    print(str(z) + " " + str(z2))
elif z == 0:
    if c > 8:
        c = 8
    print("1" + " " + str(c))

Submission status: Wrong Answer

Solution code:
def judge_color(n):
  if 1 <= n <= 399:
    return "gray"
  elif 400 <= n <= 799:
    return "brown"
  elif 800 <= n <= 1199:
    return "green"
  elif 1200 <= n <= 1599:
    return "sky"
  elif 1600 <= n <= 1999:
    return "blue"
  elif 2000 <= n <= 2399:
    return "yellow"
  elif 2400 <= n <= 2799:
    return "orange"
  elif 2800 <= n <= 3199:
    return "red"
  else:
    return "free"

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

d = {}
for each in a:
  color = judge_color(each)
  d[color] = d.get(color, 0) + 1
  
c = d.get("free",0)
l = len(d)
if c == 0:
  print(l, l)
else:
  print(l-1, l-1+c)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))

if len(set(s_a)) + len(b_a) <= 7:
    max = len(set(s_a)) + len(b_a)
else:
    max = 8

print(min, max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))

if len(set(s_a)) + len(b_a) <= 7:
    max = len(set(s_a)) + len(b_a)
else:
    max = 7

print(min, max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))

if len(set(s_a)) + len(b_a) <= 8:
    max = len(set(s_a)) + len(b_a)
else:
    max = 8

print(min, max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
count = 0
col = []

a.sort()

for i in range(N):
    if a[i] not in col and a[i] <= 7:
        col.append(a[i])
    if a[i] > 7:
        for j in range(8):
            if j not in col:
                col.append(j)
                if len(col) != 1:
                    count += 1 
                break
print(len(col) - count, len(col))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
count = 0
col = []

a.sort()

for i in range(N):
    if a[i] not in col and a[i] <= 7:
        col.append(a[i])
    if a[i] > 7:
        for j in range(8):
            if j not in col:
                col.append(j)
                count += 1
                break
print(len(col) - count, len(col))

Submission status: Wrong Answer

Solution code:
x=int(input()) #　a1
a=list(map(int, input().split()))

rate=[0]*8
cl_all=0
for cl in a:
  if cl >=3200:
    cl_all+=1
    continue
  
  rate[cl//400]=1

if sum(rate)==0:
  print(1,1)
else:
  print(sum(rate),sum(rate)+cl_all)

Submission status: Wrong Answer

Solution code:
x=int(input()) #　a1
a=list(map(int, input().split()))

rate=[0]*8
cl_all=0
for cl in a:
  if cl >=3200:
    cl_all+=1
    continue
  
  rate[cl//400]=1

print(sum(rate),sum(rate)+cl_all)

Submission status: Wrong Answer

Solution code:
x=int(input()) #　a1
a=list(map(int, input().split()))

rate=[0]*8
cl_all=0
for cl in a:
  if cl >=3200:
    cl_all+=1
    continue
  
  rate[cl//400]=1

print(sum(rate)+cl_all,sum(rate))

Submission status: Wrong Answer

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

memo = {1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}
over = 0

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

default_color = 0
for key in memo:
    default_color += memo[key]

print(default_color, default_color+over)