結果

問題 No.73 helloworld
コンテスト
ユーザー tnoda_
提出日時 2015-08-06 15:02:21
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 95 ms / 5,000 ms
コード長 494 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 137 ms
コンパイル使用メモリ 77,584 KB
最終ジャッジ日時 2025-12-03 16:08:00
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def fact(x):
    if x == 0:
        return 1
    return x * fact(x - 1)


def combi(r, c):
    return fact(r) / fact(c) / fact(r - c)


def l_max(x):
    res = 0
    for i in range(2, x):
        res = max(res, combi(i, 2) * (x - i))
    return res

C = [input() for i in range(26)]
ans = 1
for i in map(lambda x: ord(x) - ord('a'), 'dehrw'):
    ans *= C[i]
x = C[ord('o') - ord('a')]
ans *= (x/2) * (x - x/2)
ans *= l_max(C[ord('l') - ord('a')])
if ans < 1:
    print(0)
else:
    print(ans)
0