結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
tnoda_
|
| 提出日時 | 2015-08-06 15:02:21 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 5,000 ms |
| コード長 | 494 bytes |
| コンパイル時間 | 479 ms |
| コンパイル使用メモリ | 6,784 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2024-06-29 02:35:58 |
| 合計ジャッジ時間 | 1,422 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
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)
tnoda_