結果

問題 No.73 helloworld
ユーザー MitI_7MitI_7
提出日時 2015-12-14 22:29:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 510 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 11,008 KB
実行使用メモリ 8,144 KB
最終ジャッジ日時 2023-09-11 22:45:43
合計ジャッジ時間 1,278 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,988 KB
testcase_01 AC 17 ms
8,000 KB
testcase_02 AC 16 ms
8,000 KB
testcase_03 AC 16 ms
7,984 KB
testcase_04 AC 17 ms
8,052 KB
testcase_05 AC 17 ms
7,988 KB
testcase_06 AC 16 ms
7,920 KB
testcase_07 AC 17 ms
7,916 KB
testcase_08 AC 16 ms
7,988 KB
testcase_09 AC 17 ms
7,916 KB
testcase_10 AC 17 ms
7,940 KB
testcase_11 AC 16 ms
7,916 KB
testcase_12 AC 17 ms
8,144 KB
testcase_13 AC 16 ms
7,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial


def combinations(n, k):
    return factorial(n) // (factorial(k) * factorial(n - k))


def main():
    alp = dict()
    for i in range(26):
        alp[chr(i + 97)] = int(input())

    ans = 1
    for c in "hewrd":
        ans *= alp[c]

    o = alp['o']
    ans *= o // 2 * (o - o // 2)

    l = alp['l'] - 1
    n = 0
    for i in range(l - 1):
        n = max(n, combinations(l - i, 2) * (i + 1))
    ans *= n

    print(max(0, ans))

    
if __name__ == '__main__':
    main()
0