Problem p03695 (python)

Fixed submission:
#レート
#1-399：灰色
#400-799：茶色
#800-1199：緑色
#1200-1599：水色
#1600-1999：青色
#2000-2399：黄色 
#2400-2799：橙色
#2800-3199：赤色

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

colors = []
color = ""
another = 0

for point in scores:
  if point <= 399:
    color = "gray"
    if color not in colors:
      colors.append(color)
  elif point <= 799:
    color = "brown"
    if color not in colors:
      colors.append(color)
  elif point <= 1199:
    color = "green"
    if color not in colors:
      colors.append(color)
  elif point <= 1599:
    color = "sky"
    if color not in colors:
      colors.append(color)
  elif point <= 1999:
    color = "blue"
    if color not in colors:
      colors.append(color)
  elif point <= 2399:
    color = "yellow"
    if color not in colors:
      colors.append(color)
  elif point <= 2799:
    color = "orange"
    if color not in colors:
      colors.append(color)
  elif point <= 3199:
    color = "red"
    if color not in colors:
      colors.append(color)
  elif point > 3199:
    another += 1
    
ans = len(colors)
if ans == 0:
  print(1,another)
else:
  print(ans,ans + another)

Buggy submission (verdict: Runtime Error):
#レート
#1-399：灰色
#400-799：茶色
#800-1199：緑色
#1200-1599：水色
#1600-1999：青色
#2000-2399：黄色 
#2400-2799：橙色
#2800-3199：赤色



N = int(input())
scores = sorted(list(map(int,input().split())))
colors = []

color = ""
another = 0

for point in scores:
  if point <= 399:
    color = "gray"
    if color not in colors:
      colors.append(color)
  elif point <= 799 and points :
    color = "brown"
    if color not in colors:
      colors.append(color)
  elif point <= 1199:
    color = "sky"
    if color not in colors:
      colors.append(color)
  elif point <= 1999:
    color = "blue"
    if color not in colors:
      colors.append(color)
  elif point <= 2399:
    color = "yellow"
    if color not in colors:
      colors.append(color)
  elif point <= 2799:
    color = "orange"
    if color not in colors:
      colors.append(color)
  elif point <= 3199:
    color = "red"
    if color not in colors:
      colors.append(color)
  elif point > 3199:
    another += 1
    
ans = len(colors)
if ans == 0:
  print(1,another)
else:
  print(ans,ans + another)

Buggy submission (verdict: Runtime Error):
#レート
#1-399：灰色
#400-799：茶色
#800-1199：緑色
#1200-1599：水色
#1600-1999：青色
#2000-2399：黄色 
#2400-2799：橙色
#2800-3199：赤色



N = int(input())
scores = sorted(list(map(int,input().split())))
colors = []

color = ""
another = 0

for point in scores:
  if point <= 399:
    color = "gray"
    if color not in colors:
      colors.append(color)
  elif point <= 799 and points :
    color = "brown"
    if color not in colors:
      colors.append(color)
  elif point <= 1199:
    color = "sky"
    if color not in colors:
      colors.append(color)
  elif point <= 1999:
    color = "blue"
    if color not in colors:
      colors.append(color)
  elif point <= 2399:
    color = "yellow"
    if color not in colors:
      colors.append(color)
  elif point <= 2799:
    color = "orange"
    if color not in colors:
      colors.append(color)
  elif point <= 3199:
    color = "red"
    if color not in colors:
      colors.append(color)
  elif point > 3199:
    another += 1
    
ans = len(colors)

print(ans,ans + another)