結果

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

テストケース

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

ソースコード

diff #

from math import factorial


def comb(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, comb(l - i, 2) * (i + 1))
    ans *= n

    print(max(0, ans))

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