結果
| 問題 | 
                            No.73 helloworld
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2015-12-14 22:29:16 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 29 ms / 5,000 ms | 
| コード長 | 510 bytes | 
| コンパイル時間 | 72 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-06-29 12:18:28 | 
| 合計ジャッジ時間 | 922 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
ソースコード
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()