AtCoder Beginner Contest 064

Submission #1777493

Source codeソースコード

num = int(input())

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

dict = {"rainbow":0, "red":0, "orange":0, "yellow":0, "blue":0, "water":0, "green":0, "brown":0, "gray":0}
for i in rate:
    if i >= 3200:
        dict["rainbow"] += 1
    elif i >= 2800:
        dict["red"] = 1
    elif i >= 2400:
        dict["orange"]= 1
    elif i >= 2000:
        dict["yellow"] = 1
    elif i >= 1600:
        dict["blue"] += 1
    elif i >= 1200:
        dict["water"] = 1
    elif i >= 800:
        dict["green"] = 1
    elif i >= 400:
        dict["brown"] = 1
    elif i >= 0:
        dict["gray"] = 1

color = 0
rainbow = 0
for item, value in dict.items():
    print(item, value)
    if value > 0 and item != "rainbow":
        color += 1

color_min = color if color != 0 else 1
color_max = color if dict["rainbow"] == 0 else color + dict["rainbow"]

if color_max > 8:
    color_max = 8

print(color_min, color_max)

Submission

Task問題 C - Colorful Leaderboard
User nameユーザ名 TM
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 WA
Score得点 0
Source lengthソースコード長 946 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - s1.txt,s2.txt,s3.txt
All 0 / 300 in1.txt,in2.txt,in3.txt,in4.txt,in5.txt,s1.txt,s2.txt,s3.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
in1.txt WA
in2.txt WA
in3.txt WA
in4.txt WA
in5.txt WA
s1.txt WA
s2.txt WA
s3.txt WA