結果

問題 No.398 ハーフパイプ(2)
ユーザー matsu7874matsu7874
提出日時 2016-07-16 00:13:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,474 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-23 13:00:28
合計ジャッジ時間 1,749 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 88 ms
10,880 KB
testcase_03 AC 88 ms
11,008 KB
testcase_04 WA -
testcase_05 AC 54 ms
10,752 KB
testcase_06 WA -
testcase_07 AC 68 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 56 ms
10,880 KB
testcase_10 AC 55 ms
10,880 KB
testcase_11 AC 49 ms
10,880 KB
testcase_12 AC 69 ms
10,880 KB
testcase_13 AC 67 ms
10,880 KB
testcase_14 AC 70 ms
10,880 KB
testcase_15 WA -
testcase_16 AC 68 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func = [1, 1, 2, 6, 24, 120, 720]


def calc(a, b, c, d):
    total = 0
    if a == b and b == c and c == d:
        return 24 * a * (100 - a) + 601
    elif a > b and b == c and c == d:
        
        p = [1, 3]
    elif a == b and b > c and c == d:
        p = [2, 2]
    elif a > b and b > c and c == d:
        p = [1, 1, 2]
    elif a == b and b == c and c > d:
        p = [3, 1]
    elif a > b and b == c and c > d:
        p = [1, 2, 1]
    elif a == b and b > c and c > d:
        p = [2, 1, 1]
    elif a > b and b > c and c > d:
        p = [1, 1, 1, 1]
    else:
        print(a, b, c, d)
        exit()
    t = func[p[0]+1] * func[p[-1]+1]
    if len(p) > 2:
        t *= func[p[1]]
    return 720//t*((100-a)*(p[0]+1)+1)*(d*(p[-1]+1)+1)

    t = func[6] // func[p[-1] + 1] // func[p[0] + 1]
    for e in p[1:-1]:
        t //= func[e]
    total += t

    t = d * func[6] // func[p[0] + 1]
    for e in p[1:]:
        t //= func[e]
    total += t

    t = (100 - a) * func[6] // func[p[-1] + 1]
    for e in p[:-1]:
        t //= func[e]
    total += t

    t = (100 - a) * d * func[6]
    for e in p:
        t //= func[e]
    total += t

    return total


x = float(input())
y = int(x * 4)
total = 0
for a in range(int(x), min(100, y) + 1):
    for b in range(0, min(int(2 * x), a) + 1):
        for c in range(0, min(int(4 / 3 * x), b) + 1):
            d = y - a - b - c
            if 0 <= d <= c:
                total += calc(a, b, c, d)
print(total)
0