結果

問題 No.73 helloworld
ユーザー FromBooskaFromBooska
提出日時 2023-04-07 06:49:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 1,096 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-04-10 16:11:09
合計ジャッジ時間 1,514 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,224 KB
testcase_01 AC 34 ms
52,480 KB
testcase_02 AC 31 ms
52,224 KB
testcase_03 AC 30 ms
52,608 KB
testcase_04 AC 30 ms
52,352 KB
testcase_05 AC 30 ms
52,608 KB
testcase_06 AC 31 ms
52,096 KB
testcase_07 AC 31 ms
52,224 KB
testcase_08 AC 31 ms
52,096 KB
testcase_09 AC 30 ms
51,968 KB
testcase_10 AC 32 ms
51,968 KB
testcase_11 AC 30 ms
52,096 KB
testcase_12 AC 31 ms
52,096 KB
testcase_13 AC 33 ms
52,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)



0