結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 33 ms
10,752 KB
testcase_02 AC 94 ms
10,624 KB
testcase_03 AC 92 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 54 ms
10,752 KB
testcase_06 WA -
testcase_07 AC 79 ms
10,624 KB
testcase_08 AC 34 ms
10,752 KB
testcase_09 AC 65 ms
10,880 KB
testcase_10 AC 59 ms
10,752 KB
testcase_11 AC 55 ms
10,752 KB
testcase_12 AC 75 ms
10,880 KB
testcase_13 AC 72 ms
10,752 KB
testcase_14 AC 75 ms
10,624 KB
testcase_15 WA -
testcase_16 AC 74 ms
10,752 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)


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) + 2):
        if b>a:
            continue
        for c in range(0, min(int(4 / 3 * x), b) + 2):
            if c>b:
                continue
            d = y - a - b - c
            if 0 <= d <= c:
                total += calc(a, b, c, d)
print(total)
0