結果

問題 No.73 helloworld
ユーザー tnoda_tnoda_
提出日時 2015-08-06 15:02:21
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 494 bytes
コンパイル時間 954 ms
コンパイル使用メモリ 6,600 KB
実行使用メモリ 6,196 KB
最終ジャッジ日時 2023-09-11 12:03:32
合計ジャッジ時間 1,487 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,016 KB
testcase_01 AC 11 ms
6,164 KB
testcase_02 AC 11 ms
6,112 KB
testcase_03 AC 11 ms
6,168 KB
testcase_04 AC 12 ms
6,064 KB
testcase_05 AC 11 ms
6,128 KB
testcase_06 AC 12 ms
5,996 KB
testcase_07 AC 12 ms
6,032 KB
testcase_08 AC 12 ms
6,008 KB
testcase_09 AC 13 ms
6,024 KB
testcase_10 AC 12 ms
6,000 KB
testcase_11 AC 13 ms
6,092 KB
testcase_12 AC 11 ms
6,048 KB
testcase_13 AC 11 ms
6,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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