結果

問題 No.73 helloworld
ユーザー FromBooskaFromBooska
提出日時 2024-03-18 16:07:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 1,290 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 53,460 KB
最終ジャッジ日時 2024-03-18 16:07:27
合計ジャッジ時間 1,781 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 34 ms
53,460 KB
testcase_03 AC 34 ms
53,460 KB
testcase_04 AC 35 ms
53,460 KB
testcase_05 AC 35 ms
53,460 KB
testcase_06 AC 36 ms
53,460 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 35 ms
53,460 KB
testcase_09 AC 35 ms
53,460 KB
testcase_10 AC 35 ms
53,460 KB
testcase_11 AC 35 ms
53,460 KB
testcase_12 AC 36 ms
53,460 KB
testcase_13 AC 35 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 2か所にでてくるlとoをどう分けるか、まあ平均的に分けた方がいいだろう

d_count = 0
e_count = 0
h_count = 0
l_count = 0
o_count = 0
r_count = 0
w_count = 0

for i in range(26):
    c = int(input())
    if i == 3:
        d_count = c
    elif i == 4:
        e_count = c
    elif i == 7:
        h_count = c
    elif i == 11:
        l_count = c
    elif i == 14:
        o_count = c
    elif i == 17:
        r_count = c
    elif i == 22:
        w_count = c

#print('l_count', l_count, 'o_count', o_count)

if l_count < 3:
    l1 = 0
    l2 = 0
else:
    excess = l_count-3
    #print('excess', excess)
    highest = 0
    alloc1 = -1
    for allocate1 in range(0, excess+1):
        calc = ((2+allocate1)*(2+allocate1-1)//2)*(1+(excess-allocate1))
        #print('allocate1', allocate1, 'calc', calc, 'highest', highest, 'alloc1', alloc1)
        if calc > highest:
            highest = calc
            alloc1 = allocate1  
    l1 = 2+alloc1
    l2 = 1+(excess-alloc1)

if o_count < 2:
    o1 = 0
    o2 = 0
else:
    excess = o_count-2
    o1 = 1+(excess)//2
    o2 = 1+(excess+1)//2

#print(l1, l2, o1, o2)

ans = 1
ans *= h_count
ans *= e_count
ans *= l1*(l1-1)//2
ans *= o1
ans *= w_count
ans *= o2
ans *= r_count
ans *= l2
ans *= d_count
print(ans)

0