結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
FromBooska
|
| 提出日時 | 2023-04-07 06:49:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 5,000 ms |
| コード長 | 1,096 bytes |
| コンパイル時間 | 368 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 52,480 KB |
| 最終ジャッジ日時 | 2024-10-02 18:29:01 |
| 合計ジャッジ時間 | 1,428 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
C = []
for i in range(26):
C.append(int(input()))
#alphabets = 'abcdefghijklmnopqrstuvwxyz'
#print(alphabets[7], alphabets[4], alphabets[11], alphabets[14])
#print(alphabets[22], alphabets[14], alphabets[17], alphabets[11], alphabets[3])
test = True
if C[7] < 1:
test = False
if C[4] < 1:
test = False
if C[11] < 3:
test = False
if C[14] < 2:
test = False
if C[22] < 1:
test = False
if C[17] < 1:
test = False
if C[3] < 1:
test = False
#print(test)
if test == False:
print(0)
exit()
# 2か所ある文字は2つにどう分配するのがベストか
# 分配方法を全探索で調べる必要ある
l_count = C[11]
l_best = 0
for left in range(2, l_count):
right = l_count - left
calc = (left*(left-1)//2) * right
l_best = max(l_best, calc)
#print(l_best)
o_count = C[14]
o_best = 0
for left in range(1, o_count):
right = o_count - left
calc = left * right
o_best = max(o_best, calc)
#print(o_best)
ans = 1
ans *= C[7]
ans *= C[4]
ans *= l_best
ans *= o_best
ans *= C[22]
ans *= C[17]
ans *= C[3]
print(ans)
FromBooska