結果
問題 | No.73 helloworld |
ユーザー |
![]() |
提出日時 | 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 = Trueif C[7] < 1:test = Falseif C[4] < 1:test = Falseif C[11] < 3:test = Falseif C[14] < 2:test = Falseif C[22] < 1:test = Falseif C[17] < 1:test = Falseif C[3] < 1:test = False#print(test)if test == False:print(0)exit()# 2か所ある文字は2つにどう分配するのがベストか# 分配方法を全探索で調べる必要あるl_count = C[11]l_best = 0for left in range(2, l_count):right = l_count - leftcalc = (left*(left-1)//2) * rightl_best = max(l_best, calc)#print(l_best)o_count = C[14]o_best = 0for left in range(1, o_count):right = o_count - leftcalc = left * righto_best = max(o_best, calc)#print(o_best)ans = 1ans *= C[7]ans *= C[4]ans *= l_bestans *= o_bestans *= C[22]ans *= C[17]ans *= C[3]print(ans)